CosmeticPresetsManager
A class in Root.Township, Alta.Customization.
Client: runs the cosmetic preset shelf. On login it loads the account's saved presets into trophies on the slots, and it makes new trophies from the current outfit.
- Listed in Customization and screenshots
- Inherits or implements
LoggedInTool
Constructors
| Member | What it is |
|---|---|
CosmeticPresetsManager() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
14 private and internal fields
| Member | What it is |
|---|---|
private PlayerCustomizationHandler baseHandler | Customization handler for the player's own outfit. |
private AltaEvent beganUsingFromStore | Event raised when the outfit starts using items the player doesn't own. |
private CosmeticCustomizationManager customizationManager | The cosmetic customization manager in the room. |
private PlayerCustomizationHandler handlerPrefab | Customization handler prefab. Not used in this class. |
private bool isDestroyed | Set in OnDestroy. |
private bool isUsingOnlyOwnedItems | Last known state of whether the outfit uses only owned items. |
private CosmeticPresetTrophy latestTrophy | The last trophy made by GetCurrentPreset. Burned if a new one is made before it is shelved. |
private static Logger logger | NLog logger for this class. |
private Transform newPresetsPosition | Where new trophies appear. |
private AltaEvent requestPresetFromStore | Event raised when the outfit needs store items before it can become a preset. |
private CosmeticRotatingSlot rotatingSlot | A CosmeticRotatingSlot reference. Not used in this class. |
private CosmeticPresetSlot[] slots | The preset shelf slots. |
private AltaEvent stopedUsingFromStore | Event raised when the outfit goes back to only owned items. |
private CosmeticPresetTrophy trophyPrefab | Prefab for preset trophies. |
Methods
5 private and internal methods
| Member | What it is |
|---|---|
private async void CheckSavePresetIfEmpty() | When the player finishes customizing and no preset is saved, saves the current outfit as preset 0. |
private void CheckStorageUsage(uint definition) | Raises the store events when the outfit switches between only owned items and items from the store. |
private CosmeticPresetTrophy GetNewTrophy() | Spawns a local, non-networked trophy from the prefab. |
private void OnDisable() | Destroys every trophy on the shelf and the latest unsaved trophy. |
private void SetupWithManager(PlayerCharacterCustomizationManager manager) | Watches the customization manager's cosmetics for changes, or waits until the handler has one. |
Used in
Members of other types that take, return or hold a CosmeticPresetsManager: