Пример #1
0
 public bool[] GetBeltDirection()
 {
     if (isBlue)
     {
         int    i    = 0;
         bool[] belt = new bool[8];
         foreach (GameObject button in blueButtons)
         {
             BlueButtonForAi thisButton = button.GetComponent("BlueButtonForAi") as BlueButtonForAi;
             belt[i] = thisButton.on;
             i++;
         }
         return(belt);
     }
     else if (isRed)
     {
         int    i    = 0;
         bool[] belt = new bool[8];
         foreach (GameObject button in redButtons)
         {
             RedButtonForAi thisButton = button.GetComponent("RedButtonForAi") as RedButtonForAi;
             belt[i] = thisButton.on;
             i++;
         }
         return(belt);
     }
     return(null);
 }
Пример #2
0
 public void Push()
 {
     if (isBlue)
     {
         foreach (GameObject button in blueButtons)
         {
             BlueButtonForAi thisButton = button.GetComponent("BlueButtonForAi") as BlueButtonForAi;
             thisButton.Push();
         }
     }
     else if (isRed)
     {
         foreach (GameObject button in redButtons)
         {
             RedButtonForAi thisButton = button.GetComponent("RedButtonForAi") as RedButtonForAi;
             thisButton.Push();
         }
     }
 }