private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.LEVEL_START) { OnLevelStart(); } }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.OBSTACLE_HIT && data != null && data.GetType() == typeof(GameObject)) { GameObject go = data as GameObject; Obstacle obs = go.GetComponent <Obstacle>(); if (obs != null) { CheckAndIncreaseCombo(obs); } else { Debug.LogWarning("Cannot increase combo, obstacle type not found on hit event"); } } if (type == GAME_EVENT.LEVEL_START) { ResetCombo(); } if (type == GAME_EVENT.LEVEL_END) { } if (type == GAME_EVENT.GAME_PAUSED) { gamePaused = true; } if (type == GAME_EVENT.GAME_UNPAUSED) { gamePaused = false; } }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.REFRESH) { RefreshDashboard(); } }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.LEVEL_END) { pauseButton.gameObject.SetActive(false); pauseMenu.SetActive(false); } if (type == GAME_EVENT.LEVEL_START) { pauseButton.gameObject.SetActive(true); pauseMenu.SetActive(false); } }
public void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.OBSTACLE_HIT) { if (data != null) { try { OnObstacleHit(data); } catch (Exception ex) { Debug.LogError("Error on obstacle hit : " + ex.Message); } } } }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.LEVEL_START) { RestartLevel(); } if (type == GAME_EVENT.LEVEL_END && data != null && data.GetType() == typeof(bool)) { OnLevelEnd((bool)data); } if (type == GAME_EVENT.UPDATE_LIFE && data != null && data.GetType() == typeof(int)) { ScoreManager.UpdateLife((int)data); } }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.UPDATE_LIFE && data != null && data.GetType() == typeof(int)) { UpdateLives((int)data); } else if (type == GAME_EVENT.UPDATE_LIFE) { Debug.LogWarning("Update life called but type of data is not int inside : " + gameObject.name); } if (type == GAME_EVENT.LEVEL_START) { currentLives = -1; } if (type == GAME_EVENT.LEVEL_END) { DisableLivesPanel(); } }
public void HandleGameEvents(GAME_EVENT type, System.Object data = null) { if (type == GAME_EVENT.GAME_PAUSED) //called from LevelController when the parts are being switched { OnGamePaused(); } else if (type == GAME_EVENT.GAME_UNPAUSED) //Called from LevelController when the parts are DONE being switched { OnGameUnPaused(); } else if (type == GAME_EVENT.USE_SKILL) { if (EffectsController.instance != null) { EffectsController.instance.UseSkill((int)data, transform); } else { Debug.LogError("Effects controller instance is null"); } } }
public static void RaiseGameEvent(GAME_EVENT type, System.Object data = null) { OnGameEventRaised?.Invoke(type, data); }
private void HandleGameEvents(GAME_EVENT type, System.Object data = null) { }
public WorldStateData() { last_game_event = GAME_EVENT.NON; last_customize_date = DateTime.Now; need_first_booster_tutor = false; }
//Constructor, pass the event type (game over, collected object etc. public GameboardEventArgs(GAME_EVENT e) { this.e = e; }