Table of Contents

Class RaceTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

ScriptableObject template for a race: models, attributes, starting abilities, inventory and equipment for playable races, and the naming data the name generator draws on for every race. A race with Playable off exists only to name things — it has no prefab or models, is skipped by character creation, and loads no placeholder model.

[CreateAssetMenu(fileName = "New Race", menuName = "FishMMO/Character/Race/Race", order = 1)]
public class RaceTemplate : CachedScriptableObject<RaceTemplate>, ICachedObject
Inheritance
Object
ScriptableObject
RaceTemplate
Implements
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.MemberwiseClone()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

BiomeAffinities

Biomes this race realistically belongs in, weighted. Naming draws a home biome from these when none is given, and spawners can ask which races suit a place.

[Header("Biomes")]
[Tooltip("Where this race is at home. Weighted; empty means no preference.")]
public List<BiomeAffinity> BiomeAffinities

Field Value

List<BiomeAffinity>

BreathesWater

Whether this race breathes under water and never drowns.

[Tooltip("Breathes under water: its breath never runs down.")]
public bool BreathesWater

Field Value

bool

Category

Phonology, cultures, titles, places and city suffixes the name generator uses for this race.

[Header("Classification")]
[Tooltip("Broad family: Humanoid, Giant, Fey, Beastfolk, Beast, Draconic, Aquatic, Undead, Construct, Elemental, Outsider, Plant, Aberration. Title pools serve categories.")]
public string Category

Field Value

string

DamageImmunities

Damage this race takes none of, whatever its resistances: a fire race's fire, lava included (2026-10-05: fire races are fire immune, and a city under the lava should be possible).

[Header("Environment")]
[Tooltip("Damage types this race is immune to: none of it lands, before resistance. Fire races list Fire Damage, so lava cannot hurt them and they swim in it.")]
public List<DamageAttributeTemplate> DamageImmunities

Field Value

List<DamageAttributeTemplate>

DefaultProportions

Default body proportions for this race. Applied via bone scaling on character spawn. Examples: Human (all 1.0), Dwarf (Height 0.75, LegLength 0.70, ArmLength 0.85), Elf (Height 1.05, LegLength 1.15, ArmLength 1.10).

public RaceProportions DefaultProportions

Field Value

RaceProportions

Description

Description of the race.

public string Description

Field Value

string

GenderedModels

Gender-specific model references for this race. Use Unspecified for generic/default models.

public List<GenderedRaceModelSet> GenderedModels

Field Value

List<GenderedRaceModelSet>

InitialAttributes

Initial attribute database for the race.

public CharacterAttributeTemplateDatabase InitialAttributes

Field Value

CharacterAttributeTemplateDatabase

Loaded

The races loaded now (OnLoad to OnUnload), for a module that installs after some were loaded.

public static readonly HashSet<RaceTemplate> Loaded

Field Value

HashSet<RaceTemplate>

Naming

[Header("Naming")]
public RaceNamingData Naming

Field Value

RaceNamingData

PlaceholderModel

This model is loaded during ClientPreboot as a static model reference for this Race. It will be replaced by the player's selected model at runtime.

public AssetReference PlaceholderModel

Field Value

AssetReference

Playable

True for a race players can create and NPCs can be built from. False for a naming-only race: character creation skips it and no placeholder model is loaded for it.

[Tooltip("Off for a naming-only race: no prefab or models, hidden from character creation.")]
public bool Playable

Field Value

bool

Prefab

The prefab for the race.

public GameObject Prefab

Field Value

GameObject

StartingAbilities

List of starting abilities for the race.

public List<AbilityTemplate> StartingAbilities

Field Value

List<AbilityTemplate>

StartingEquipment

List of starting equipment for the race.

public List<EquippableItemTemplate> StartingEquipment

Field Value

List<EquippableItemTemplate>

StartingInventoryItems

List of starting inventory items for the race.

public List<BaseItemTemplate> StartingInventoryItems

Field Value

List<BaseItemTemplate>

Properties

Name

The name of the race (from the ScriptableObject name).

public string Name { get; }

Property Value

string

NamingKey

Key the name generator files this race under: the asset name lowercased with everything but letters removed, so "Wood Elf" is requested as "woodelf".

public string NamingKey { get; }

Property Value

string

Methods

AffinityFor(int)

This race's affinity for a biome, or 0 when it has none.

public float AffinityFor(int biomeID)

Parameters

biomeID int

Returns

float

GetModelCount(CharacterGender)

Gets the number of model references available for a gender, including fallback models.

public int GetModelCount(CharacterGender gender)

Parameters

gender CharacterGender

The selected character gender.

Returns

int

The number of available model references.

GetModelName(int)

Gets the display name for a model in the flattened gendered model list.

public string GetModelName(int index)

Parameters

index int

The flattened model index.

Returns

string

The model asset name, or an empty string when unavailable.

GetModelReference(CharacterGender, int)

Gets the model reference for the given gender and index, or the placeholder if selection fails.

public AssetReference GetModelReference(CharacterGender gender, int index)

Parameters

gender CharacterGender

The selected character gender.

index int

The model index.

Returns

AssetReference

The asset reference for the model.

GetModelReference(int)

Gets the model reference for the given index, or the placeholder if out of range or models are missing.

public AssetReference GetModelReference(int index)

Parameters

index int

The model index.

Returns

AssetReference

The asset reference for the model.

GetModels(CharacterGender)

Gets model references for a specific gender.

public List<AssetReference> GetModels(CharacterGender gender)

Parameters

gender CharacterGender

The selected character gender.

Returns

List<AssetReference>

The matching model list, or null when no matching gender list exists.

IsImmuneTo(DamageAttributeTemplate)

True when this race takes none of damage.

public bool IsImmuneTo(DamageAttributeTemplate damage)

Parameters

damage DamageAttributeTemplate

Returns

bool

LoadPlaceholderModel()

Loads the placeholder model for the race using Addressables.

public void LoadPlaceholderModel()

Of(ICharacter)

The race of any character: a player's own, or an NPC's. Null when it has none.

public static RaceTemplate Of(ICharacter character)

Parameters

character ICharacter

Returns

RaceTemplate

OnLoad(string, string, int)

Called when the race is loaded. Loads the placeholder model.

public override void OnLoad(string typeName, string resourceName, int resourceID)

Parameters

typeName string

The type name of the resource.

resourceName string

The resource name.

resourceID int

The resource ID.

OnUnload(string, string, int)

Called when the race is unloaded. Unloads the placeholder model.

public override void OnUnload(string typeName, string resourceName, int resourceID)

Parameters

typeName string

The type name of the resource.

resourceName string

The resource name.

resourceID int

The resource ID.

UnloadPlaceholderModel()

Unloads the placeholder model for the race using Addressables.

public void UnloadPlaceholderModel()

Events

RaceLoaded

Raised when a race is loaded and unloaded. The Naming module's race registry follows these (Phase 4 of the core and modules plan, 2026-11-18): the core names nothing of the name generator.

public static event Action<RaceTemplate> RaceLoaded

Event Type

Action<RaceTemplate>

RaceUnloaded

Raised when a race is loaded and unloaded. The Naming module's race registry follows these (Phase 4 of the core and modules plan, 2026-11-18): the core names nothing of the name generator.

public static event Action<RaceTemplate> RaceUnloaded

Event Type

Action<RaceTemplate>