Пример #1
0
    void FirstAction()
    {
        //if (battle_control.currTarget != null)
        //{
        //    var heading = battle_control.currTarget.transform.position - transform.position;
        //    var distance = heading.magnitude;
        //    var direction = heading / distance;
        //    Debug.Log("Distance " + distance);
        //    Debug.Log("Direction = " + direction);
        //}


        // Attack if any players are currently in range
        if (battle_control.CheckForPlayers(tileCoordX, tileCoordY, myChar.attackRange))
        {
            // Attack the nearest player ...
            battle_control.EnemyRangedAttack(10);
        }
        // If can hit during second action
        else if (battle_control.currTarget != null)
        {
            // Move to closest position to be in range for second round.
            battle_control.EnemyMoveKnownTarget();
        }
        else
        {
            // Move to a desirable location
            battle_control.EnemyMoveToSpecificPath(transform.position + Vector3.down);
        }
    }