NameCache - jimdroberts/FishMMO GitHub Wiki
ScriptableObject cache for storing a list of character names.
-
public List Names
List of available character names.
- Create a new NameCache asset via the Unity Editor (Assets > Create > FishMMO > Character > Name Cache).
- Add character names to the Names list in the Inspector.
- Reference the NameCache asset in scripts or systems that require access to available names.
// 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}");
}
- 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.