示例#1
0
    public void ReplaceSelectionService(src.libs.src.services.core.selection.ISelectionService newSelection)
    {
        var index     = MetaComponentsLookup.SelectionService;
        var component = CreateComponent <SelectionServiceComponent>(index);

        component.selection = newSelection;
        ReplaceComponent(index, component);
    }
示例#2
0
    public MetaEntity SetSelectionService(src.libs.src.services.core.selection.ISelectionService newSelection)
    {
        if (hasSelectionService)
        {
            throw new Entitas.EntitasException("Could not set SelectionService!\n" + this + " already has an entity with src.libs.src.components.meta.SelectionServiceComponent!",
                                               "You should check if the context already has a selectionServiceEntity before setting it or use context.ReplaceSelectionService().");
        }
        var entity = CreateEntity();

        entity.AddSelectionService(newSelection);
        return(entity);
    }
示例#3
0
    public void ReplaceSelectionService(src.libs.src.services.core.selection.ISelectionService newSelection)
    {
        var entity = selectionServiceEntity;

        if (entity == null)
        {
            entity = SetSelectionService(newSelection);
        }
        else
        {
            entity.ReplaceSelectionService(newSelection);
        }
    }