// 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; }
// Use this for initialization void Start() { //set the sprite to a layer to 99 so it as above the boared but under the UI this.gameObject.GetComponent <SpriteRenderer>().sortingOrder = 99; //set the board object and the state machine board = GameObject.Find("board").GetComponent <boardTiles>(); animator = GetComponent <Animator>(); }
// 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>(); }
// 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 board object in the variables board = GameObject.Find("board").GetComponent <boardTiles>(); //set all the checked directions to true(they arent needed as this is the finish but it is good to keep them true) Up = true; Down = true; Left = true; Right = true; }
// 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(); }