<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
The Skin System enables quick and flexible customization of game visuals for elements. Designed with modularity in mind, it seamlessly integrates with custom meta mechanics, allowing skins to be unlocked or rewarded through mechanisms like daily rewards, mission rewards, or any other meta systems. With intuitive editor tools, the Skin System streamlines the process of adding, changing, or removing skins, making it both accessible and efficient for designers and developers.
The LevelSkinData class is used to manage the visual appearance of the game's level elements. It stores different images and colors that can be applied to the blocks within a level.
Skin Data is stored in the Level Skin Database scriptable object and contains the following variables:
Id - A unique identifier used to determine which skin should be loaded.
Preview Sprite - The sprite used in the Store UI.
Sprites - An array of SpriteData objects, each representing a different type of element sprite with associated colors.
Type: The type of block.
Image: The actual image used for the block.
Preview Color: The color used for preview effects.
Burst Color: The color used for burst particle effects.
Special Sprite - A background sprite is used as an alternative to the actual image when a Сollectable object is attached to the block.
The Skin Picker is an editor toolset designed to streamline the selection of skin IDs from the database. It consists of a custom property and an editor window, which provide a visual demonstration and ID validation for a convenient and user-friendly selection process.
To apply the Skin Picker to a serializable string variable, simply add the SkinPicker attribute to it. This allows the variable to utilize the Skin Picker toolset, improving workflow efficiency when assigning skins.
// GetSelectedSkin method retrieves the currently selected skin by accessing the skins database
LevelSkinData skinData = (LevelSkinData)SkinController.Instance.GetSelectedSkin<LevelSkinDatabase>();
// SelectSkin method selects a skin using an ISkinData instance or a skin ID
SkinController.Instance.SelectSkin(skinData);
SkinController.Instance.SelectSkin([skinData.ID](<http://skindata.id/>));
// UnlockSkin method unlocks a skin using an ISkinData instance or skin ID
// If the second parameter is true, the skin will be automatically selected after being unlocked
SkinController.Instance.UnlockSkin(skinData, select: false);
SkinController.Instance.UnlockSkin([skinData.ID](<http://skindata.id/>), select: false);
// IsSkinUnlocked method checks if a skin is unlocked based on its ID
if (SkinController.Instance.IsSkinUnlocked([skinData.ID](<http://skindata.id/>)))
{
// Skin is unlocked
}
The Skin Store is a meta mechanic that allows players to purchase skins using in-game currency or by watching rewarded ads. Once a LevelSkinData is added to the database, you can make it available in the store by following these steps:
Assets/Project Files/Data/Skins
folder.