Net.Like.Xue.Tokyo/Assets/Artists/Scripts/TestHumanBones.cs

32 lines
797 B
C#
Raw Normal View History

2025-05-06 16:10:12 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using AYellowpaper.SerializedCollections;
using BITKit;
using UnityEngine;
namespace Net.Like.Xue.Tokyo
{
public class TestHumanBones : MonoBehaviour
{
[SerializeField] private SerializedDictionary<HumanBodyBones, Transform> bones;
#if UNITY_EDITOR
[BIT]
private void GetBones()
{
bones.Clear();
var animator = GetComponent<Animator>();
for (var i = (int)HumanBodyBones.Hips; i < (int)HumanBodyBones.LastBone; i++)
{
var bone = (HumanBodyBones)i;
bones.AddConflictAllowed(bone, animator.GetBoneTransform(bone));
}
}
#endif
}
}