void Update()
    {
        // if (rescueTime < 1000)
        // {

        deltaTime += Time.deltaTime;
        //uiController.UpdateNightPanel(deltaTime);
        if (deltaTime > inGameTimeToRealTime && sceneScript.currentScene.buildIndex == sceneScript.mainLevel)
        {
            rescueTime--;
            uiController.UpdateTimeTilResc(rescueTime);
            deltaTime = 0;
        }


        if (rescueTime < 1 && sceneScript.currentScene.buildIndex == sceneScript.mainLevel)
        {
            sceneScript.LoadScene(sceneScript.winScreen);
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        if (started && sceneScript.currentScene.buildIndex == sceneScript.menu)
        {
            t += Time.deltaTime;

            if (t > timeToRead)
            {
                n++;
                switch (n)
                {
                case 1:
                    preMenu.SetActive(false);
                    EnableText(str1, true);
                    break;

                case 2:
                    EnableText(str1, false);
                    EnableText(str2, true);
                    break;

                case 3:
                    EnableText(str2, false);
                    EnableText(str3, true);
                    break;

                case 4:
                    EnableText(str3, false);
                    EnableText(str4, true);
                    break;

                case 5:
                    EnableText(str4, false);
                    EnableText(str5, true);
                    break;

                case 6:
                    EnableText(str5, false);
                    EnableText(str6, true);
                    break;

                case 7:
                    EnableText(str6, false);
                    EnableText(str7, true);
                    break;

                default:
                    break;
                }

                if (n > 7)
                {
                    sceneScript.LoadScene(sceneScript.mainLevel);
                }
                t = 0;
            }
        }

        if (sceneScript.currentScene.buildIndex == sceneScript.winScreen)
        {
            t += Time.deltaTime;
            Debug.Log(t);

            if (t >= timeToRead && t < timeToRead * 2)
            {
                end.sprite = spr2;
            }
            if (t >= timeToRead * 2)
            {
                end.sprite = spr1;
                t          = 0;
            }
        }
    }