예제 #1
0
    private void Update()
    {
        if (isGameEnd || !isGameStarted)
        {
            return;
        }
        if (cubeManager.CubesWillBeDestroyed.Count == 0)
        {
            isGameEnd = true;
            cubeManager.ColorAllCubes();
            switch (currentLevel)
            {
            case 1:
                Tutorial1.SetActive(false);
                break;

            case 2:
                Tutorial2.SetActive(false);
                break;

            case 3:
                Tutorial3.SetActive(false);
                break;

            default:
                break;
            }
            StartCoroutine(WaitAndGameWin());
            Debug.Log("<color=green/>Game Win</color>");
        }
        else if (live <= 0)
        {
            isGameEnd = true;
            switch (currentLevel)
            {
            case 1:
                Tutorial1.SetActive(false);
                break;

            case 2:
                Tutorial2.SetActive(false);
                break;

            case 3:
                Tutorial3.SetActive(false);
                break;

            default:
                break;
            }
            StartCoroutine(WaitAndGameLose());
        }
        if (Input.GetMouseButton(0))
        {
            if (ContinueTutorial.activeSelf)
            {
                counter = 0;
                ContinueTutorial.SetActive(false);
            }
        }
        else
        {
            counter += Time.deltaTime;
            if (counter >= 5f)
            {
                if (!ContinueTutorial.activeSelf)
                {
                    ContinueTutorial.SetActive(true);
                }
            }
        }
    }