<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 such as screws, planks, base boards, and holes. Designed with modularity in mind, it seamlessly integrates with custom meta mechanics, allowing skins to be unlocked or rewarded through mechanisms like daily rewards or mission rewards. 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 PlanksSkinData script defines the core structure for plank skins within the game. This ScriptableObject includes all essential fields to customize the appearance of planks and associated level elements. It contains:
To create a new PlanksSkinData instance, navigate to the editor menu and select Create -> Content -> Skins -> Plank Skin Data. This will generate a new ScriptableObject that can be configured for unique plank skins.
Once a PlanksSkinData object is created, it must be registered within the Planks Skin Database for it to be available in the game. To do this:
Adding PlanksSkinData to the database ensures that the newly created plank skins are accessible in-game and can be dynamically applied.
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
PlankSkinData skinData = (PlankSkinData)SkinsController.Instance.GetSelectedSkin<PlanksSkinsDatabase>();
// SelectSkin method selects a skin using an ISkinData instance or a skin ID
SkinsController.Instance.SelectSkin(skinData);
SkinsController.Instance.SelectSkin(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
SkinsController.Instance.UnlockSkin(skinData, select: false);
SkinsController.Instance.UnlockSkin(skinData.ID, select: false);
// IsSkinUnlocked method checks if a skin is unlocked based on its ID
if (SkinsController.Instance.IsSkinUnlocked(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 PlanksSkinData object is created and linked to the database, you can make it available in the store by following these steps: