示例#1
0
    // a function that allows the Ai to check to see if there are enemys near by. if there are then they will begin to move to wards them and attack. slowing down when they get close enough to attack
    public void Attack(Sensing view, AgentActions action)
    {
        //first see if an enemy comes into view
        foreach (GameObject G in view.GetEnemiesInView())
        {
            action.ResumeMovement();
            action.MoveTo(G);
            action.AttackEnemy(G);
            //this.GetComponent<AgentActions>().AttackEnemy(G);
        }

        //need to resume movement when enemyes are dead
    }