Ejemplo n.º 1
0
    public void ReplaceGameMode(Features.Config.GameMode newValue)
    {
        var index     = GameComponentsLookup.GameMode;
        var component = (Features.Components.GameModeComponent)CreateComponent(index, typeof(Features.Components.GameModeComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Ejemplo n.º 2
0
    public GameEntity SetGameMode(Features.Config.GameMode newValue)
    {
        if (hasGameMode)
        {
            throw new Entitas.EntitasException("Could not set GameMode!\n" + this + " already has an entity with Features.Components.GameModeComponent!",
                                               "You should check if the context already has a gameModeEntity before setting it or use context.ReplaceGameMode().");
        }
        var entity = CreateEntity();

        entity.AddGameMode(newValue);
        return(entity);
    }
Ejemplo n.º 3
0
    public void ReplaceGameMode(Features.Config.GameMode newValue)
    {
        var entity = gameModeEntity;

        if (entity == null)
        {
            entity = SetGameMode(newValue);
        }
        else
        {
            entity.ReplaceGameMode(newValue);
        }
    }