private void HandleGameEvents(GAME_EVENT type, System.Object data = null)
 {
     if (type == GAME_EVENT.LEVEL_START)
     {
         OnLevelStart();
     }
 }
Exemple #2
0
    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;
        }
    }
Exemple #3
0
 private void HandleGameEvents(GAME_EVENT type, System.Object data = null)
 {
     if (type == GAME_EVENT.REFRESH)
     {
         RefreshDashboard();
     }
 }
Exemple #4
0
 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);
             }
         }
     }
 }
Exemple #6
0
    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);
        }
    }
Exemple #7
0
    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)
 {
 }
Exemple #11
0
 public WorldStateData()
 {
     last_game_event          = GAME_EVENT.NON;
     last_customize_date      = DateTime.Now;
     need_first_booster_tutor = false;
 }
Exemple #12
0
 //Constructor, pass the event type (game over, collected object etc.
 public GameboardEventArgs(GAME_EVENT e)
 {
     this.e = e;
 }