+ Red Sprite V3(이누야샤) 캐릭터 추가 + 03.CombatTest Scene(전투 테스트용 씬) 추가 + 4방향 Idle, Walk, Dash, ComboAttack 구현 + ComboAttack 애니메이션 복제 및 수정
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class ComboAttack : StateMachineBehaviour
|
|
{
|
|
private CombatPlayer combatPlayer;
|
|
|
|
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
if (combatPlayer == null)
|
|
{
|
|
combatPlayer = animator.GetComponentInParent<CombatPlayer>();
|
|
}
|
|
combatPlayer.IsAttacking = true;
|
|
combatPlayer.IsComboPossible = true;
|
|
}
|
|
|
|
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
if (stateInfo.normalizedTime >= 1f)
|
|
{
|
|
animator.SetBool(combatPlayer.isAttackingHash, false);
|
|
}
|
|
}
|
|
|
|
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
combatPlayer.IsComboPossible = false;
|
|
combatPlayer.IsComboAttacking = false;
|
|
combatPlayer.IsAttacking = false;
|
|
animator.SetBool(combatPlayer.isAttackingHash, false);
|
|
}
|
|
}
|
|
} |