47 lines
808 B
C#
47 lines
808 B
C#
using System;
|
|
using Animation;
|
|
using UnityEngine;
|
|
using Object = System.Object;
|
|
public class KnightController : MonoBehaviour
|
|
{
|
|
private AnimatorManager<AnimatorParam> _mAnimator;
|
|
|
|
enum MotionStat
|
|
{
|
|
Idle,
|
|
Walk,
|
|
Run,
|
|
Attack,
|
|
Hit,
|
|
Jump
|
|
}
|
|
|
|
enum AnimatorParam
|
|
{
|
|
speed,
|
|
atk_speed,
|
|
attack,
|
|
run,
|
|
}
|
|
|
|
|
|
MotionStat currentStat = MotionStat.Idle;
|
|
void Start()
|
|
{
|
|
_mAnimator = new AnimatorManager<AnimatorParam>(GetComponent<Animator>());
|
|
_mAnimator.SetValue(AnimatorParam.attack, true);
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
}
|
|
|
|
|
|
public void Hit()
|
|
{
|
|
_mAnimator.SetValue(AnimatorParam.attack, false);
|
|
Debug.Log("Knight Hit!");
|
|
}
|
|
|
|
}
|