<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
Find the Enemy prefab in the Assets/Project Files/Game/Prefabs/Enemy and Obstacles
folder and drag it into the hierarchy window. Select it.
On the Inspector window find the Character Enemy
script, scroll to the very bottom, and find Hat Behavior -> Holder Transform field. Click Hat Holder (Transform) to reveal it in Hierarchy.
The object Hat Holder will be highlighted in the Hierarchy window. Drag your new skin model here (so it becomes a child of the object) like this:
Using the Scene window adjust the position and scale of the hat object
Note somewhere the skin object’s position after adjustment, we will need it later
Drag and drop the adjusted skin object into the Project Files/Game/Prefabs/Hats
folder - prefab will be created
While a new hat prefab is selected press the Add Component button in the Inspector window, type in Rigidbody in the search area, and select it.
Adjust the Mass value on the Rigidbody
component (5-7 works well for hats). You can change other settings, it will affect how the hat behaves after being knocked out from the head.
Now you can delete the Enemy prefab from the scene, we don’t need it anymore
Select the Hat Skins Database object located in the Project Files/Data/Skins
folder.
Click the little +
button at the bottom of the list to add another skin.
Assign the preview image, the prefab created in Step 6, and the Hat Offset value noted in Step 5. This database will provide skins to other game modules in our case to the store.
Select the Skins Store Database object located in the Project Files/Data/Skins
folder. This database stores settings of all products displayed in the store.
Select the Hats tab at the top of the Product part of the window
Click the little +
button at the bottom of the Products section to add another product.
Click the product called New Element to configure the fields:
Name - a name of the product (just for your convenience)
Opened Sprite - image of your product when it’s purchased
Locked Sprite - image of your product when not purchased
2D Sprite Preview - leave it blank as the store uses 3D preview in this case.
Skin Id - select the required product form the list.
Purchase Type - the product can be purchased using currency or by watching rewarded videos
Currency - a currency used for purchasing
Cost - the amount of required currency to purchase the product or amount of required RVs.
Tab - select the available store tab. You can configure tabs in the Tabs
section above.
Is Dummy - if the variable is checked product won’t be interactable