Table of Contents

Class RaceTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

ScriptableObject template for defining a playable race, including models, attributes, starting abilities, inventory, and equipment.

[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.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

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

InitialFaction

The initial faction for the race.

public FactionTemplate InitialFaction

Field Value

FactionTemplate

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

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

Methods

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.

LoadPlaceholderModel()

Loads the placeholder model for the race using Addressables.

public void LoadPlaceholderModel()

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()