// FOR TESTING ONLY //protected void OnMouseUp() //{ // TestLevelManager.Instance.GoToLevel(1 - TestLevelManager.Instance.CurrentLevel); //} // protected virtual void StartAttacking(PlayerController player) { _isAttacking = true; _animator.AnimateAttack(); // Attacking will also change our direction. CurrentDirection = DirectionUtilities.DirectionFromVector(player.transform.position - transform.position); _animator.AnimateDirection(CurrentDirection); }
private void Animate(Vector2 direction) { if (!_isAttacking) { if (direction == Vector2.zero) { _animator.AnimateIdle(); } else { CurrentDirection = DirectionUtilities.DirectionFromVector(direction); _animator.AnimateMove(CurrentDirection); } } }