Beispiel #1
0
    private void Awake()
    {
        // initialize events:

        if (GameWinEvent == null)
        {
            GameWinEvent = new GameWinEvent();
        }

        if (GameLoseEvent == null)
        {
            GameLoseEvent = new GameLoseEvent();
        }

        if (PauseEvent == null)
        {
            PauseEvent = new PauseEvent();
        }

        if (UnPauseEvent == null)
        {
            UnPauseEvent = new UnPauseEvent();
        }

        if (BoostEvent == null)
        {
            BoostEvent = new BoostEvent();
        }

        if (ShieldEvent == null)
        {
            ShieldEvent = new ShieldEvent();
        }

        if (KnockedOffCarEvent == null)
        {
            KnockedOffCarEvent = new KnockedOffCarEvent();
        }

        if (DeterminedClosestCarEvent == null)
        {
            DeterminedClosestCarEvent = new DeterminedClosestCarEvent();
        }
    }
Beispiel #2
0
    public void HandleGenericEvent(string p_eventname)
    {
        switch (p_eventname)
        {
        case "PAUSE":
            GameState.PauseGame();
            PauseEvent?.Invoke();
            break;

        case "UNPAUSE":
            GameState.UnpauseGame();
            UnPauseEvent?.Invoke();
            break;

        default:
            break;
        }

        //Set time scale
        Time.timeScale = GameState.TimeScale;
    }
Beispiel #3
0
 public void DisablePauseCanvas(UnPauseEvent pause)
 {
     _pauseCanvas.enabled = false;
 }