Ejemplo n.º 1
0
    // 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);
    }
Ejemplo n.º 2
0
 private void Animate(Vector2 direction)
 {
     if (!_isAttacking)
     {
         if (direction == Vector2.zero)
         {
             _animator.AnimateIdle();
         }
         else
         {
             CurrentDirection = DirectionUtilities.DirectionFromVector(direction);
             _animator.AnimateMove(CurrentDirection);
         }
     }
 }