private void Awake() { //SINGLETON if (instance == null) { instance = this; } else { GameObjectUtils.DebugErrorStop("Multiple instances of singleton."); } //SINGLETON Cells = new ACell[NB_CELLS]; Transform waypointsTransform = GameObjectUtils.Find("Waypoints").transform; if (Cells.Length != waypointsTransform.childCount) { GameObjectUtils.DebugErrorStop("Not found " + Cells.Length + " waypoints on board. Found " + waypointsTransform.childCount + " instead."); } for (int i = 0; i < Cells.Length; i++) { Cells[i] = GenerateCell(IdentifyCell(i), i, waypointsTransform.GetChild(i)); } //Subsribe to move manager MoveManager.OnMoved += RefreshBoardData; }
private void Awake() { //SINGLETON if (instance == null) { instance = this; } else { GameObjectUtils.DebugErrorStop("Multiple instances of singleton."); } //SINGLETON Transform gooseGameObjectTransform = GameObjectUtils.Find(">>> GOOSE").transform; Gooses = new AGoose[NB_GOOSES]; goosesSprites = new Sprite[NB_GOOSES]; for (int i = 0; i < Gooses.Length; i++) { Gooses[i] = GenerateGoose(i, gooseGameObjectTransform.GetChild(i)); goosesSprites[i] = gooseGameObjectTransform.GetChild(i).GetComponent <SpriteRenderer>().sprite; } CurrentGooseIndex = -1; currentGooseRenderer = GameObjectUtils.Find("Current Goose").GetComponent <SpriteRenderer>(); }
private void Awake() { //SINGLETON if (instance == null) { instance = this; } else { GameObjectUtils.DebugErrorStop("Multiple instances of singleton."); } //SINGLETON }
private void Awake() { //SINGLETON if (instance == null) { instance = this; } else { GameObjectUtils.DebugErrorStop("Multiple instances of singleton."); } //SINGLETON RollButton = GameObjectUtils.Find("Roll Button").GetComponent <Button>(); victoryMenu = GameObjectUtils.Find("Victory Menu"); victoryMenu.SetActive(false); pauseMenu = GameObjectUtils.Find("Pause Menu"); pauseMenu.SetActive(false); }
private void Awake() { //SINGLETON if (instance == null) { instance = this; } else { GameObjectUtils.DebugErrorStop("Multiple instances of singleton."); } //SINGLETON dice1 = GameObjectUtils.Find("Dice 1").GetComponent <SpriteRenderer>(); dice2 = GameObjectUtils.Find("Dice 2").GetComponent <SpriteRenderer>(); //Subsribe to game events GameManager.OnBeginTurn += SubMoveByDiceWhenRollEnd; GameManager.OnEndTurn += UnsubMoveByDiceWhenRollEnd; }