NameCache - jimdroberts/FishMMO GitHub Wiki

Description

ScriptableObject cache for storing a list of character names.


API Access

Fields

  • public List Names

    List of available character names.


Basic Usage

Setup

  1. Create a new NameCache asset via the Unity Editor (Assets > Create > FishMMO > Character > Name Cache).
  2. Add character names to the Names list in the Inspector.
  3. Reference the NameCache asset in scripts or systems that require access to available names.

Example

// Example 1: Accessing names from the cache
NameCache cache = ...; // Reference to the NameCache asset
foreach (string name in cache.Names) {
    Debug.Log($"Available name: {name}");
}

Best Practices

  • Keep the Names list organized and free of duplicates for best user experience.
  • Use NameCache to centralize and manage available character names for creation or randomization.
  • Document the intended use of the cache in the asset's Inspector description.
⚠️ **GitHub.com Fallback** ⚠️