Add ability to play BladeVortex

Add system to distinguish animation name that is none directional
This commit is contained in:
Nico 2025-07-04 01:19:21 -07:00
parent 586ce2b59e
commit 6330065de4
2 changed files with 7 additions and 2 deletions

View File

@ -196,7 +196,8 @@ public class MeleeFighterClass : ClassBase {
break; break;
case AttackState.BladeVortex: case AttackState.BladeVortex:
Animator.CrossFade(BladeVortex, 0); AnimationToPlay = "BladeVortex_";
//Animator.CrossFade(BladeVortex, 0);
break; break;
case AttackState.BasicAttack1: case AttackState.BasicAttack1:

View File

@ -158,7 +158,11 @@ public class Player : MonoBehaviour {
private void UpdateAnimation() { private void UpdateAnimation() {
string state = GetAnimationState(MoveDirection); string state = GetAnimationState(MoveDirection);
Animator.CrossFade($"{state}{LastDirection.ToString()}", 0); if (state.Last() == '_')
state = state.Replace("_", "");
else
state += LastDirection.ToString();
Animator.CrossFade(state, 0);
} }
private enum Direction { Up, Down, Left, Right } private enum Direction { Up, Down, Left, Right }