Skip to main content

AssetPool

A central ScriptableObject repository for all runtime-accessible assets used in character customization, gameplay progression, inventory, quests, achievements, and more. This pool provides fast lookup methods, batch utilities, and Firebase export integration.

[CreateAssetMenu(menuName = "m00m/AssetPool", fileName = "AssetPool")]
public class AssetPool : ScriptableObject

Purpose

  • Serves as a content registry for avatar items, packs, equipment, quests, and achievements
  • Supports ID-based lookups and content filtering
  • Handles Firebase upload of the complete unlockable/purchasable set
  • Generates random outfits for development use

Major Categories

Player Content

  • PlayerItemsList, DefaultPlayerItems, HiddenDefaultPlayerItems
  • PlayerItemPacks
  • PlayerEquipment
  • PurchasableOutfits

Gameplay Content

  • Achievements
  • Emotes
  • Quests
  • BuildItems, Colorways, ContainerExpansions
  • SongCollections
  • GraffitiDesigns

Key Methods

Lookup Utilities

  • GetPlayerItemByID(string id)
  • TryGetXByID(string id, out T result) — Exists for most item categories
  • GetBuildItemsByCategory(CategoryThemeTag category)
  • GetUnpurchasedItems()

Outfit Tools

  • GenerateRandomOutfit()
    Auto-generates a random PlayerOutfit asset from available gear. Editor-only.

Firebase Sync

  • SendMasterListToFirebase()
    Compiles and sends a combined list of all unlockables and inventory items to Firebase for server syncing.

Aggregation

  • GatherPacks()
    Rebuilds PlayerItemsList from various default, hidden, and pack-based sources. Also ensures uniqueness.

Sample Use

var randomHat = AssetPoolInstance.GetPlayerItemByID("hat_12");
var isFound = AssetPoolInstance.TryGetOutfitByID("casualPack", out var outfit);
AssetPoolInstance.SendMasterListToFirebase();

Notes

  • PlayerItemsList is dynamically generated and should not be edited directly.
  • Many TryGet and Get functions serve different serialization needs (e.g., emotes use emoteID, quests use questID, etc.).
  • Intended to be accessed as a global singleton or injected contextually.
[Inject]
AssetPool _assetPool;

_assetPool.GetAchievementByID("daily_master");