Exemplo 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);
     }
 }
Exemplo 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;
 }