Class RaceTemplate
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
-
ObjectScriptableObjectRaceTemplate
- 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.nameObject.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
Description
Description of the race.
public string Description
Field Value
GenderedModels
Gender-specific model references for this race. Use Unspecified for generic/default models.
public List<GenderedRaceModelSet> GenderedModels
Field Value
InitialAttributes
Initial attribute database for the race.
public CharacterAttributeTemplateDatabase InitialAttributes
Field Value
InitialFaction
The initial faction for the race.
public FactionTemplate InitialFaction
Field Value
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
StartingEquipment
List of starting equipment for the race.
public List<EquippableItemTemplate> StartingEquipment
Field Value
StartingInventoryItems
List of starting inventory items for the race.
public List<BaseItemTemplate> StartingInventoryItems
Field Value
Properties
Name
The name of the race (from the ScriptableObject name).
public string Name { get; }
Property Value
Methods
GetModelCount(CharacterGender)
Gets the number of model references available for a gender, including fallback models.
public int GetModelCount(CharacterGender gender)
Parameters
genderCharacterGenderThe 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
indexintThe 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
genderCharacterGenderThe selected character gender.
indexintThe 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
indexintThe 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
genderCharacterGenderThe 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
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe 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
typeNamestringThe type name of the resource.
resourceNamestringThe resource name.
resourceIDintThe resource ID.
UnloadPlaceholderModel()
Unloads the placeholder model for the race using Addressables.
public void UnloadPlaceholderModel()