8 [CreateAssetMenu(menuName =
"TriLib/Mappers/Root Bone/By Name Root Bone Mapper", fileName =
"ByNameRootBoneMapper")]
14 [Header(
"Left = Loaded GameObjects Names, Right = Names in RootBoneNames")]
28 public override Transform
Map(AssetLoaderContext assetLoaderContext)
35 var found = FindDeepChild(assetLoaderContext.RootGameObject.transform, rootBoneName);
42 return base.Map(assetLoaderContext);
45 private Transform FindDeepChild(Transform transform,
string right)
52 var childCount = transform.childCount;
53 for (var i = 0; i < childCount; i++)
55 var child = transform.GetChild(i);
56 var found = FindDeepChild(child, right);
Represents a Mapper that searches for a root bone on the Models by the bone names.
StringComparisonMode StringComparisonMode
String comparison mode to use on the mapping.
bool CaseInsensitive
Is the string comparison case insensitive?
string[] RootBoneNames
Root bone names to be searched.
override Transform Map(AssetLoaderContext assetLoaderContext)