Class ByBonesRootBoneMapper
Implements a root bone selection strategy by scanning a list of bones (Transform components) and choosing the one with the greatest number of child transforms. This mapper is useful when the asset hierarchy does not provide a clear root bone from naming conventions alone.
Inherited Members
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
[CreateAssetMenu(menuName = "TriLib/Mappers/Root Bone/By Bones Root Bone Mapper", fileName = "ByBonesRootBoneMapper")]
public class ByBonesRootBoneMapper : RootBoneMapper
Methods
Map(AssetLoaderContext, IList<Transform>)
Finds a suitable root bone from a provided list of potential bone transforms. This is the highest-level bone in the hierarchy that others descend from. Subclasses should override this method to implement more advanced selection logic (e.g., checking naming patterns, evaluating bone connections, etc.).
Declaration
public override Transform Map(AssetLoaderContext assetLoaderContext, IList<Transform> bones)
Parameters
Type | Name | Description |
---|---|---|
AssetLoaderContext | assetLoaderContext | The AssetLoaderContext referencing the loaded model’s GameObjects, user-defined import options, and callbacks. |
IList<Transform> | bones | An ordered or unordered list of transforms that may qualify as bones in the skeleton hierarchy. Subclasses can evaluate these to decide which one is truly at the top of the chain. |
Returns
Type | Description |
---|---|
Transform | The UnityEngine.Transform chosen to serve as the root bone. By default,
this method returns |