Beispiel #1
0
    private void ChangeGameState(GameLogicStatics.GameStates gameState)
    {
        _State = gameState;

        if (GameStateChanged != null)
        {
            GameStateChanged(this, _State);
        }
    }
Beispiel #2
0
    private void GameLogic_GameStateChanged(object sender, GameLogicStatics.GameStates gameState)
    {
        if (gameState == GameLogicStatics.GameStates.ReadyToStart)
        {
            triggerEnabled = true;
            flickerLights.SetState(true);

            foreach (var ps in particleSystems)
            {
                ps.Play(true);
            }
        }
        else if (gameState == GameLogicStatics.GameStates.WaitForPlayers)
        {
            triggerEnabled = false;
            flickerLights.SetState(false, true);

            foreach (var ps in particleSystems)
            {
                ps.Stop();
            }
        }
    }