예제 #1
0
    public void ReplaceRectGlobals(RectGlobals newValue)
    {
        var index     = GameComponentsLookup.RectGlobals;
        var component = CreateComponent <RectGlobalsComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
예제 #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);
    }
예제 #3
0
    public void ReplaceRectGlobals(RectGlobals newValue)
    {
        var entity = rectGlobalsEntity;

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