Beispiel #1
0
        IEnumerator _LevelCleared()
        {
            float t0    = 0f;
            float t1    = -30f;
            float timer = 0;
            float time  = 0.5f;

            while (timer <= time)
            {
                timer += Time.deltaTime;

                float f = Mathf.Lerp(t0, t1, timer / time);

                Vector3 rot = Vector3.forward * f;

                lockRect.eulerAngles = rot;

                yield return(0);
            }

            yield return(new WaitForSeconds(0.2f));

            StartCoroutine(ScreenMove.Move(theGame.GetComponent <RectTransform> (), false));

            while (ScreenMove.isMoving)
            {
                yield return(0);
            }

            //		SceneManager.LoadScene (0);

            StartCoroutine(StartNewLevel());
        }
Beispiel #2
0
        IEnumerator StartNewLevel()
        {
            buttonPreviousLevel.onClick.RemoveListener(OnClickedPreviousLevel);

            buttonNextLevel.onClick.RemoveListener(OnClickedNextLevel);


            SetNewGame();

            StartCoroutine(ScreenMove.Move(theGame.GetComponent <RectTransform> (), true));

            while (ScreenMove.isMoving)
            {
                yield return(0);
            }

            gameIsStarted = true;
        }