logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityRigDefinition

    Maps domain BoneIds to Unity Transform references. Can be used as a MonoBehaviour (scene-based) or ScriptableObject (prefab-based). Also provides bone ID list for editor dropdown population.

    Inheritance
    object
    UnityRigDefinition
    Namespace: Serenity.ProceduralExpression.Infrastructure.Settings
    Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
    Syntax
    public class UnityRigDefinition : MonoBehaviour

    Constructors

    UnityRigDefinition()

    Declaration
    public UnityRigDefinition()

    Properties

    BoneCount

    Gets the number of bone bindings.

    Declaration
    public int BoneCount { get; }
    Property Value
    Type Description
    int

    Bones

    Gets all bone bindings.

    Declaration
    public IReadOnlyList<BoneBinding> Bones { get; }
    Property Value
    Type Description
    IReadOnlyList<BoneBinding>

    Methods

    Get(BoneId)

    Gets the Transform for a given domain BoneId, or null if not found.

    Declaration
    public Transform Get(BoneId boneId)
    Parameters
    Type Name Description
    BoneId boneId
    Returns
    Type Description
    Transform

    Get(string)

    Gets the Transform for a given BoneId string, or null if not found.

    Declaration
    public Transform Get(string boneId)
    Parameters
    Type Name Description
    string boneId
    Returns
    Type Description
    Transform

    GetAllBoneIds()

    Gets all valid bone IDs in this rig definition.

    Declaration
    public IEnumerable<string> GetAllBoneIds()
    Returns
    Type Description
    IEnumerable<string>

    GetBoneIds()

    Returns all defined bone IDs for editor dropdown population. Does not require cache initialization (reads directly from serialized data).

    Declaration
    public IReadOnlyList<string> GetBoneIds()
    Returns
    Type Description
    IReadOnlyList<string>

    RebuildCache()

    Rebuilds the internal bone cache. Call this after modifying bones at runtime.

    Declaration
    public void RebuildCache()

    TryGet(BoneId, out Transform)

    Tries to get the Transform for a given domain BoneId.

    Declaration
    public bool TryGet(BoneId boneId, out Transform transform)
    Parameters
    Type Name Description
    BoneId boneId
    Transform transform
    Returns
    Type Description
    bool

    TryGet(string, out Transform)

    Tries to get the Transform for a given BoneId string.

    Declaration
    public bool TryGet(string boneId, out Transform transform)
    Parameters
    Type Name Description
    string boneId
    Transform transform
    Returns
    Type Description
    bool

    ValidateBindings()

    Validates all bone bindings and returns any issues found.

    Declaration
    public List<string> ValidateBindings()
    Returns
    Type Description
    List<string>
    In this article
    © 2026 Serenity. All Rights Reserved