PlayerCosmeticCategory
A class in Root.Township, Alta.Customization.
A category of player cosmetics (a slot such as a hat or shirt), loaded from Resources/Cosmetic Categories. Picks random items for random outfits.
- Listed in Customization and screenshots
- Inherits or implements
CustomizationCategory - Attributes
CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
PlayerCosmeticCategory() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private static PlayerCosmeticCategory[] allCategories | Backing field for AllCategories. Reloaded every time in the editor. |
private const string CategoriesFolder | Resources folder the categories load from: "Cosmetic Categories". |
private float flatNullChance | Chance that a random pick returns nothing for this category. |
private float nullElementWeight | Weight of "nothing" against the item count in random picks. |
Properties
| Member | What it is |
|---|---|
static PlayerCosmeticCategory[] AllCategories { get; } | Every active category, sorted by priority. Loaded once, or every time in the editor. |
Methods
| Member | What it is |
|---|---|
override uint GetRandom(ICollection<uint> items, bool canUseNonOwnedItems) | Picks a random item, or none by the category's null chances. The ID version only picks owned items, or available ones if allowed. |
override ICustomizationDefinition GetRandom(ICollection<ICustomizationDefinition> items) | Picks a random item, or none by the category's null chances. The ID version only picks owned items, or available ones if allowed. |
1 private and internal method
Used in
Members of other types that take, return or hold a PlayerCosmeticCategory:
CategoryScrollElement.Category, CategoryScrollManager.available, CategoryScrollManager.categories, CategoryScrollManager.GetAllCategories, CategoryScrollManager.GetAvailableCategories, CosmeticOwnershipManager.available, CosmeticOwnershipManager.Available, CosmeticOwnershipManager.GetCategoryOptions, CosmeticOwnershipManager.owned, CosmeticOwnershipManager.Owned, CosmeticScrollManager.currentCategory, CosmeticScrollManager.initialCategory, CosmeticScrollManager.UpdateCategory, PurchasableMap.GetItemCategory, PurchasableMap.CosmeticCategory.category, PlayerLikeSpectralGhost.owned.