Esempio n. 1
0
 public void SetActiveAgent(int agent)
 {
     if (agent == 0)
     {
         activeAgent = imageAgent;
         imageAgent.gameObject.SetActive(true);
         randomAgent.gameObject.SetActive(false);
         randomAgent.stopped = true;
         imageAgent.stopped  = false;
         imageAgent.GoToPosition(Random.Range(0, imageAgent.mapSize), Random.Range(0, imageAgent.mapSize), true);
     }
     else
     {
         activeAgent = randomAgent;
         imageAgent.gameObject.SetActive(false);
         randomAgent.gameObject.SetActive(true);
         randomAgent.stopped = false;
         imageAgent.stopped  = true;
         randomAgent.GoToPosition(Random.Range(0, imageAgent.mapSize), Random.Range(0, imageAgent.mapSize), true);
     }
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     imageAgent.GoToPosition(Random.Range(0, imageAgent.mapSize), Random.Range(0, imageAgent.mapSize), true);
     randomAgent.gameObject.SetActive(false);
     activeAgent = imageAgent;
 }