private void Awake() { instance = this; transform.Find("ResumeButton").GetComponent <Button>().onClick.AddListener(GameHandler.ResumeGame); transform.Find("QuitButton").GetComponent <Button>().onClick.AddListener(Application.Quit); Hide(); }
private void ResumeGame() { Time.timeScale = 1.0f; gameOver = false; isPaused = false; PauseWindow.HidePauseWindowStatic(); }
private void PlayerPositionTransform(KeyEventArgs e, double beforeY, double beforeX) { switch (e.Key) { case System.Windows.Input.Key.Left: TransformPlayerLeft(beforeY, beforeX); break; case System.Windows.Input.Key.Right: TransformPlayerRight(beforeX, beforeY); break; case System.Windows.Input.Key.Down: TransformPlayerDown(beforeY, beforeX); break; case System.Windows.Input.Key.Up: TransformPlayerUp(beforeY, beforeX); break; case System.Windows.Input.Key.Q: MainWindow window = e.OriginalSource as MainWindow; window.Content = new Startowa(); window.KeyDown -= CanvasKeyPreview; window.ResizeMode = ResizeMode.CanResize; break; case System.Windows.Input.Key.P: PauseWindow pause = new PauseWindow(); pause.ShowDialog(); break; } }
private void Awake() { StartCoroutine(OnGameWasOpened()); DontDestroyOnLoad(this); Background = new Background(); MainMenu = new UI.PanelMain(); Pause = new PausePanel(); PauseWindow = new PauseWindow(); ProfilePanel = new ProfilePanel(); SinglePanel = new SinglePanel(); ServerList = new ServerListPanel(); SettingsPanel = new SettingsPanel(); DebugPanel = new DebugPanel(); CharacterSelectionPanel = new CharacterSelectionPanel(); Chat = new Chat(); Log = new Log(); DontDestroyOnLoad(new GameObject("DiscordManager").AddComponent <Network.Discord.DiscordManager>()); DestroyMainScene(); GameModes.ResetOnLoad(); //Antis.Spam.EventsCounter.OnEventsSpamDetected += (sender, args) => //{ // if(args.SpammedObject == 200 || args.SpammedObject == 253 && args.Count < 130) // { // return; // } // PhotonPlayer player = PhotonPlayer.Find(args.Sender); // if (player.RCIgnored) // { // return; // } // Log.AddLine("eventSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString()); //}; //Antis.Spam.RPCCounter.OnRPCSpamDetected += (sender, args) => //{ // if(args.SpammedObject == "netPauseAnimation" || args.SpammedObject == "netCrossFade" && args.Count < 75) // { // return; // } // PhotonPlayer player = PhotonPlayer.Find(args.Sender); // if (player.RCIgnored) // { // return; // } // Log.AddLine("rpcSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString()); //}; //Antis.Spam.InstantiateCounter.OnInstantiateSpamDetected += (sender, args) => //{ // if (args.SpammedObject.Contains("TITAN") && args.Count <= 50) // { // return; // } // PhotonPlayer player = PhotonPlayer.Find(args.Sender); // if (player.RCIgnored) // { // return; // } // Log.AddLine("instantiateSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString()); //}; Network.BanList.Load(); }
private void Start() { pauseWindow = GetComponent <PauseWindow>(); deathWindow = GetComponent <DeathWindow>(); DisablePauseWindow(); DisableDeathWindow(); }
private void Awake() { instance = this; resumeButton = transform.Find("resumeButton").GetComponent <Button>(); mainMenuButton = transform.Find("goToMainMenu").GetComponent <Button>(); Hide(); }
private void InitializeGameStage() { uIMgr = UImenu.manager; PauseWindow quitButton = uIMgr.GetWindow(Menus.Pause) as PauseWindow; quitButton.ChangedButton(SceneType.Game); clearScore = board.stageData.clearScore; moveValue = board.stageData.move; stageBG.sprite = board.stageData.backgroundSprite; moveValue = board.stageData.move; clearScore = board.stageData.clearScore; stageClearScoreText.text = $"{StaticVariables.ClearScore} {Mathf.FloorToInt(clearScore).ToString("D6")}"; scoreSlider.maxValue = clearScore; moveText.text = moveValue.ToString(); currStageState = StageState.Play; GameManager.Instance.BackgroundMusicPlay(board.stageData.backgroundMusic); }
private void Win_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Space && this.canShoot) { this.canShoot = false; this.gameLogic.PlayerShoot(); } else if (e.Key == Key.Left) { this.isMovingRight = false; } else if (e.Key == Key.Right) { this.isMovingRight = true; } else if (e.Key == Key.Escape) { this.gameLogic.GameStateSwitch(GameState.Paused); PauseWindow window = new PauseWindow(this.gameLogic); window.ShowDialog(); this.gameDisplay = new SpaceInvaderDisplay(this.gameLogic.Model); this.isMovingRight = null; this.gameLogic.GameStateSwitch(GameState.Running); InvalidateVisual(); } else if (this.gameLogic.Model.GameState == GameState.Finished && e.Key == Key.Enter) { Window.GetWindow(this).Close(); } }
// pauzowanie gry public static void ResumeGame() // wznow gre { PauseWindow.HideStatic(); // ukrywamy okno pauzy po wznowieniu gry Time.timeScale = 1f; // modyfikator do naszego czasu // jesli wynosi 1 to gra sie z powrotem wznowi }
private void Awake() { instance = this; transform.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; transform.GetComponent <RectTransform>().sizeDelta = Vector2.zero; Hide(); }
void onPause() { GameObject obj = GameObject.Find("UI Root").AddChild(this.Window); obj.transform.position = this.transform.position; obj.transform.position += new Vector3(-9.0f, -4.0f, 0.0f); PauseWindow Window = obj.GetComponent <PauseWindow>(); }
// funkcja do zatrzymania gry public static void PauseGame() // pauzuj gre { PauseWindow.ShowStatic(); // okno pauzy wyswietla sie statycznie Time.timeScale = 0f; // modyfikator do naszego czasu // jesli wynosi 0 to gra sie wstrzyma }
public void CloseMenu(Menus menu) { switch (menu) { case Menus.MainMenu: MainMenu.Close(); CurrentMenu = null; break; case Menus.NewGameMenu: NewGameMenu.Close(); CurrentMenu = null; break; case Menus.GameInfoMenu: GameInfoMenu.Close(); break; case Menus.AdvancedSettingsMenu: AdvancedSettingsMenu.Close(); break; case Menus.HighscoresMenu: HighscoresMenu.Close(); CurrentMenu = null; break; case Menus.LoadGameMenu: LoadGameMenu.Close(); CurrentMenu = null; break; case Menus.ConfirmStepWindow: ConfirmStepWindow.Close(); break; case Menus.PlayAgainWindow: PlayAgainWindow.Close(); break; case Menus.PauseWindow: PauseWindow.Close(); CurrentMenu = null; break; case Menus.SaveGameWindow: SaveGameWindow.Close(); CurrentMenu = null; break; case Menus.LoadGameWindow: LoadGameWindow.Close(); CurrentMenu = null; break; } }
public static void ResumeGame() { PauseWindow.HideStatic(); foreach (AudioSource audio in FindObjectsOfType <AudioSource>()) { audio.UnPause(); } SoundManager.PlaySound(SoundManager.Sound.Unpause); Time.timeScale = 1f; }
public static void PauseGame() { PauseWindow.ShowStatic(); foreach (AudioSource audio in FindObjectsOfType <AudioSource>()) { audio.Pause(); } SoundManager.PlaySound(SoundManager.Sound.Pause); Time.timeScale = 0f; }
private void OnPauseWindowClosed(BaseWindow baseWindow) { Debug.Log("OnPausedClosed"); if (pauseWindow != null) { pauseWindow.OnWindowClosed -= OnPauseWindowClosed; pauseWindow = null; } GameplayManager.Instance.IsGamePause = false; }
public void Start() { uIMgr = UImenu.manager; PauseWindow quitButton = uIMgr.GetWindow(Menus.Pause) as PauseWindow; quitButton.ChangedButton(SceneType.StageSelect); SetStageNode(); GameManager.Instance.BackgroundMusicPlay(BGMClip.SelectStage); GameManager.Instance.googleMgr.RefreshAchievements(); }
private void PauseGame() { this.tickTimer.Stop(); this.tickTimerSeconds.Stop(); this.GameModel.Character.Blocked = true; PauseWindow pauseWindow = new PauseWindow(this) { Left = Window.GetWindow(this).Left + 200, Top = Window.GetWindow(this).Top + 100, }; pauseWindow.Show(); }
private void Awake() { i = this; transform.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; transform.GetComponent <RectTransform>().sizeDelta = Vector2.zero; transform.Find("ResumeButton").GetComponent <Button_UI>().ClickFunc = () => GameHandler.ResumeGame(); transform.Find("MainMenuButton").GetComponent <Button_UI>().ClickFunc = () => Loader.Load(Loader.Scene.MainMenu); Hide(); }
private void Awake() { instance = this; transform.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; transform.GetComponent <RectTransform>().sizeDelta = Vector2.zero; // references to the buttons transform.Find("resumeBtn").GetComponent <Button_UI>().ClickFunc = () => GameHandler.ResumeGame(); transform.Find("mainMenuBtn").GetComponent <Button_UI>().ClickFunc = () => Loader.Load(Loader.Scene.MainMenu); Hide(); }
private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (isGamePaused()) { ResumeGame(); PauseWindow.HidePauseWindowStatic(); } else { PauseGame(); PauseWindow.ShowPauseWindowStatic(); } } }
IEnumerator OpenPause() { pauseopen = true; int length = 40; float a = 150f / length; float b = 1f / length; PauseWindow.SetActive(true); for (int i = length; i > 0; i--) { PauseWindow.transform.localPosition = new Vector3(PauseWindow.transform.localPosition.x, 0f - a * i, PauseWindow.transform.localPosition.z); PauseGroup.alpha = b * (length - i - 3); yield return(new WaitForEndOfFrame()); } }
IEnumerator ClosePause() { pauseopen = false; int length = 40; float a = 150f / length; float b = 1f / length; for (int i = 0; i < length; i++) { PauseWindow.transform.localPosition = new Vector3(PauseWindow.transform.localPosition.x, 0f - a * i, PauseWindow.transform.localPosition.z); PauseGroup.alpha = b * (length - i - 3); yield return(new WaitForEndOfFrame()); } PauseWindow.SetActive(false); }
// I_STATES public void Enable() { _gameManager = Core.Instance.GetService <GameManager>(); Assert.AreNotEqual(null, _gameManager); _statesManager = Core.Instance.GetService <StatesManager>(); Assert.AreNotEqual(null, _statesManager); // _uiManager = Core.Instance.GetService <UIManager>(); Assert.AreNotEqual(null, _uiManager); _mainScreenStateManager = _uiManager.Get_MainScreenStateManager(); Assert.AreNotEqual(null, _mainScreenStateManager); _gameWindow = _uiManager.GetWindow(UIWindowEnum.GAMEWINDOW_ASYNC) as GameWindowAsyncMultiplayer; Assert.AreNotEqual(null, _gameWindow); _pauseWindow = _uiManager.GetWindow(UIWindowEnum.PAUSE_ASYNC) as PauseWindow; Assert.AreNotEqual(null, _pauseWindow); _audioService = Core.Instance.GetService <AudioService>(); Assert.AreNotEqual(null, _audioService); // Debug.Log("Enable GAME_ASYNC"); EventManager._init.Game.MenuButton.Resume += Resume; _pauseWindow.OnMenuClick += Menu; _gameManager.CreateGameHandler(); // Assert.AreNotEqual(null, _gameWindow._objBackground); _gameWindow._objBackground.SetActive(false); // ------------------------------------------- // // ------------------------------------------- // _uiManager.ShowWindow(UIWindowEnum.SPLASH, true); _mainScreenStateManager.SwitchState(MainScreenStatesEnum.GAME_ASYNC); }
public void LoadGameplay() // Loads the gameplay window and its content { if (Windows.ContainsKey("Gameplay")) { Windows["Gameplay"] = new GameplayWindow(); Windows["Pause"] = new PauseWindow(); Windows["Death"] = new DeathWindow(); } else { Windows.Add("Gameplay", new GameplayWindow()); Windows.Add("Pause", new PauseWindow()); Windows.Add("Death", new DeathWindow()); } Windows["Pause"].LoadContent(); }
private void Awake() { instance = this; transform.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; transform.GetComponent <RectTransform>().sizeDelta = Vector2.zero; // zmieniamy polozenie okna na srodek transform.Find("resumeBtn").GetComponent <Button_UI>().ClickFunc = () => GameHandler.ResumeGame(); transform.Find("resumeBtn").GetComponent <Button_UI>().AddButtonSound(); // dzwieki do przyciskow // pauzowanie gry za pomoca funkcji z GameHandler transform.Find("mainMenuBtn").GetComponent <Button_UI>().ClickFunc = () => Loader.Load(Loader.Scene.MainMenu); // po kliknieciu przycisku main menu wroc do sceny glownego menu transform.Find("mainMenuBtn").GetComponent <Button_UI>().AddButtonSound(); // dzwieki do przyciskow Hide(); }
private void Awake() { shareInstance = this; transform.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; transform.GetComponent <RectTransform>().sizeDelta = Vector2.zero; transform.Find("resumBtn").GetComponent <Button_UI>().ClickFunc = () => { GameHandler.ResumeGame(); }; transform.Find("mainMenuBtn").GetComponent <Button_UI>().ClickFunc = () => { Loader.Load(Loader.Scene.MainMenu); }; SetupButtonsSounds(); Hide(); }
public static void PauseGame() { PauseWindow.ShowStatic(); Time.timeScale = 0f; }
public static void ResumeGame() { PauseWindow.HideStatic(); Time.timeScale = 1f; }
private void Awake() { instance = this; HidePauseWindow(); }