Exemplo n.º 1
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();
     }
 }
Exemplo n.º 2
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();
            }
        }
Exemplo n.º 3
0
        static bool MessageReceived(string ipPort, byte[] data)
        {
            string msg = "";

            if (data != null && data.Length > 0)
            {
                msg = Encoding.UTF8.GetString(data);
            }
            var info = msg.Split(new string[] { ":::" }, StringSplitOptions.None);

            songName      = info[0];
            author        = info[1];
            subName       = info[2];
            difficulty    = info[3];
            time          = float.Parse(info[4]);
            autoPlay      = bool.Parse(info[5]);
            playbackSpeed = float.Parse(info[6]);

            if (isGameScene(SceneManager.GetActiveScene()))
            {
                pauseMenuManager = Resources.FindObjectsOfTypeAll <PauseMenuManager>().First();
                gameplayManager  = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().First();
                gameplayManager.Pause();
                pauseMenuManager.MenuButtonPressed();
            }
            loadSong = true;

            autoPlayBuffer = autoPlay;
            //try
            //{
            //    SongLoader.Instance.RefreshSongs(true);
            //}
            //catch (Exception e)
            //{
            //    Console.WriteLine("Can't refresh songs! EXCEPTION: " + e);
            //}
            return(true);
        }
Exemplo n.º 4
0
 public void ExitSong()
 {
     GamePause?.Pause();
     PauseMenuManager?.MenuButtonPressed();
 }