예제 #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);
     }
 }
예제 #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);
 }
예제 #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;
 }