Exemple #1
0
        public static IEnumerator Pause()
        {
            yield return(new WaitForSeconds(0f));

            StandardLevelGameplayManager pauseManager = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();

            pauseManager.HandlePauseTriggered();
        }
Exemple #2
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape) && isGameScene(SceneManager.GetActiveScene()))
     {
         pauseMenuManager = Resources.FindObjectsOfTypeAll <PauseMenuManager>().First();
         gameplayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();
         gameplayManager.HandlePauseTriggered();
         pauseMenuManager.MenuButtonPressed();
     }
 }
Exemple #3
0
        private void Update()
        {
            if (loadSong && isMenuScene(SceneManager.GetActiveScene()))
            {
                try
                {
                    SongLoader.Instance.RefreshSongs(true);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Can't refresh songs! EXCEPTION: " + e);
                }
                playSong = true;
                loadSong = false;
            }
            if (playSong && SongLoader.AreSongsLoaded && isMenuScene(SceneManager.GetActiveScene()))
            {
                Console.WriteLine("attempting song load");
                playSong = false;
                getSong(songName, author, subName, difficulty);
                autoPlay = autoPlayBuffer;
            }
            if (!autoPlay && isGameScene(SceneManager.GetActiveScene()))
            {
                pauseMenuManager = Resources.FindObjectsOfTypeAll <PauseMenuManager>().First();
                gameplayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();

                gameplayManager.HandlePauseTriggered();
                if (pauseMenuManager.isActiveAndEnabled)
                {
                    autoPlay = true;
                }
            }

            if (Input.GetKeyDown(KeyCode.Escape) && isGameScene(SceneManager.GetActiveScene()))
            {
                pauseMenuManager = Resources.FindObjectsOfTypeAll <PauseMenuManager>().First();
                gameplayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();
                gameplayManager.HandlePauseTriggered();
                pauseMenuManager.MenuButtonPressed();
            }
            if (SceneManager.GetActiveScene().name == "HealthWarning")
            {
                fuckthis = Resources.FindObjectsOfTypeAll <HealthWarningMenuController>().FirstOrDefault();
                fuckthis.ContinueButtonPressed();
            }
        }
        private void TrackingScan()
        {
            int LeftTrackingFlags  = 0;
            int RightTrackingFlags = 0;

            if (previousLeftSaber == null || gameplayManager.gameState == StandardLevelGameplayManager.GameState.Paused)
            {
                //Avoiding unnecessary checking
                previousLeftSaber       = constantRight;
                previousRightSaber      = constantLeft;
                previousLeftSaberSpeed  = constantSpeedRight;
                previousRightSaberSpeed = constantSpeedLeft;
                return;
            }


            //Left Saber Scanning
            if (constantSpeedLeft == previousLeftSaberSpeed)
            {
                Log.Info("Left Speed");
                LeftTrackingFlags += 1;
            }

            if (constantLeft == previousLeftSaber)
            {
                Log.Info("Left Frozen");
                LeftTrackingFlags += 2;
            }

            if (new Vector3(constantLeft.x, 0f, constantLeft.z).sqrMagnitude > 1.3f)
            {
                Log.Info("Left Playspace");
                LeftTrackingFlags += 2;
            }

            if (constantLeft.y < 0f)
            {
                Log.Info("Left Negative Y");
                LeftTrackingFlags += 2;
            }

            //Right Saber Scanning
            if (constantSpeedRight == previousRightSaberSpeed)
            {
                Log.Info("Right Speed");
                RightTrackingFlags += 1;
            }

            if (constantRight == previousRightSaber)
            {
                Log.Info("Left Frozen");
                RightTrackingFlags += 2;
            }

            if (new Vector3(constantRight.x, 0f, constantRight.z).sqrMagnitude > 1.3f)
            {
                Log.Info("Right Playspace");
                RightTrackingFlags += 2;
            }

            if (constantRight.y < 0f)
            {
                Log.Info("Right Negative Y");
                RightTrackingFlags += 2;
            }

            //Decision Making
            if (LeftTrackingFlags >= flagvalue || RightTrackingFlags >= flagvalue)
            {
                text.text = "Issue Detected From:";

                if (LeftTrackingFlags > flagvalue && LeftTrackingFlags == RightTrackingFlags)
                {
                    text.text += " <color=red>Left</color> and <color=blue>Right</color> Saber";
                }
                else
                {
                    if (LeftTrackingFlags > RightTrackingFlags)
                    {
                        text.text += " <color=red>Left Saber</color>";
                    }

                    if (RightTrackingFlags > LeftTrackingFlags)
                    {
                        text.text += " <color=blue>Right Saber</color>";
                    }
                }

                gameplayManager.HandlePauseTriggered();

                TrackNoise.Play();
                _image.enabled  = true;
                _image2.enabled = true;

                Invoke("Reset", 5f);
            }

            previousLeftSaber       = constantLeft;
            previousRightSaber      = constantRight;
            previousLeftSaberSpeed  = constantSpeedLeft;
            previousRightSaberSpeed = constantSpeedRight;
        }