private void Start() { if (deathLabel != null) { deathLabel.text = GameManager.instance.deaths.ToString(); } GameManager.LevelInfo levelInfo = GameManager.instance.GetLevelInfo(); if (levelLabel != null) { levelLabel.text = "LEVEL 1." + levelInfo.index.ToString(); } if (hintLabel != null) { hintLabel.text = levelInfo.hint; } if (collectionLabel != null) { collectionLabel.text = "0/1"; } if (resetButton != null) { resetButton.onClick.AddListener(RestartLevel); } if (exitButton != null) { exitButton.onClick.AddListener(ToggleSettings); } if (settingsPanel != null) { if (timerLabel == null) { timerLabel = settingsPanel.transform.Find("txt_timer").gameObject.GetComponent <Text>(); } Button continueButton = settingsPanel.transform.Find("btn_continue").gameObject.GetComponent <Button>(); continueButton.onClick.AddListener(ToggleSettings); Button quitButton = settingsPanel.transform.Find("btn_exitGame").gameObject.GetComponent <Button>(); quitButton.onClick.AddListener(RestartGame); Text popupKilledLabel = settingsPanel.transform.Find("txt_killed").gameObject.GetComponent <Text>(); popupKilledLabel.text = GameManager.instance.deaths.ToString(); Text popupLevelLabel = settingsPanel.transform.Find("txt_levelHeader").gameObject.GetComponent <Text>(); popupLevelLabel.text = "LEVEL 1." + levelInfo.index.ToString(); Text popupHintLabel = settingsPanel.transform.Find("txt_environmentHeader").gameObject.GetComponent <Text>(); popupHintLabel.text = levelInfo.hint; } }
void UpdateTextGUI() { GameManager.LevelInfo lvlInfo = GameManager.refrence.levelInfo; txt_lvlCompleted.text = "LEVEL " + lvlInfo.curLevel + " COMPLETED"; txt_lvlsLeft.text = (lvlInfo.numOfLevels - lvlInfo.curLevel) + " LEVELS LEFT"; GameManager.WeaponInfo weaponInfo = GameManager.refrence.weaponInfo; txt_bonusCoins.text = "GET " + Global.GetSeparatedNumber(GetRewardCoinsAmount()) + " BONUS COINS"; }