コード例 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     originalSize = mask.rectTransform.rect.width;
 }
コード例 #2
0
    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);
    }
コード例 #3
0
 void Awake()
 {
     ins = this;
 }