예제 #1
0
    public void ReplaceViewService(src.libs.src.services.core.view.IViewService newInstance)
    {
        var index     = MetaComponentsLookup.ViewService;
        var component = CreateComponent <ViewServiceComponent>(index);

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
예제 #2
0
    public MetaEntity SetViewService(src.libs.src.services.core.view.IViewService newInstance)
    {
        if (hasViewService)
        {
            throw new Entitas.EntitasException("Could not set ViewService!\n" + this + " already has an entity with src.libs.src.components.meta.ViewServiceComponent!",
                                               "You should check if the context already has a viewServiceEntity before setting it or use context.ReplaceViewService().");
        }
        var entity = CreateEntity();

        entity.AddViewService(newInstance);
        return(entity);
    }
예제 #3
0
    public void ReplaceViewService(src.libs.src.services.core.view.IViewService newInstance)
    {
        var entity = viewServiceEntity;

        if (entity == null)
        {
            entity = SetViewService(newInstance);
        }
        else
        {
            entity.ReplaceViewService(newInstance);
        }
    }