示例#1
0
 void PlaceUnits()
 {
     // create an array of GridCharacter (our creation) objects and fill it with the list
     // of GridCharacter (unity object) objects found within the GameObject
     GridCharacter[] units = GameObject.FindObjectsOfType <GridCharacter>();
     foreach (GridCharacter u in units)
     {
         u.OnInit();
         //Debug.Log("Found an object");
         Node n = gridManager.getNode(u.transform.position);
         if (n != null)
         {
             u.transform.position = n.worldPos;
             n.character          = u;
             u.currentNode        = n;
         }
     }
 }
示例#2
0
 Node GetNode(int x, int y, int z)
 {
     return(gridManager.getNode(x, y, z));
 }