добавлены модели анимации персонажа
This commit is contained in:
1 parent
11d57bec19
commit
202a894140
824 files changed
+985212
-40
No files matched your search
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
public static class TestPlayerPose
|
||||
{
|
||||
public static void Sample()
|
||||
{
|
||||
var player = GameObject.Find("Player");
|
||||
if (player == null) player = GameObject.Find("Capsule");
|
||||
if (player == null) { Debug.LogError("Player not found"); return; }
|
||||
|
||||
var anim = player.GetComponentInChildren<Animator>();
|
||||
if (anim == null) { Debug.LogError("Animator not found"); return; }
|
||||
|
||||
Debug.Log("== PLAYER ANIMATION SAMPLING ==");
|
||||
Debug.Log("Speed param: " + anim.GetFloat("Speed"));
|
||||
Debug.Log("IsMoving param: " + anim.GetBool("IsMoving"));
|
||||
|
||||
var stateInfo = anim.GetCurrentAnimatorStateInfo(0);
|
||||
Debug.Log("Current State Hash: " + stateInfo.shortNameHash + ", normalizedTime: " + stateInfo.normalizedTime);
|
||||
Debug.Log("Is Locomotion state: " + stateInfo.IsName("Locomotion"));
|
||||
|
||||
var leftFoot = anim.GetBoneTransform(HumanBodyBones.LeftFoot);
|
||||
var rightFoot = anim.GetBoneTransform(HumanBodyBones.RightFoot);
|
||||
var leftHand = anim.GetBoneTransform(HumanBodyBones.LeftHand);
|
||||
var rightHand = anim.GetBoneTransform(HumanBodyBones.RightHand);
|
||||
|
||||
if (leftFoot != null && rightFoot != null)
|
||||
{
|
||||
Debug.Log("LeftFoot pos: " + leftFoot.position + ", RightFoot pos: " + rightFoot.position + ", Distance Z: " + Mathf.Abs(leftFoot.position.z - rightFoot.position.z));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("LeftFoot or RightFoot bone is null! Humanoid bones not bound?");
|
||||
}
|
||||
|
||||
if (leftHand != null && rightHand != null)
|
||||
{
|
||||
Debug.Log("LeftHand pos: " + leftHand.position + ", RightHand pos: " + rightHand.position);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Hands bone is null!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user