void PlayAnimation(ChallengerAction action) { if (action != CurrentAction) { animator.SetTrigger(action.ToString().ToLower()); } }
void Move(Vector3 targetPos, Vector3 direction, float speed) { StopMoveAction(); PlayAnimation(ChallengerAction.Move); CurrentAction = ChallengerAction.Move; var coroutine = StartCoroutine(MoveAction(targetPos, direction, speed)); actions.Add(coroutine, CurrentAction); }
void Start() { CurrentAction = ChallengerAction.Idle; BagUI.Init(); foreach (var item in ress) { BagUI.AddRes(item); } }
void ActionEnd() { PlayAnimation(ChallengerAction.Idle); CurrentAction = ChallengerAction.Idle; }