Purchasable
A class in Root.Township, Alta.Customization.
Base asset for a shop item or cosmetic that can be owned, loaded through Addressables by its hash. With external cosmetics on, the catalog comes from Alta's DigitalOcean bundle store.
- Listed in Customization and screenshots
- Inherits or implements
ScriptableObject - Derived types
CosmeticSetDefinition,PlayerCosmeticDefinition
Constructors
| Member | What it is |
|---|---|
Purchasable() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|---|
static Dictionary<uint, Purchasable> LoadedPurchasables | Every purchasable by hash, once LoadAllIntoRAM has run. Null before that. |
protected string sku | Backing field for Sku. |
11 private and internal fields
Properties
1 private and internal property
Methods
| Member | What it is |
|---|---|
static async Task CheckCatalogAsync() | Loads the remote Addressables catalog once, if the build uses external cosmetics. |
static async Task<T> Get<T>(AddressableSession session, string sku) | Loads a purchasable by SKU or hash, from RAM if preloaded. Retries once after a catalog refresh, then logs an error. |
static async Task<T> Get<T>(AddressableSession session, uint hash) | Loads a purchasable by SKU or hash, from RAM if preloaded. Retries once after a catalog refresh, then logs an error. |
static async Task LoadAllIntoRAM() | Loads every purchasable listed in PurchasableMap into LoadedPurchasables, so later Get calls skip Addressables. |
void SetDisplayName(string name) | Sets the display name. |
void SetHash(uint hash) | Sets the hash. |
void SetSku(string sku) | Sets the SKU. |
5 private and internal methods
Used in
Members of other types that take, return or hold a Purchasable: