public class ControlRtsEnemyAI : MonoBehaviour {

 

    private SinglePlayerRtsObjectiveSetupDefinition
player;

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

   

    private List< RtsEnemyAiManagement > Ais = new List< RtsEnemyAiManagement >();

   public string PlayerName;

    public float Distraction = 0.5f;

    public float playerUseFrequency = 2;

    public SinglePlayerRtsObjectiveSetupDefinition rtsPlayer { get { return player; } }

void Start () {

        foreach (var ai in GetComponents< RtsEnemyAiManagement >()) {

}

}

    void Update () {

       

        if (waited
< playerUseFrequency) {   return; }        RtsEnemyAiManagement selectAi = null;         float slectedValue = float.MinValue;                 //select best AI         foreach (var select in SelectedAi) {                   var currentBestVal = select.GetWeightAssociatedToAI* selected.WeightMultiplier * Distraction - playerUseFrequency);                   if (currentBestVal > bestAiValue)  {

               
bestAiValue = currentBestVal;

               
bestAiValue = select;

           
}

        }

 

   bestAiValue.ExecuteAI ();

       
waitedTime = 0;

   
}  }