Exemplo n.º 1
0
    public void ReplaceRectGlobals(RectGlobals newValue)
    {
        var index     = GameComponentsLookup.RectGlobals;
        var component = CreateComponent <RectGlobalsComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Exemplo n.º 2
0
    public GameEntity SetRectGlobals(RectGlobals newValue)
    {
        if (hasRectGlobals)
        {
            throw new Entitas.EntitasException("Could not set RectGlobals!\n" + this + " already has an entity with RectGlobalsComponent!",
                                               "You should check if the context already has a rectGlobalsEntity before setting it or use context.ReplaceRectGlobals().");
        }
        var entity = CreateEntity();

        entity.AddRectGlobals(newValue);
        return(entity);
    }
Exemplo n.º 3
0
    public void ReplaceRectGlobals(RectGlobals newValue)
    {
        var entity = rectGlobalsEntity;

        if (entity == null)
        {
            entity = SetRectGlobals(newValue);
        }
        else
        {
            entity.ReplaceRectGlobals(newValue);
        }
    }