2023-01-05 00:28:20 +08:00
|
|
|
|
using Game;
|
|
|
|
|
using Game.HotFix;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Game
|
|
|
|
|
{
|
|
|
|
|
public class CharacterMachine : ICharMachineBase //<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>MonoBehaviour <20><><EFBFBD>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
private Animator _animator;
|
|
|
|
|
|
|
|
|
|
public bool IsAttacking()
|
|
|
|
|
{
|
|
|
|
|
AnimatorStateInfo stateInfo = _animator.GetCurrentAnimatorStateInfo(0);
|
|
|
|
|
|
2023-01-05 18:32:58 +08:00
|
|
|
|
if (stateInfo.IsName("Idle"))
|
2023-01-05 00:28:20 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (stateInfo.IsName("Run"))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (stateInfo.IsName("Hit"))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region <EFBFBD>麯<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>
|
|
|
|
|
public void InitMachine(Transform trans)
|
|
|
|
|
{
|
|
|
|
|
_animator = trans.GetComponent<Animator>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ReleazeMachine()
|
|
|
|
|
{
|
|
|
|
|
_animator = null;
|
|
|
|
|
}
|
|
|
|
|
public void Update_Logic()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
public void StartRun()
|
|
|
|
|
{
|
|
|
|
|
_animator.SetInteger("Speed", 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BackToIdle()
|
|
|
|
|
{
|
|
|
|
|
_animator.SetInteger("Speed", 0);
|
|
|
|
|
}
|
|
|
|
|
public void DeadToIdle()
|
|
|
|
|
{
|
|
|
|
|
_animator.SetBool("Dead", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SetAttack(string anim)
|
|
|
|
|
{
|
|
|
|
|
_animator.SetBool(anim, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetOtherAnime(string anim)
|
|
|
|
|
{
|
|
|
|
|
_animator.Play(anim);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void PlayDead()
|
|
|
|
|
{
|
|
|
|
|
_animator.SetBool("Dead", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void StartHit()
|
|
|
|
|
{
|
|
|
|
|
_animator.SetBool("Hit", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|