Add ability to play BladeVortex
Add system to distinguish animation name that is none directional
This commit is contained in:
parent
586ce2b59e
commit
6330065de4
@ -196,7 +196,8 @@ public class MeleeFighterClass : ClassBase {
|
||||
break;
|
||||
|
||||
case AttackState.BladeVortex:
|
||||
Animator.CrossFade(BladeVortex, 0);
|
||||
AnimationToPlay = "BladeVortex_";
|
||||
//Animator.CrossFade(BladeVortex, 0);
|
||||
break;
|
||||
|
||||
case AttackState.BasicAttack1:
|
||||
|
||||
@ -158,7 +158,11 @@ public class Player : MonoBehaviour {
|
||||
|
||||
private void UpdateAnimation() {
|
||||
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 }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user