Пример #1
0
    public void ReplaceInputService(src.libs.src.services.core.input.service.IInputService newService)
    {
        var index     = MetaComponentsLookup.InputService;
        var component = CreateComponent <InputServiceComponent>(index);

        component.service = newService;
        ReplaceComponent(index, component);
    }
Пример #2
0
    public MetaEntity SetInputService(src.libs.src.services.core.input.service.IInputService newService)
    {
        if (hasInputService)
        {
            throw new Entitas.EntitasException("Could not set InputService!\n" + this + " already has an entity with src.libs.src.components.meta.InputServiceComponent!",
                                               "You should check if the context already has a inputServiceEntity before setting it or use context.ReplaceInputService().");
        }
        var entity = CreateEntity();

        entity.AddInputService(newService);
        return(entity);
    }
Пример #3
0
    public void ReplaceInputService(src.libs.src.services.core.input.service.IInputService newService)
    {
        var entity = inputServiceEntity;

        if (entity == null)
        {
            entity = SetInputService(newService);
        }
        else
        {
            entity.ReplaceInputService(newService);
        }
    }