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
 public void OnTypeChange(int type)
 {
     imageAgent.pathType  = (Map.PathType)type;
     randomAgent.pathType = (Map.PathType)type;
     activeAgent.GoToPosition(Random.Range(0, activeAgent.mapSize), Random.Range(0, activeAgent.mapSize), true);
 }
Exemplo n.º 3
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;
 }