Beispiel #1
0
    public void OnWin()
    {
        var gea = new TriggerConditionRx.GameStateEventArgs {
            game_event_type = TriggerConditionRx.GameStateEventType.START_GAME,
            label           = (int)TriggerConditionRx.GameStateEventArgs.LABELS.START_GAME.NEW
        };

        MessageBroker.Default.Publish(gea);
    }
Beispiel #2
0
    void SetColor(bool selected, Button v)
    {
        ColorBlock cb = v.colors;

        cb.normalColor      = selected ? Color.cyan : Color.white;
        cb.highlightedColor = selected ? Color.white : Color.cyan;
        v.colors            = cb;

        if (selected)
        {
            MainMenuToggle.Toggle();
            TriggerConditionRx.GameStateEventArgs gea = new TriggerConditionRx.GameStateEventArgs();
            gea.game_event_type = TriggerConditionRx.GameStateEventType.START_GAME;
            gea.label           = (int)TriggerConditionRx.GameStateEventArgs.LABELS.START_GAME.NEW;

            MessageBroker.Default.Publish(gea);
        }
    }
Beispiel #3
0
    public void OnGameEventArgs(TriggerConditionRx.GameStateEventArgs args)
    {
        switch (args.game_event_type)
        {
        case TriggerConditionRx.GameStateEventType.MENU:
            rb.bodyType = RigidbodyType2D.Kinematic;
            break;

        case TriggerConditionRx.GameStateEventType.START_GAME:
            rb.bodyType = RigidbodyType2D.Dynamic;
            break;

        case TriggerConditionRx.GameStateEventType.END_GAME:
            rb.bodyType = RigidbodyType2D.Kinematic;
            break;

        default:
            break;
        }
    }
Beispiel #4
0
    public void OnGameEventArgs(TriggerConditionRx.GameStateEventArgs args)
    {
        Debug.Log("OnGameEvent");

        switch (args.game_event_type)
        {
        case TriggerConditionRx.GameStateEventType.MENU:
            break;

        case TriggerConditionRx.GameStateEventType.START_GAME:
            OnStartGame((TriggerConditionRx.GameStateEventArgs.LABELS.START_GAME)args.label);
            break;

        case TriggerConditionRx.GameStateEventType.END_GAME:

            break;

        default:
            break;
        }
    }