private void Awake() { if (instance == null) { instance = this; } originalSize = mask.rectTransform.rect.width; }
public void LocateHUDObjects() { energyBarController = GameObject.FindGameObjectWithTag("Energy Bar").GetComponent <EnergyBarController>(); topHUDController = GameObject.FindGameObjectWithTag("Top HUD").GetComponent <TopHUDController>(); highScoreModalController = GameObject.FindGameObjectWithTag("High Score Modal").GetComponent <HighScoreModalController>(); pauseMenuManager = GameObject.FindGameObjectWithTag("Pause Menu").GetComponent <PauseMenuManager>(); restartBtn = GameObject.FindGameObjectWithTag("Restart Button").GetComponent <Button>(); giveUpBtn = GameObject.FindGameObjectWithTag("Give Up Button").GetComponent <Button>(); pauseBtn = GameObject.FindGameObjectWithTag("Pause Button").GetComponent <Button>(); restartBtn.onClick.AddListener(GameManager.Instance.OnRestart); giveUpBtn.onClick.AddListener(GameManager.Instance.OnGameEnd); pauseBtn.onClick.AddListener(OnPauseButtonClicked); }
void Awake() { ins = this; }