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); }
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); }
public void ReplaceViewViewService(View.IViewService newInstance) { var entity = viewViewServiceEntity; if (entity == null) { entity = SetViewViewService(newInstance); } else { entity.ReplaceViewViewService(newInstance); } }