Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     board      = GameObject.Find("board").GetComponent <boardTiles>();
     towers     = GameObject.Find("Game Data").GetComponent <towerData>();
     towerPos   = towerUI.transform.position;
     upgradePos = upgradeUI.transform.position;
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     Node       = this.GetComponent <pathNodes>();
     towerData  = GameObject.Find("Game Data").GetComponent <towerData>();
     towerUI    = GameObject.Find("Game Data").GetComponent <UIData>();
     start      = GameObject.Find("board/start").GetComponent <startNode>();
     board      = GameObject.Find("board").GetComponent <boardTiles>();
     playerData = GameObject.Find("Game Data").GetComponent <PlayerData>();
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     //set the sprite order in layer to -ve the y co-ordinate
     this.gameObject.GetComponent <SpriteRenderer>().sortingOrder = -(int)this.gameObject.transform.position.y;
     //set the varibles to the correct objects
     end    = GameObject.Find("board/finish").GetComponent <endNode>();
     board  = GameObject.Find("board").GetComponent <boardTiles>();
     towers = GameObject.Find("Game Data").GetComponent <towerData>();
     hero   = GameObject.Find("hero").GetComponent <heroMovement>();
     //set the checked directions to unchecked (true)
     Up    = true;
     Down  = true;
     Left  = true;
     Right = true;
     //start the inital pathfind
     startPath();
 }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     //set the hero and the towerData object
     hero   = GameObject.Find("hero").GetComponent <heroMovement>();
     towers = GameObject.Find("Game Data").GetComponent <towerData>();
     //remove eveything from the list to then add all the tiles to the list
     tileNodes.Clear();
     foreach (GameObject tile in GameObject.FindGameObjectsWithTag("Tile"))
     {
         //for every tile add to this list
         tileNodes.Add(tile.GetComponent <pathNodes>());
         if (tile.name == "grass")
         {
             //if the tile can be build on then add to this list as well
             tileSpawns.Add(tile.GetComponent <spawnTower>());
         }
     }
 }