private void OnMouseUp() { if (m_IsVisible && !UpdaterProxy.Get().IsPaused()) { new OnEdgeClick("Game", this).Push(); } }
public override void OnEnter() { UpdaterProxy.Get().SetPause(true); this.RegisterAsListener("Game", typeof(GameFlowEvent)); this.RegisterAsListener("Player", typeof(PlayerInputGameEvent)); new PauseEvent(true).Push(); }
public override void OnExit() { new PauseEvent(false).Push(); this.UnregisterAsListener("Player"); this.UnregisterAsListener("Game"); UpdaterProxy.Get().SetPause(false); }
private void OnMouseEnter() { if (!UpdaterProxy.Get().IsPaused()) { m_Sprite.color = Color.green; } }
public void Stop() { DumpStack(); UpdaterProxy.Get().Unregister(this, EUpdatePass.Last); ClearStack(); m_TransitionQueue.Clear(); }
public override void OnEnter() { UpdaterProxy.Get().SetPause(true); Time.timeScale = 0; PlayerManagerProxy.Get().ResetStat(); this.RegisterAsListener("Game", typeof(GameFlowEvent)); }
public override void OnEnter() { // TODO: Edge enter logic UpdaterProxy.Get().SetPause(true); m_Player = GameObject.FindGameObjectWithTag("Player").GetComponent <OverworldPlayerController> (); this.RegisterAsListener("Game", typeof(GameFlowEvent)); }
public void ChoosePath() { m_CurrentEdge.GetEdgeResource().SetNormal(); new CameraFollowEvent().Push(); switch (m_MoveType) { case EEdgeType.Normal: m_Player.OnNormalEdge(m_CurrentEdge); break; case EEdgeType.Combat: new OnEdgeBattleGameEvent(true, m_CurrentEdge).Push(); m_Player.OnEdge(m_CurrentEdge, true); break; case EEdgeType.Obstacle: break; case EEdgeType.Diversion: new OnDiversionEvent().Push(); m_Player.OnEdge(m_CurrentEdge, true); break; } gameObject.SetActive(false); UpdaterProxy.Get().SetPause(false); }
public void OnGameEvent(OnEdgeClick edgeEvent) { gameObject.SetActive(true); UpdaterProxy.Get().SetPause(true); m_CurrentEdge = edgeEvent.GetEdge(); m_ChoosePathButton.interactable = m_Player.CanMoveToEdge(m_CurrentEdge); EdgeResource tempEdgeResource = m_CurrentEdge.GetEdgeResource(); switch (tempEdgeResource.GetEdgeType()) { case EEdgeType.Normal: m_MoveType = EEdgeType.Normal; break; case EEdgeType.Combat: if (TeamManagerProxy.Get().IsNotTooMuchCharacters(tempEdgeResource.GetEdgeCharacterNumber())) { m_MoveType = EEdgeType.Normal; } else { m_MoveType = EEdgeType.Combat; } break; case EEdgeType.Obstacle: if (TeamManagerProxy.Get().IsCharacterClass(tempEdgeResource.GetEdgeCharacterClass())) { m_MoveType = EEdgeType.Normal; } else { m_MoveType = EEdgeType.Obstacle; m_ChoosePathButton.interactable = false; } break; case EEdgeType.Diversion: if (TeamManagerProxy.Get().IsNotTooMuchCharacters(tempEdgeResource.GetEdgeCharacterNumber())) { m_MoveType = EEdgeType.Normal; } else { m_MoveType = EEdgeType.Diversion; } break; } m_Description.text = tempEdgeResource.GetDescription(); }
void Update() { if (UpdaterProxy.Get().IsPaused()) { return; } if (m_FollowPlayer) { GameObject player = GameObject.FindGameObjectWithTag("Player"); transform.position = new Vector3(player.transform.position.x, player.transform.position.y, transform.position.z); } }
public void OnGameEvent(PlayerInputGameEvent inputEvent) { if (UpdaterProxy.Get().IsPaused() || !m_ProcessInput) { return; } string input = inputEvent.GetInput(); EInputState state = inputEvent.GetInputState(); switch (input) { case "Jump": if (state == EInputState.Down) { Jump(); } break; case "Right": Move(state == EInputState.Held ? 1 : 0); ChangeFacingDirection(m_Right); break; case "Left": Move(state == EInputState.Held ? -1 : 0); ChangeFacingDirection(m_Left); break; case "Blast": if (state == EInputState.Down) { Fire(); } break; case "Slash": if (state == EInputState.Down) { Slash(); } break; default: break; } }
public void OnGameEvent(GameFlowEvent flowEvent) { switch (flowEvent.GetAction()) { case EGameFlowAction.StartDialogue: UpdaterProxy.Get().SetPause(true); ChangeNextTransition(HSMTransition.EType.Child, typeof(GameFlowDialogueState)); break; case EGameFlowAction.EndDialogue: UpdaterProxy.Get().SetPause(false); break; case EGameFlowAction.EndLevel: ChangeNextTransition(HSMTransition.EType.Clear, typeof(GameFlowEndLevelState)); break; } }
IEnumerator SpawnRountine(int binNumber) { m_Animator.SetBool("IsSpawning", true); SoundManagerProxy.Get().PlayMultiple(m_FallingSound); UpdaterProxy.Get().SetPause(true); yield return(new WaitForSeconds(1f)); GameObject binGameObject = GameObject.Instantiate(m_BinPrefab); TileCoordinates coordinates = GetCoordinates(); binGameObject.transform.position = new Vector3(coordinates.x.ToWorldUnit(), coordinates.y.ToWorldUnit(), 0); Bin bin = binGameObject.GetComponent <Bin> (); bin.Init(ETileObjectType.Bin, coordinates.x, coordinates.y, new string[] { binNumber.ToString() }); bin.SetSpawnedCommandNumber(); TileManagerProxy.Get().SetTileObject(coordinates, bin); ms_BinNumber++; UpdaterProxy.Get().SetPause(false); m_Animator.SetBool("IsSpawning", false); }
public static void UnregisterToUpdate(this System.Object objectToNotify, params EUpdatePass[] updatePassList) { UpdaterProxy.Get().Unregister(objectToNotify, updatePassList); }
public static void RegisterToUpdate(this System.Object objectToNotify, bool isPausable, params EUpdatePass[] updatePassList) { UpdaterProxy.Get().Register(objectToNotify, isPausable, updatePassList); }
public GameEventManager() { m_Notifiers = new Dictionary <string, ListenerNotifier> (); m_GameEventQueue = new Queue <GameEvent> (); UpdaterProxy.Get().Register(this, EUpdatePass.First); }
public void Start(StateID firstStateID) { PushState(firstStateID); UpdaterProxy.Get().Register(this, EUpdatePass.Last); DumpStack(); }
public override void OnExit() { this.UnregisterAsListener("Game"); UpdaterProxy.Get().SetPause(false); }
public void OnGameEvent(PlayerInputGameEvent inputEvent) { if (inputEvent.GetInput() == "Pause" && inputEvent.GetInputState() == EInputState.Down && !UpdaterProxy.Get().IsPaused()) { ChangeNextTransition(HSMTransition.EType.Child, typeof(GameFlowPauseState)); } }
public void Cancel() { m_CurrentEdge = null; gameObject.SetActive(false); UpdaterProxy.Get().SetPause(false); }
public override void OnEnter() { UpdaterProxy.Get().SetPause(true); this.RegisterAsListener("Game", typeof(GameFlowEvent)); }
public void OnGameEvent(PlayerInputGameEvent inputEvent) { if (UpdaterProxy.Get().IsPaused()) { return; } string input = inputEvent.GetInput(); EInputState state = inputEvent.GetInputState(); if (state == EInputState.Down) { switch (input) { case "TurnRight": AddTurnCommand((int)EFacingDirection.Right); break; case "TurnLeft": AddTurnCommand((int)EFacingDirection.Left); break; case "TurnUp": AddTurnCommand((int)EFacingDirection.Up); break; case "TurnDown": AddTurnCommand((int)EFacingDirection.Down); break; case "Grab / Ungrab": AddToggleGrabCommand(); break; case "BinSpawnRequest": AddBinSpawnCommand(); break; default: break; } } if (state == EInputState.Held || state == EInputState.Down) { switch (input) { case "Right": AddMoveCommand(1, 0); break; case "Left": AddMoveCommand(-1, 0); break; case "Up": AddMoveCommand(0, 1); break; case "Down": AddMoveCommand(0, -1); break; case "Undo": m_TimeHoldingUndo += Time.deltaTime; if (!m_IsUndoing && (m_TimeHoldingUndo > m_HeldUndoTreshold || state == EInputState.Down)) { StartCoroutine(Undo()); } break; default: break; } } if (state == EInputState.Up && input == "Undo") { m_TimeHoldingUndo = 0f; } }