private void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } if (GameObject.Find("Login Controller") != null) { loginController.GetComponent <ButtonLoginRegister>().SetGeneralInfoReference(this); } else if (GameObject.Find("Menu Controller") != null) { menuController.GetComponent <ButtonMenu>().SetGeneralInfoReference(this); } else if (GameObject.Find("Score Controller") != null) { scoreController.GetComponent <ScoreMenu>().SetGeneralInfoReference(this); } else if (GameObject.Find("Game Controller") != null) { gameController.GetComponent <GameController>().SetGeneralInfoReference(this); } }
private void Awake() { setGameControllerReferenceOnButtons(); gameInfo = (GameInfo)FindObjectOfType(typeof(GameInfo)); generalInfo = (generalInfo)FindObjectOfType(typeof(generalInfo)); playerSide = "player"; textBox.text = ""; textBoxBattleship.text = "Battleship: " + pcBattleship; textBoxCruiser.text = "Cruiser: " + pcCruiser; textBoxSubmarine.text = "Submarine: " + pcSubmarine; textBoxDestroyer.text = "Destroyer: " + pcDestroyer; this.pcBoard = gameInfo.pcBoard; this.playerBoard = gameInfo.playerBoard; }
public void SetGeneralInfoReference(generalInfo info) { generalInfo = info; }
internal void SetGeneralInfoReference(generalInfo info) { generalInfo = info; }
private void Awake() { generalInfo = (generalInfo)FindObjectOfType(typeof(generalInfo)); }