private void onGoToMainMenu() { Singleton.instance.networkManager.Disconnect(); _fader.FadeOut(0.35f, () => { _stateMachine.ChangeState(TacoTuesdayState.MAIN_MENU); }); }
private void ImDone() { if (!gameStateMachine_Ref.GameOver) { if (amIPlayerOne) { if (!gameStateMachine_Ref.GameOver) { inGameUIManager_Ref.PlayerTwoPrintText_Ref.canIPrint = true; inGameUIManager_Ref.playerTwoIntroUIAnim_Ref.isTalking = true; myString = ""; } } else { gameStateMachine_Ref.IntroIsDone = true; currentStringToDisplay = ""; gameStateMachine_Ref.TurnOffIntroTauntScreen(); } } else { gameStateMachine_Ref.ChangeState(new BeginState(gameStateMachine_Ref)); } }
// Use this for initialization void Start() { InputHandler = GameObject.Find("Camera").GetComponent <InputHandler>(); stateMachine = new GameStateMachine(); stateMachine.ChangeState(new GameStateBlackTurn()); }
public void PlayerInput() { if (Input.GetKeyDown(KeyCode.Space)) { gameStateMachine_Ref.ChangeState(new BeginState(gameStateMachine_Ref)); } }
public void Step(float p_deltaTime) { if (_asyncLoad.isDone) { _gameStateMachine.ChangeState(JamStateType.GAMEPLAY); _gui.screenFader.FadeIn(); } }
public override void Initialize() { view.OnStartClicked.AddListener(() => { AI.enabled = false; sm.ChangeState <InGameState>(); }); view.OnStartAIClicked.AddListener(() => { AI.enabled = true; sm.ChangeState <InGameState>(); }); view.OnEggClicked.AddListener(() => Application.OpenURL("https://youtu.be/0XgCsv-y-mc?t=70")); view.OnBackKeyClicked.AddListener(() => Application.Quit()); // who cares about unsubscribing }
public void PlayerInput() { if (Input.GetKeyDown(KeyCode.Escape)) { gameStateMachine.ChangeState(new PlayState(gameStateMachine, false)); gameStateMachine.TurnOnCanvasSection(2); } }
public void Init(Hashtable changeStateData) { //Debug.Log ("Entering In Intro State"); DOTween.Init(true, true, LogBehaviour.ErrorsOnly); // More initialization _gameStateMachine.ChangeState(JamStateType.MAIN_MENU); _gui.screenFader.FadeIn(); }
public void ResumeGameButtonPressed() { if (gameStateMachine_Ref != null) { gameStateMachine_Ref.ChangeState(new PlayState(gameStateMachine_Ref, false)); } else { Debug.Log("ResumeGameButton is missing a reference to GameStateMachine"); } }
public override void Initialize() { view.ToMenu.AddListener(() => sm.ChangeState <MenuGameState>()); view.LeftDown.AddListener(() => { if (!aiEnabled) { signalBus.Fire <EmptynessInside>("LeftFlipperDown"); } }); view.LeftUp.AddListener(() => { if (!aiEnabled) { signalBus.Fire <EmptynessInside>("LeftFlipperUp"); } }); view.RightDown.AddListener(() => { if (!aiEnabled) { signalBus.Fire <EmptynessInside>("RightFlipperDown"); } }); view.RightUp.AddListener(() => { if (!aiEnabled) { signalBus.Fire <EmptynessInside>("RightFlipperUp"); } }); springArea.BallEntered.AddListener(() => { if (!aiEnabled) { view.SetActiveAcceleratorPanel(true); } }); springArea.BallLeft.AddListener(() => { if (!aiEnabled) { view.SetActiveAcceleratorPanel(false); } }); view.OnAcceleratorDrag.AddListener((x) => { view.SetAcceleratorFill(Mathf.Clamp01(-(x.position - x.pressPosition).y / maxDrag)); }); view.OnAcceleratorUp.AddListener((x) => { launchForce = Mathf.Clamp01(-(x.position - x.pressPosition).y / maxDrag); Debug.Log(x.position - x.pressPosition); LaunchTheBall(); // view.SetActiveAcceleratorPanel(false); }); }
public virtual void Execute() { m_curTime += Time.deltaTime; if (m_isTimeBased && m_curTime >= m_stateDuration) { if (m_nextState != null) { m_fsm.ChangeState(m_nextState.m_stateName); } return; } if (OnUpdate != null) { OnUpdate(); } Update(); }
void Initialize() { // Prevents duplicate GameManagers, but allows for easier testing if (Instance != FindObjectOfType<GameManager>()) { gameObject.SetActive(false); return; } // Don't destroy this; other GameManagers in other scenes should be disabled before build and for testing should use GameStateInit DontDestroyOnLoad(this); // Create new inventory if (m_inventory == null) { m_inventory = new Inventory(slots); } /////////////////////// // Create new CharacterManager if (m_characters == null) { // No auto; let game states search by their own m_characters = new CharacterManager(false); } /////////////////////// // Create new CameraController if (m_camera == null) { // Add targets after scene load m_camera = new CameraController(/*Human.Link.gameObject, Dog.Link.gameObject*/); // Add states, but change on GameStatePlay m_camera.AddState(new CameraStateFollow(movementSmooth, rotationSmooth, minY, maxY)); //Camera.ChangeState("CameraStateFollow"); } /////////////////////// // Create a new UI Manager if (m_ui == null) { //BUG: this seems to be null'd after first scene load? m_ui = new UIManager(false); } /////////////////////// // Create new GameStateMachine if (GameState == null) { GameState = new GameStateMachine(); // Add some states GameState.AddStatesRange(new GameStatePlay(), new GameStateStart(), new GameStateEnd(), new GameStateLoad(), new GameStateInit()); GameState.ChangeState(startState); // Set starting statea GameState.UpdateState(); // Update to that state immidiately } /////////////////////// // Refresh GameManager once after all systems are initialized Refresh(); }
public void StartGameButtonPressed() { gameStateMachine_Ref.ChangeState(new PlayState(gameStateMachine_Ref, true)); }
public override void Initialize() { view.OnToMenuClicked.AddListener(() => sm.ChangeState <MenuGameState>()); view.OnRestartClicked.AddListener(() => sm.ChangeState <InGameState>()); }
public void Init(ErrorMessageView view) { this.uiView = view; view.OnBackClicked.AddListener(() => sm.ChangeState <ListGameState>()); }
private void onGameOver(GeneralEvent e) { _stateMachine.ChangeState(TuckState.MAIN_MENU);; }
public void ModelSelected(ModelEntry entry) { sm.ChangeState <LoadingGameState, ModelEntry>(entry); }