42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class CombatAnimator : MonoBehaviour
|
|
{
|
|
[Required] public Animator animator;
|
|
|
|
private static readonly int IsMovingHash = Animator.StringToHash("isMoving");
|
|
private static readonly int XDirectionHash = Animator.StringToHash("xDirection");
|
|
private static readonly int ZDirectionHash = Animator.StringToHash("zDirection");
|
|
private static readonly int IsDashingHash = Animator.StringToHash("isDashing");
|
|
|
|
[Button("셋팅 초기화")]
|
|
private void InitSetting()
|
|
{
|
|
animator = GetComponentInChildren<Animator>();
|
|
}
|
|
|
|
public void SetIsMoving(bool value)
|
|
{
|
|
animator.SetBool(IsMovingHash, value);
|
|
}
|
|
|
|
public void SetXDirection(float value)
|
|
{
|
|
animator.SetFloat(XDirectionHash, value);
|
|
}
|
|
|
|
public void SetZDirection(float value)
|
|
{
|
|
animator.SetFloat(ZDirectionHash, value);
|
|
}
|
|
|
|
public void SetIsDash(bool value)
|
|
{
|
|
animator.SetBool(IsDashingHash, value);
|
|
}
|
|
}
|
|
} |