You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Plugins/NaughtyAttributes/Scripts/Test/AnimatorParamTest.cs

54 lines
1.2 KiB
C#

using UnityEngine;
namespace NaughtyAttributes.Test
{
public class AnimatorParamTest : MonoBehaviour
{
public Animator animator0;
[AnimatorParam("animator0")]
public int hash0;
[AnimatorParam("animator0")]
public string name0;
public AnimatorParamNest1 nest1;
[Button("Log 'hash0' and 'name0'")]
private void TestLog()
{
Debug.Log($"hash0 = {hash0}");
Debug.Log($"name0 = {name0}");
Debug.Log($"Animator.StringToHash(name0) = {Animator.StringToHash(name0)}");
}
}
[System.Serializable]
public class AnimatorParamNest1
{
public Animator animator1;
private Animator Animator1 => animator1;
[AnimatorParam("Animator1", AnimatorControllerParameterType.Bool)]
public int hash1;
[AnimatorParam("Animator1", AnimatorControllerParameterType.Float)]
public string name1;
public AnimatorParamNest2 nest2;
}
[System.Serializable]
public class AnimatorParamNest2
{
public Animator animator2;
private Animator GetAnimator2() => animator2;
[AnimatorParam("GetAnimator2", AnimatorControllerParameterType.Int)]
public int hash1;
[AnimatorParam("GetAnimator2", AnimatorControllerParameterType.Trigger)]
public string name1;
}
}