示例#1
0
    void SetPageState(pageState state)
    {
        switch (state)
        {
        case pageState.None:
            Startpage.SetActive(false);
            EndPage.SetActive(false);
            CountPage.SetActive(false);
            break;

        case pageState.Start:
            Startpage.SetActive(true);
            EndPage.SetActive(false);
            CountPage.SetActive(false);
            break;

        case pageState.GameOver:
            Startpage.SetActive(false);
            EndPage.SetActive(true);
            CountPage.SetActive(false);
            break;

        case pageState.CountDown:
            Startpage.SetActive(false);
            EndPage.SetActive(false);
            CountPage.SetActive(true);
            break;
        }
    }
示例#2
0
    private void Update()
    {
        TimeText.text = _timeRemaining.ToString();

        _timeRemaining -= Time.deltaTime;
        DisplayTime(_timeRemaining);

        if (SpawnArea.childCount < 3)
        {
            foreach (Transform child in SpawnArea)
            {
                if (child.gameObject.activeInHierarchy == false)
                {
                    Destroy(child.gameObject);
                    CancelInvoke();
                    CreateDirtOnDish();
                }
            }
        }



        Pay.text         = _pay.ToString();
        DirtCleaned.text = _dirtCleaned.ToString();
        if (_timeRemaining <= 0)
        {
            Bonus.text = _bonus.ToString();
            EndPage.SetActive(true);
        }
    }