void Start() { pauseState = new PauseState(); gameplayState = new GameplayState(); gameplayState.EnterState(); currentState = gameplayState; }
public GameState() { this.buildState = new BuildState(); this.regularState = new RegularState(); this.pauseState = new PauseState(); state = regularState; }
private static void HandlePauseStateChange(PauseState state) { foreach (KinematicCharacterMotor motor in KinematicCharacterSystem.CharacterMotors) { motor.SetPositionAndRotation(motor.Transform.position, motor.Transform.rotation, true); } }
// Start is called before the first frame update void Start() { Debug.Log(playerIndex); currentPauseState = PauseState.selectionWindow; menuOrder = 1; if (playerIndex == 0) { playerNumber.gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(-180, 259); playerNumber.sprite = player[0]; playerSelection.sprite = PlayerSelectionSprite[0]; } if (playerIndex == 1) { playerNumber.gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(180, 259); playerNumber.sprite = player[1]; playerSelection.sprite = PlayerSelectionSprite[1]; } //set animator anim = GetComponent <Animator>(); //set controller rewiredPlayer = ReInput.players.GetPlayer(playerIndex); }
public GameManager() : base("GameManager") { SetupState setupState = new SetupState(this); MenuState menuState = new MenuState(this); SinglePlayer singleMode = new SinglePlayer(this); PauseState pauseState = new PauseState(this); LoseState loseState = new LoseState(this); WinState winState = new WinState(this); MultiPlayer multiMode = new MultiPlayer(this); LobbySetup lobby = new LobbySetup(this); //Link State setupState.MenuState = menuState; menuState.SinglePlayerMode = singleMode; menuState.Lobby = lobby; singleMode.NextWin = winState; singleMode.NextLose = loseState; singleMode.NextPause = pauseState; lobby.Menu = menuState; lobby.MultiMode = multiMode; multiMode.NextLose = loseState; multiMode.NextPause = pauseState; multiMode.NextWin = winState; loseState.Retry = menuState; setupState.OnStateEnter(); currentState = setupState; AddComponent(new FSMUpdater(currentState)); }
// SETTINGS MENU public void OpenSettingsMenu() { clickEvent.Play(); state = PauseState.IN_SETTINGS_MENU; pauseMenuUI.SetActive(false); settingsUI.SetActive(true); }
void HandleOnPlayModeChanged(PauseState value) { if (EditorApplication.isPlaying) { if (isPlaying) { isPlaying = false; } else { isPlaying = true; } } if (isPlaying) { if (editMode) { editMode = false; } if (pathArea) { Selection.activeGameObject = pathArea.gameObject; } ActiveEditorTracker.sharedTracker.isLocked = editMode; SetVisiblePoints(editMode); Repaint(); } }
private static void OnPauseStateChanged(PauseState pauseState) { switch (pauseState) { case PauseState.Paused: StoreSceneNeedFocus(); if (!sceneNeedFocus) { FindGameWindow(); if (gameWindow != null && gameWindow.hasFocus) { FocusOnUpdate(FocusGameWindow); } } else { FocusOnUpdate(FocusSceneWindow); } break; case PauseState.Unpaused: if (sceneNeedFocus) { FocusOnUpdate(FocusSceneWindow); } break; } }
public static Pause Initialize(long?oid, string operationId, string operationName, DateTime createdAt, DateTime?effectiveSince, PauseState state, PauseSource source, Initiator initiator, DateTime?cancelledAt, DateTime?cancellationEffectiveSince, Initiator cancellationInitiator, PauseCancellationSource?cancellationSource) { if (!oid.HasValue) { throw new InvalidOperationException("Pause initialization can be done for persisted object only"); } return(new Pause( oid, operationId, operationName, createdAt, effectiveSince, state, source, initiator, cancelledAt, cancellationEffectiveSince, cancellationInitiator, cancellationSource)); }
public void CloseSettingsMenu() { clickEvent.Play(); state = PauseState.IN_PAUSE_MENU; pauseMenuUI.SetActive(true); settingsUI.SetActive(false); }
/// <summary> /// /// </summary> public void DoOptions() { if (!OptionsUI.activeSelf) { if (CreditsUI.activeSelf) { CreditsUI.GetComponent <Animator>().SetBool("show", false); } //This animation have a event to call Options UI show if (!isMoved) { PauseUI.GetComponent <Animator>().Play(m_PauseMoveAnim, 0, 0); } else { OptionsUI.SetActive(true); OptionsUI.GetComponent <Animator>().SetBool("show", true); } isMoved = true; //If you do not want to disable animation for event //use this: m_PauseState = PauseState.Options; } else { OptionsUI.GetComponent <Animator>().SetBool("show", false); PauseUI.GetComponent <Animator>().Play(m_PauseMoveReturnAnim, 0, 0); isMoved = false; } }
public void ChangePauseState(PauseState state) { _pauseState = state; switch (state) { case PauseState.MAIN_PAUSE: { UpdateSongDisplayText(); SettingsObject.SetActive(false); PauseMenuObject.SetActive(true); PauseScreenBackgroundObject.SetActive(true); GameSettings.PauseGame(true); break; } case PauseState.NOT_PAUSED: { PauseScreenBackgroundObject.SetActive(false); PauseMenuObject.SetActive(false); SettingsObject.SetActive(false); GameSettings.PauseGame(false); break; } case PauseState.SETTINGS: { SettingsObject.SetActive(true); PauseMenuObject.SetActive(false); PauseScreenBackgroundObject.SetActive(true); break; } } }
private State GetState(States state) { State result; switch (state) { case States.SPLASH: result = new SplashState(this); break; case States.GAME: result = new GameState(this); break; case States.PAUSE: result = new PauseState(this, CurrentState.StateIdentifier); break; case States.MAINMENU: result = new MainMenuState(this); break; case States.CREDIT: result = new CreditState(this); break; default: result = new FailState(this); break; } return(result); }
/// <summary> /// /// </summary> public void DoCredits() { if (!CreditsUI.activeSelf) { if (OptionsUI.activeSelf) { OptionsUI.GetComponent <Animator>().SetBool("show", false); } //This animation have a event to call Options UI show if (!isMoved) { PauseUI.GetComponent <Animator>().Play(m_PauseMoveAnim, 0, 0); } else { CreditsUI.SetActive(true); CreditsUI.GetComponent <Animator>().SetBool("show", true); } isMoved = true; m_PauseState = PauseState.Credits; } else { CreditsUI.GetComponent <Animator>().SetBool("show", false); PauseUI.GetComponent <Animator>().Play(m_PauseMoveReturnAnim, 0, 0); isMoved = false; } }
private void OnEditorApplicationPause(PauseState obj) { if (obj == PauseState.Paused) { OnSave(); } }
public void PauseGame() { m_GameState = GameState.Paused; UpdatePauseState = true; m_PauseState = PauseState.PauseMenu; /*Cursor.lockState = CursorLockMode.None; * Cursor.visible = true; * foreach (GameObject gameObject in m_InGameHUD) * { * gameObject.gameObject.SetActive(false); * } * foreach (GameObject gameObject in m_PauseMenu) * { * gameObject.gameObject.SetActive(false); * } * m_PauseMenu[0].gameObject.SetActive(true); * m_PauseMenu[1].gameObject.SetActive(true); * Time.timeScale = 0; * m_isGamePaused = true; * foreach (Component part in m_PlayerParts) * { * part.gameObject.SetActive(false); * }*/ }
private Pause(long?oid, string operationId, string operationName, DateTime createdAt, DateTime?effectiveSince, PauseState state, PauseSource source, Initiator initiator, DateTime?cancelledAt, DateTime?cancellationEffectiveSince, [CanBeNull] Initiator cancellationInitiator, PauseCancellationSource?cancellationSource) { Oid = oid; OperationId = operationId; OperationName = operationName; CreatedAt = createdAt; EffectiveSince = effectiveSince; State = state; Source = source; Initiator = initiator; CancelledAt = cancelledAt; CancellationEffectiveSince = cancellationEffectiveSince; CancellationInitiator = cancellationInitiator; CancellationSource = cancellationSource; }
public override void Update(GameTime gameTime) { // Update input to allow states get player control etc. Input.Update(); // Update exiting state if it is exiting if (ExitingState != null) { if (ExitingState.Status == GameStateStatus.Exiting) { ExitingState.Update(gameTime); } else { ExitingState = null; } } // Update the current state if (CurrentState != null) { CurrentState.Update(gameTime); // Handle input on current state only when it's running if (CurrentState.IsActive || CurrentState.IsPaused) { CurrentState.HandleInput(this.Input); } if (PauseState != null && PauseState.IsActive) { PauseState.Update(gameTime); } } }
private static void PauseStateChanged(PauseState state) { if (onPlayModeStateChanged != null) { onPlayModeStateChanged(); } }
private void InitialzeStateManager() { _stateManager = new StateManager(_muffinAnimator); IdleState idle = new IdleState(_stateManager, transform); MoveState move = new MoveState(_stateManager, transform); TrapState trap = new TrapState(_stateManager, transform); DieState die = new DieState(_stateManager, transform); SpinState spin = new SpinState(_stateManager, transform); BlastState blast = new BlastState(_stateManager, transform); ChocoRushState chocoRush = new ChocoRushState(_stateManager, transform); PauseState pause = new PauseState(_stateManager, transform); _stateManager.AddCharacterState(idle); _stateManager.AddCharacterState(move); _stateManager.AddCharacterState(trap); _stateManager.AddCharacterState(die); _stateManager.AddCharacterState(spin); _stateManager.AddCharacterState(blast); _stateManager.AddCharacterState(chocoRush); _stateManager.AddCharacterState(pause); _stateManager.SetDefaultState("Pause"); }
IEnumerator WaitTime(float waitAmount) { //print("AKSJFHKJASHKJSAHFJKA"); callOnce = true; // Reset all the values for the menu before going back to in game p1MenuCursorTime = 0; p2MenuCursorTime = 0; player1MenuIndex = 0; player2MenuIndex = 0; p1ConfirmedHandOption = false; p2ConfirmedHandOption = false; optionPicked = false; p1CurrentClickState = MenuClickState.UnConfirmed; p2CurrentClickState = MenuClickState.UnConfirmed; p1HandAnimator.SetBool("IsSelected", false); p2HandAnimator.SetBool("IsSelected", false); pauseMenu.SetActive(false); // MAKE PLAYER'S ABLE TO MOVE AGAIN ------------------------------------ StartPlayersFunctionality(); yield return(new WaitForSeconds(waitAmount)); currentState = PauseState.InGame; }
public void setPauseWindow(PauseState _value) { state = _value; switch (state) { case PauseState.Begin: amountOfChildrens = 0; foreach (GameObject g in children) { g.SetActive(true); } foreach (Transform g in children[0].transform) { amountOfChildrens++; g.gameObject.SetActive(true); Color c; if (g.gameObject.GetComponent <Text>()) { c = g.gameObject.GetComponent <Text>().color; g.gameObject.GetComponent <Text>().color = new Color(c.r, c.g, c.b, 0); } if (g.gameObject.GetComponent <Image>()) { c = g.gameObject.GetComponent <Image>().color; g.gameObject.GetComponent <Image>().color = new Color(c.r, c.g, c.b, 0); } } break; } timer = 0; Change = true; }
void SetState(PauseState state) { switch (state) { case PauseState.Unpaused: pauseState = PauseState.Unpaused; pauseImage.sprite = unpaused; Time.timeScale = 1; break; case PauseState.Held: pauseState = PauseState.Held; pauseImage.sprite = held; break; case PauseState.Paused: pauseState = PauseState.Paused; pauseImage.sprite = paused; Time.timeScale = 0; break; default: break; } }
// Update is called once per frame void Update () { --m_ClickBounceFrames ; if( m_ClickBounceFrames < 0 ) m_ClickBounceFrames = 0 ; if( m_ClickBounceFrames > 0 ) return ; switch( m_PauseState ) { case PauseState.OnPlaying : if( Input.GetKey( KeyCode.P ) ) { // Debug.Log( "PauseController01:Update() show pause." ) ; // show pause ShowPauseText() ; m_PauseState = PauseState.OnPause ; m_ClickBounceFrames = 30 ; } break ; case PauseState.OnPause : if( Input.GetKey( KeyCode.P ) ) { // Debug.Log( "PauseController01:Update() hide pause." ) ; // hide pause HidePauseText() ; m_PauseState = PauseState.OnPlaying ; m_ClickBounceFrames = 30 ; } break ; } }
public GameManager(GameplayState gameplayState, PauseState pauseState, LobbyState lobbyState, EndgameState endgameState) { _gameplayState = gameplayState; _pauseState = pauseState; _lobbyState = lobbyState; _endgameState = endgameState; }
/// <summary> /// Pauses the game, while switiching the displayed canvas /// </summary> /// <param name="canvasToShow"></param> public void Pause(Canvases canvasToShow) { Time.timeScale = 0.0f; GlobalPauseState = PauseState.Paused; //CursorManager.ChangeCursorState(CursorLockMode.Confined); MakeActiveCanvas(canvasToShow); }
private static void OnPauseModeChanged(PauseState state) { if (state == PauseState.Unpaused) { Reset(); } }
// HOW TO MENU public void OpenHowToMenu() { clickEvent.Play(); state = PauseState.IN_HOW_TO_MENU; pauseMenuUI.SetActive(false); howToMenuUI.SetActive(true); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Keypad0)) { if (pauseState == PauseState.NONE) { pauseState = PauseState.PAUSED; } else { pauseState = PauseState.NONE; } } if (pauseState == PauseState.PAUSED && !pauseMenu.activeInHierarchy) { Debug.Log("pausing"); pauseMenu.SetActive(true); } else if (pauseState == PauseState.NONE && pauseMenu.activeInHierarchy) { Debug.Log("unpausing"); pauseMenu.SetActive(false); } }
public void ResumeGame() { m_SettingEditor.SaveSettings(m_VolumeSlider, m_FOVSlider); UpdatePauseState = true; m_PauseState = PauseState.Off; m_GameState = GameState.Playing; }
/// <summary> /// Switch to another state. /// State to be activated must be added first using AddGameState() /// When this is called /// - current state goes first from Running status to Exiting and finally to Hidden. /// - nextState goes from Hidden status to Entering and finally Running. /// How long this takes, is controlled by each states' EnterStateInterval and ExitStateInterval /// </summary> /// <param name="nextState">The state to be activated</param> public void SwitchToState(GameState nextState) { if (PauseState != null && PauseState.IsActive) { PauseState.ExitState(); } if (nextState != CurrentState && gameStates.Contains(nextState)) { nextState.LoadContent(); PreviousState = CurrentState; // switch to next state if (CurrentState != null) { CurrentState.ExitState(); } nextState.EnterState(); if (nextState.IsSlowLoadingState) { // TODO: Should bump up a loading state of some kind } ExitingState = CurrentState; CurrentState = nextState; } }
public async Task <bool> UpdateAsync(long oid, DateTime?effectiveSince, PauseState state, DateTime?cancelledAt, DateTime?cancellationEffectiveSince, Initiator cancellationInitiator, PauseCancellationSource?cancellationSource) { var updated = await _decoratee.UpdateAsync(oid, effectiveSince, state, cancelledAt, cancellationEffectiveSince, cancellationInitiator, cancellationSource); if (updated) { await _log.WriteInfoAsync(nameof(RfqExecutionPauseRepositoryDecorator), nameof(UpdateAsync), new { Oid = oid }.ToJson(), $"RFQ pause has been updated therefore {nameof(RfqEvent)} is about to be published"); var pause = await _decoratee.FindAsync(oid); if (pause != null) { var rfq = await GetRfqByIdAsync(pause.OperationId); await _notifyService.Rfq(rfq.ToEventContract(RfqEventTypeContract.Update, _brokerId)); } } return(updated); }
void Start() { _menu = GetComponentInChildren <GameMenu>(); _hud = GetComponentInChildren <GameHud>(); _camEffects = Camera.main.GetComponent <CameraEffects>(); _camController = Camera.main.GetComponent <CameraController>(); _hud.FinalScoreMode(false); _hud.gameObject.SetActive(false); _menu.Show(OnStartNewGame, null); _introState = new IntroState(this) { TimeInState = 5, TimeAwake = 4f }; _unarmedState = new UnarmedState(this); _accState = new AccState(this); _powerUpState = new PowerUpState(this); _blockadesAndEnemiesState = new BlockadeAndEnemiesState(this); _aliensState = new AliensState(this); _pauseState = new PauseState(this); _aliensFinalState = new AliensFinalState(this); _accState.ExitState = _unarmedState; Spawner = new Spawner(GamePrefabs); Spawner.OnRewardEvent += (reward_pts) => { pts += reward_pts; _hud.SetPoints(pts); }; }
public static PauseState ActionToPerform() { lastClickTime++; if (lastClickTime < 10) return PauseState.PAUSE; string button = ButtonClicked(); if (button != "NONE") lastClickTime = 0; switch (button) { case "ContinueButton": state = PauseState.GAME; break; case "SaveButton": SaveGameClass.SaveGame(); state = PauseState.SAVED; previousState = PauseState.PAUSE; break; case "MenuButton": state = PauseState.MENUASK; break; case "ExitButton": state = PauseState.EXITASK; break; case "YesButton": previousState = state; SaveGameClass.SaveGame(); state = PauseState.SAVED; break; case "NoButton": if (state == PauseState.EXITASK) state = PauseState.EXITSAVED; else if (state == PauseState.MENUASK) state = PauseState.MENUSAVED; break; case "CancelButton": state = PauseState.PAUSE; break; case "SavedFileButton": if (previousState == PauseState.EXITASK) state = PauseState.EXITSAVED; else if (previousState == PauseState.MENUASK) state = PauseState.MENUSAVED; else state = PauseState.PAUSE; break; } return state; }
public void Pause() { State = PauseState.Default; Player = new Player(Context, SkeletonPlayerAssignment.LeftSkeleton); Player.DrawHands = true; AddEntity(Player); var posMenu = new Point(300, (MainGame.Height / 2) - 250); var posResume = new Point(MainGame.Width - 600, (MainGame.Height / 2) - 250); var mi = new MenuItem(Assets.SignMenu, posMenu.X, posMenu.Y, delegate() { Manager.SwitchScreen(new MenuScreen(Context)); }); AddEntity(mi); mi = new MenuItem(Assets.SignResume, posResume.X, posMenu.Y, delegate() { Manager.RemoveScreen(this); }); AddEntity(mi); }
void OnGUI() { if (that.paused) { GUI.Box(new Rect(0, 0, Screen.width, Screen.height), " "); switch (pauseState) { case PauseState.SELECT: GUI.TextArea(new Rect(Screen.width / 2 - 500, Screen.height / 4 - 50, 1000, 100), "PAUSED", pauseStyle); if (GUI.Button(new Rect(Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 25), "Resume", buttonStyle)) { togglePause(); return; } if (GUI.Button(new Rect(Screen.width / 2 - 100, Screen.height / 2, 200, 25), "How to Play", buttonStyle)) { pauseState = PauseState.INSTRUCTIONS; return; } if (GUI.Button(new Rect(Screen.width / 2 - 50, Screen.height / 2 + 50, 100, 25), "Back to Overworld", buttonStyle)) { Application.LoadLevel("overworld"); return; } if (GUI.Button(new Rect(Screen.width / 2 - 50, Screen.height / 2 + 100, 100, 25), "Quit", buttonStyle)) { Application.LoadLevel("title"); return; } break; } } else if (!GlobalScript.isDemo) { EzGUI.scaleGUI(); EzGUI.placeTxt("Score: " + points, 55, EzGUI.HALFW, 65); } else { EzGUI.scaleGUI(); EzGUI.blinkTxt("Press <Enter> to Play", 80, EzGUI.HALFW, EzGUI.HALFH); } }
public void WaitForPlayerCount(int count) { State = PauseState.WaitingForPlayers; Player = new Player(Context, SkeletonPlayerAssignment.LeftSkeleton); Player.DrawHands = true; AddEntity(Player); var mi = new MenuItem(Assets.SignMenu, MainGame.Width - 300, (MainGame.Height / 2) - 100, delegate() { Manager.SwitchScreen(new MenuScreen(Context)); }); AddEntity(mi); Actions.AddAction(new WaitForPlayerCount(count, Context), true); Actions.AddAction(new CallFunction(delegate() { State = PauseState.Countdown; }), true); }
public PauseScreen(KinectContext context) : base(context) { State = PauseState.Default; }
public void CompleteInitialization() { Subscribe(); // delay until Instance is initialized _gameTime = GameTime.Instance; // delay until Instance is initialized // initialize values without initiating change events _pauseState = PauseState.NotPaused; _isPaused = false; }
void Start() { pause = GameObject.Find("PauseState").GetComponent<PauseState>(); }
public void Resume() { Debug.Assert(pauseStatus == PauseState.Paused); try { currentProcessor.resume(); pauseStatus = PauseState.Encoding; } catch (JobRunException ex) { addToLog("Error when trying to resume encoding: " + ex.Message + Environment.NewLine); } }
private void PauseFrame( ) { currentPauseState = PauseState.SCENE_IS_PAUSED; Subject.Notify( STATE_IS_PAUSED ); Time.timeScale = 0.0f; }
public void Test1() { Assert.Throws<ArgumentNullException>(() => { var pauseState = new PauseState(null, null);}); }
/// <summary> /// Input handler for toggling pause step state. /// </summary> /// <param name="pressed">Whether the button is pressed or released.</param> void TogglePauseStep(Boolean pressed) { if (pressed == true) { if (Pause == PauseState.Paused) m_pause = PauseState.PauseStep; } }
/// <summary> /// Input handler for toggling pause state. /// </summary> /// <param name="pressed">Whether the button is pressed or released.</param> void TogglePause(Boolean pressed) { if (pressed == true) { if (Pause == PauseState.Paused || Pause == PauseState.PauseStep) { m_pause = PauseState.Unpaused; MenuSystem.GetSubSystem<Audio.SoundSystem>().UnPauseSounds(); } else { m_pause = PauseState.Paused; MenuSystem.GetSubSystem<Audio.SoundSystem>().PauseSounds(); } } }
void CancelCombat(Boolean pressed) { if (pressed == true) { Pause = PauseState.Unpaused; MenuSystem.PostEvent(new Events.FadeScreen(FadeDirection.Out)); } }
public override void Update(GameTime gametime) { base.Update(gametime); if (m_over == true) return; if (FightEngine.TickCount >= m_recording.Data.Count) { if (MenuSystem.GetSubSystem<InitializationSettings>().QuitAfterReplay == true) { MenuSystem.PostEvent(new Events.FadeScreen(FadeDirection.Out)); } m_over = true; return; } InjectRecordingInput(); if (Pause == PauseState.Unpaused || Pause == PauseState.PauseStep) { FightEngine.Update(gametime); } if (Pause == PauseState.PauseStep) m_pause = PauseState.Paused; }
public CombatScreen(MenuSystem menusystem) : base(menusystem) { m_pause = PauseState.Unpaused; m_recorder = new Replay.Recorder(this); }
public override void Update(GameTime gametime) { base.Update(gametime); Recorder.Update(); if (Pause == PauseState.Unpaused || Pause == PauseState.PauseStep) { FightEngine.Update(gametime); } if (Pause == PauseState.PauseStep) m_pause = PauseState.Paused; }
public static void Load(Game game) { state = PauseState.PAUSE; lastClickTime = 0; string GUIFolder = GraphicSettings.GetGUIFolder(); OnScreenButtons = new List<Button>(); ChoiceButtons = new List<Button>(); spriteBatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch)); font = game.Content.Load<SpriteFont>(GUIFolder + "Consolas"); device = game.GraphicsDevice; int Width = GraphicSettings.ScreenBounds.Width; int Height = GraphicSettings.ScreenBounds.Height; Vector2 buttonDimensions = new Vector2(Width / 6, Height / 12); Color[] data = new Color[(int)(buttonDimensions.X * buttonDimensions.Y)]; Texture2D txt = new Texture2D(device, (int)(buttonDimensions.X), (int)(buttonDimensions.Y)); for (int i = 0; i < data.Length; ++i) data[i] = new Color(64, 64, 128, 128); txt.SetData(data); OnScreenButtons.Add(new Button(new Rectangle(), "Continua gioco", "ContinueButton")); OnScreenButtons[0].LoadTexture(txt); OnScreenButtons.Add(new Button(new Rectangle(), "Salva gioco", "SaveButton")); OnScreenButtons[1].LoadTexture(txt); OnScreenButtons.Add(new Button(new Rectangle(), "Torna al menu", "MenuButton")); OnScreenButtons[2].LoadTexture(txt); OnScreenButtons.Add(new Button(new Rectangle(), "Torna a Windows", "ExitButton")); OnScreenButtons[3].LoadTexture(txt); buttonDimensions = new Vector2(Width / 10, Height / 16); data = new Color[(int)(buttonDimensions.X * buttonDimensions.Y)]; txt = new Texture2D(device, (int)(buttonDimensions.X), (int)(buttonDimensions.Y)); for (int i = 0; i < data.Length; ++i) data[i] = new Color(64, 64, 128, 128); txt.SetData(data); ChoiceButtons.Add(new Button(new Rectangle(), "Salva ed esci", "YesButton")); ChoiceButtons[0].LoadTexture(txt); ChoiceButtons.Add(new Button(new Rectangle(), "Esci senza salvare", "NoButton")); ChoiceButtons[1].LoadTexture(txt); ChoiceButtons.Add(new Button(new Rectangle(), "Annulla", "CancelButton")); ChoiceButtons[2].LoadTexture(txt); SavedFileButton = new Button(new Rectangle(), "Ok", "SavedFileButton"); SavedFileButton.LoadTexture(txt); SetButtonPositions(); }
void togglePause() { if (!that.paused) { pauseState = PauseState.SELECT; Time.timeScale = 0.0f; } else { Time.timeScale = 1.0f; } that.paused = !that.paused; }
public RecordedCombatScreen(MenuSystem menusystem) : base(menusystem) { m_pause = PauseState.Unpaused; m_over = false; }
private void ResumeFrame( ) { currentPauseState = PauseState.SCENE_IS_RESUMED; Subject.Notify( STATE_IS_RESUMED ); Time.timeScale = 1.0f; }
/// 更新処理 private void Update() { // ポーズ状態が変更されていたら、Pause/Resumeを呼び出す。 if (_prevState != State) { // 新しく子が追加されたりした可能性もあるのでいったんResumeする. Resume(); switch (State) { case PauseState.PauseAll: PauseMonoBehavior(); PauseAnimator(); break; case PauseState.PauseUpdate: PauseMonoBehavior(); break; case PauseState.Active: break; default: throw new ArgumentOutOfRangeException(); } _prevState = State; } }
/// <summary> /// starts the job provided as parameters /// </summary> /// <param name="job">the Job object containing all the parameters</param> /// <returns>success / failure indicator</returns> private bool startEncoding(Job job) { Debug.Assert(status == JobWorkerStatus.Idle); try { //Check to see if output file already exists before encoding. if (File.Exists(job.Output) && !mainForm.DialogManager.overwriteJobOutput(job.Output)) throw new JobStartException("File exists and the user doesn't want to overwrite", ExceptionType.UserSkip); // Get IJobProcessor currentProcessor = getProcessor(job); if (currentProcessor == null) throw new JobStartException("No processor could be found", ExceptionType.Error); addToLog("\r\n\r\n------------------------------------------------------\r\n\r\n"); addToLog("Starting job " + job.Name + " at " + DateTime.Now.ToLongTimeString() + "\r\n"); // Preprocess preprocessJob(job); // Setup try { currentProcessor.setup(job); } catch (JobRunException e) { throw new JobStartException("Calling setup of processor failed with error '" + e.Message + "'", ExceptionType.Error); } // Do JobControl setup addToLog("encoder commandline:\r\n" + job.Commandline + "\r\n"); currentProcessor.StatusUpdate += new JobProcessingStatusUpdateCallback(UpdateGUIStatus); // Progress window pw = new ProgressWindow(job.JobType); pw.WindowClosed += new WindowClosedCallback(pw_WindowClosed); pw.Abort += new AbortCallback(pw_Abort); pw.setPriority(job.Priority); pw.PriorityChanged += new PriorityChangedCallback(pw_PriorityChanged); if (mainForm.Settings.OpenProgressWindow && mainForm.Visible) pw.Show(); job.Status = JobStatus.PROCESSING; job.Start = DateTime.Now; status = JobWorkerStatus.Running; pauseStatus = PauseState.Encoding; currentJob = job; // Start try { currentProcessor.start(); } catch (JobRunException e) { throw new JobStartException("starting encoder failed with error '" + e.Message +"'", ExceptionType.Error); } addToLog("successfully started encoding\r\n"); refreshAll(); return true; } catch (JobStartException e) { addToLog("Job not started. Reason: " + e.Message + "\r\n"); if (e.type == ExceptionType.Error) job.Status = JobStatus.ERROR; else // ExceptionType.UserSkip job.Status = JobStatus.SKIP; currentProcessor = null; currentJob = null; status = JobWorkerStatus.Idle; pauseStatus = PauseState.NotEncoding; refreshAll(); return false; } }
private void ToPause() { ShowPauseText() ; TellMainCharacterPause() ; m_PauseState = PauseState.OnPause ; m_ClickBounceFrames = 30 ; }
void Start() { if (GameObject.Find("PauseState") != null) pauseState = GameObject.Find("PauseState").GetComponent<PauseState>(); }
private void UnPause() { HidePauseText() ; TellMainCharacterUnPause() ; m_PauseState = PauseState.OnPlaying ; m_ClickBounceFrames = 30 ; }
void Awake (){ mover = GetComponent<CharacterMover>(); pause = GameObject.Find("PauseState").GetComponent<PauseState>(); }
void Start() { _menu = GetComponentInChildren<GameMenu>(); _hud = GetComponentInChildren<GameHud>(); _camEffects = Camera.main.GetComponent<CameraEffects>(); _camController = Camera.main.GetComponent<CameraController>(); _hud.FinalScoreMode(false); _hud.gameObject.SetActive(false); _menu.Show(OnStartNewGame, null); _introState = new IntroState(this) { TimeInState = 5, TimeAwake = 4f }; _unarmedState = new UnarmedState(this); _accState = new AccState(this); _powerUpState = new PowerUpState(this); _blockadesAndEnemiesState = new BlockadeAndEnemiesState(this); _aliensState = new AliensState(this); _pauseState = new PauseState(this); _aliensFinalState = new AliensFinalState(this); _accState.ExitState = _unarmedState; Spawner = new Spawner(GamePrefabs); Spawner.OnRewardEvent += (reward_pts) => { pts += reward_pts; _hud.SetPoints(pts); }; }