コード例 #1
0
 private void HandleGameEvents(GAME_EVENT type, System.Object data = null)
 {
     if (type == GAME_EVENT.LEVEL_START)
     {
         OnLevelStart();
     }
 }
コード例 #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;
        }
    }
コード例 #3
0
 private void HandleGameEvents(GAME_EVENT type, System.Object data = null)
 {
     if (type == GAME_EVENT.REFRESH)
     {
         RefreshDashboard();
     }
 }
コード例 #4
0
ファイル: PauseMenu.cs プロジェクト: Originator99/HyperBalls
 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);
     }
 }
コード例 #5
0
 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);
             }
         }
     }
 }
コード例 #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);
        }
    }
コード例 #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();
        }
    }
コード例 #8
0
 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");
         }
     }
 }
コード例 #9
0
 public static void RaiseGameEvent(GAME_EVENT type, System.Object data = null)
 {
     OnGameEventRaised?.Invoke(type, data);
 }
コード例 #10
0
 private void HandleGameEvents(GAME_EVENT type, System.Object data = null)
 {
 }
コード例 #11
0
 public WorldStateData()
 {
     last_game_event          = GAME_EVENT.NON;
     last_customize_date      = DateTime.Now;
     need_first_booster_tutor = false;
 }
コード例 #12
0
 //Constructor, pass the event type (game over, collected object etc.
 public GameboardEventArgs(GAME_EVENT e)
 {
     this.e = e;
 }