Example #1
0
    public void ReplaceViewViewService(View.IViewService newInstance)
    {
        var index     = ServiceComponentsLookup.ViewViewService;
        var component = (View.ViewServiceComponent)CreateComponent(index, typeof(View.ViewServiceComponent));

        component.instance = newInstance;
        ReplaceComponent(index, component);
    }
Example #2
0
    public ServiceEntity SetViewViewService(View.IViewService newInstance)
    {
        if (hasViewViewService)
        {
            throw new Entitas.EntitasException("Could not set ViewViewService!\n" + this + " already has an entity with View.ViewServiceComponent!",
                                               "You should check if the context already has a viewViewServiceEntity before setting it or use context.ReplaceViewViewService().");
        }
        var entity = CreateEntity();

        entity.AddViewViewService(newInstance);
        return(entity);
    }
Example #3
0
    public void ReplaceViewViewService(View.IViewService newInstance)
    {
        var entity = viewViewServiceEntity;

        if (entity == null)
        {
            entity = SetViewViewService(newInstance);
        }
        else
        {
            entity.ReplaceViewViewService(newInstance);
        }
    }