TriLib
Search Results for

    Show / Hide Table of Contents

    Class ByNameHumanoidAvatarMapper

    Implements a humanoid avatar mapping strategy by matching the names of loaded GameObjects with candidate bone names specified in a bone mapping list. For each human bone defined in the mapping, the first matching GameObject found in the model hierarchy is used. If a required bone is not found, a warning is issued.

    Inheritance
    object
    Object
    ScriptableObject
    HumanoidAvatarMapper
    ByNameHumanoidAvatarMapper
    Inherited Members
    HumanoidAvatarMapper.PostSetup(AssetLoaderContext, Dictionary<BoneMapping, Transform>)
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TriLibCore.Mappers
    Assembly: Assembly-CSharp.dll
    Syntax
    [CreateAssetMenu(menuName = "TriLib/Mappers/Humanoid/By Name Humanoid Avatar Mapper", fileName = "ByNameHumanoidAvatarMapper")]
    public class ByNameHumanoidAvatarMapper : HumanoidAvatarMapper

    Fields

    BonesMapping

    A list of bone mappings that define how human bones (e.g. Hips, Spine) map to possible GameObject names in the imported model.

    Declaration
    public List<BoneMapping> BonesMapping
    Field Value
    Type Description
    List<BoneMapping>

    CaseInsensitive

    Indicates whether string comparisons are performed in a case-insensitive manner.

    Declaration
    public bool CaseInsensitive
    Field Value
    Type Description
    bool

    stringComparisonMode

    Specifies the string comparison mode to use when matching loaded GameObject names against candidate names defined in the bone mapping.

    Declaration
    [Header("Left = Loaded GameObjects Names, Right = Names in BonesMapping.BoneNames")]
    public StringComparisonMode stringComparisonMode
    Field Value
    Type Description
    StringComparisonMode
    Remarks

    The "left" value is the name of the loaded GameObject and the "right" value is one of the candidate names.

    Methods

    AddMapping(HumanBodyBones, HumanLimit, params string[])

    Adds a new bone mapping to the current list of mappings. This method allows dynamically adding an entry that associates a specific human bone with one or more candidate transform names and an optional human limit.

    Declaration
    public void AddMapping(HumanBodyBones humanBodyBones, HumanLimit humanLimit, params string[] boneNames)
    Parameters
    Type Name Description
    HumanBodyBones humanBodyBones

    The human bone (as defined in UnityEngine.HumanBodyBones) to map.

    HumanLimit humanLimit

    The constraints or limits associated with this bone.

    string[] boneNames

    The candidate transform names to search for in the model hierarchy.

    Map(AssetLoaderContext)

    Attempts to map the loaded model bones into a humanoid rig, returning a Dictionary<TKey, TValue> for further processing. This method can be overridden to implement custom bone search or heuristics.

    Declaration
    public override Dictionary<BoneMapping, Transform> Map(AssetLoaderContext assetLoaderContext)
    Parameters
    Type Name Description
    AssetLoaderContext assetLoaderContext

    The AssetLoaderContext containing references to the loaded GameObject hierarchy and relevant import options.

    Returns
    Type Description
    Dictionary<BoneMapping, Transform>

    A dictionary mapping each humanoid BoneMapping entry to the corresponding UnityEngine.Transform in the scene. By default, returns null.

    Overrides
    HumanoidAvatarMapper.Map(AssetLoaderContext)

    Extension Methods

    IObjectExtensions.TryToDispose<T>(object)
    In this article
    Back to top Generated by DocFX