コード例 #1
0
ファイル: TimerScript.cs プロジェクト: rsr19/CS-3540-Minions
    public void DecreaseLives()
    {
        //decrement the lives
        lives--;

        //update the hud
        if (hud != null)
        {
            hud.SetLives(lives);
        }

        //if there are no more lives then end the game
        if (lives <= 0)
        {
            ShowEnd();
        }
    }
コード例 #2
0
ファイル: TimerScript.cs プロジェクト: rsr19/CS-3540-Minions
    //The start method
    void Start()
    {
        //have the timer count equal to the timer start
        timerCount = timerStart;

        //set the reset timer
        timeRemaining = 1;

        //get the hud script in order to change the number of icons on the hud
        hud = this.transform.GetComponent <HudScript>();

        //if the hud script was found set the current amount of lives
        if (hud != null)
        {
            hud.SetLives(lives);
        }

        menuObj = GameObject.Find("MenuLogic(Clone)");

        if (menuObj != null)
        {
            menuScript = menuObj.GetComponent <MenuScript>();
        }
    }