示例#1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         animationObj.Play("SelectSong_FadeOutSimple");
         changer.ChangeToScene("TitleScreen", 1f / 3f);
     }
 }
示例#2
0
    /// <summary>
    /// Update is called every frame, if the MonoBehaviour is enabled.
    /// </summary>
    void Update()
    {
        if (!gameEnd)
        {
            return;
        }

        if (Input.GetKeyUp(KeyCode.Escape) ||
            Input.GetKeyUp(KeyCode.Space) ||
            Input.GetKeyUp(KeyCode.Return) ||
            Input.GetKeyUp(KeyCode.Backspace))
        {
            SceneChanger.ChangeToScene("main");
        }
    }
        public IEnumerator TestLoadsTestLevel()
        {
            SceneChanger.ChangeToScene(SceneManifest.DummyScene1);
            LoadingStatus status = new LoadingStatus();

            SceneChanger.LoadFinished += status.MakeIsLoadedTrue;
            while (!status.isLoaded)
            {
                yield return(null);
            }
            SceneChanger.LoadFinished -= status.MakeIsLoadedTrue;
            Scene currentScene = SceneManager.GetActiveScene();

            Assert.That(currentScene.name,
                        Is.EqualTo(SceneManifestTranslator
                                   .Translate(SceneManifest.DummyScene1)),
                        "Fails to load a test level.");
            yield return(null);
        }
    private void Update()
    {
        AudioListener.volume = masterSound.value;
        // Add in volume for background audio clips
        // Add in volume for regular sound clips

        if (Input.GetKeyDown(KeyCode.Alpha0))
        {
            currentState = States.MAINMENU;
        }
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            currentState = States.GAME;
        }

        if (currentState == previousState)
        {
            return;
        }

        previousState             = currentState;
        SceneManager.sceneLoaded += OnSceneLoad;

        switch (currentState)
        {
        case States.MAINMENU:
            Time.timeScale = 1.0f;
            SceneChanger.ChangeToScene("MainMenu");

            break;

        case States.GAME:
            Time.timeScale = 1.0f;
            SceneChanger.ChangeToScene("CamScene");
            gameUI.SetActive(true);

            break;
        }
    }
示例#5
0
        private void Update()
        {
            if (IsStarted && !Paused)
            {
                Dispensor.UpdateNote(Frame);
                Frame      += 60 * Time.deltaTime * FrameSpeed;
                FrameFixed += 60 * Time.deltaTime;
                if (IsPlaying)
                {
                    SongTime += 1 * Time.deltaTime;
                }
            }
            else if (!IsStarted && !HasError && (!BGA.isCustom || (BGA.isCustom && BGA.readyToPlay)))
            {
                StartPanel.SetActive(true);
                StartCount         += 1 * Time.deltaTime;
                StartCountText.text = Mathf.Ceil(3 - StartCount).ToString();
#if UNITY_ANDROID
                if (Social.localUser.authenticated)
                {
                    PlayGamesPlatform.Instance.ReportProgress(GPGSIds.achievement_your_first_step, 100.0f, null);
                }
#elif UNITY_IOS
                Achievementer.ReportProgress("YourFirstStep");
#endif
                if (StartCount >= 3f)
                {
                    PauseButton.interactable = true;
                    DataContainer.SetNoteCount(Dispensor.VisibleNoteCount);
                    IsStarted = true;
                    BGA.ResumeBGA();
                    BGA.SetStartFrame();
                    StartPanel.SetActive(false);
                }
            }
            if (IsEnded)
            {
                PauseButton.interactable = false;
                EndCount += 1 * Time.deltaTime;
                if (EndCount >= 3 && !EndPanel.activeSelf)
                {
                    EndPanel.SetActive(true);
                }
                if (EndCount >= 6)
                {
                    DataSender.SetGameResult(DataContainer);
                    SceneAnimate.Play("6LineCvFadeOut");
                    Screen.sleepTimeout = SleepTimeout.SystemSetting;
                    if (ScreenAdjusted)
                    {
                        Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                    }
                    if (Mode.Equals(GameMode.Theater2P))
                    {
                        if (Application.platform.Equals(RuntimePlatform.Android) || Application.platform.Equals(RuntimePlatform.IPhonePlayer))
                        {
                            Screen.orientation = ScreenOrientation.Landscape;
                            Screen.orientation = ScreenOrientation.AutoRotation;
                        }
                        else if (Application.platform.Equals(RuntimePlatform.WindowsPlayer))
                        {
                            Screen.SetResolution(PreservedWidth, PreservedHeight, Screen.fullScreen);
                        }
                    }
                    changer.ChangeToScene("GameResult", 0.5f);
                }
            }
            if (IsEnded && DataContainer.GetMaxCombo() >= Dispensor.VisibleNoteCount && !FCFlag)
            {
                StartCoroutine(FullComboShow());
                FCFlag = true;
            }
        }
示例#6
0
 /// <summary>
 /// When the button is pressed, this function gets called and the
 /// game is transitioned to the scene specified by scene.  This
 /// function is exposed primarily for testing purposes, so don't
 /// call is yourself.
 /// </summary>
 public void LoadScene()
 {
     SceneChanger.ChangeToScene(scene);
 }
示例#7
0
 public void MainMenu()
 {
     SceneChanger.ChangeToScene("MainMenu");
     gameManager.currentState = States.MAINMENU;
     gameManager.currentPopup = Popup.COUNT;
 }
示例#8
0
 public void Replay()
 {
     gameManager.gameEnd.SetActive(false);
     SceneChanger.ChangeToScene("CamScene");
     Time.timeScale = 1.0f;
 }
示例#9
0
 public void OnCreditButtonClicked()
 {
     SceneChanger.ChangeToScene("credit");
 }
示例#10
0
 public void OnStartButtonClicked()
 {
     Debug.Log("Start button click");
     SceneChanger.ChangeToScene("game");
 }
示例#11
0
 public void OnTouchToMain()
 {
     SceneChanger.ChangeToScene("main");
 }