public void ReplaceInputActionService(src.libs.src.services.core.inputaction.IInputActionService newInstance) { var index = MetaComponentsLookup.InputActionService; var component = CreateComponent <InputActionServiceComponent>(index); component.instance = newInstance; ReplaceComponent(index, component); }
public MetaEntity SetInputActionService(src.libs.src.services.core.inputaction.IInputActionService newInstance) { if (hasInputActionService) { throw new Entitas.EntitasException("Could not set InputActionService!\n" + this + " already has an entity with ecscore.src.contexts.meta.services.components.InputActionServiceComponent!", "You should check if the context already has a inputActionServiceEntity before setting it or use context.ReplaceInputActionService()."); } var entity = CreateEntity(); entity.AddInputActionService(newInstance); return(entity); }
public void ReplaceInputActionService(src.libs.src.services.core.inputaction.IInputActionService newInstance) { var entity = inputActionServiceEntity; if (entity == null) { entity = SetInputActionService(newInstance); } else { entity.ReplaceInputActionService(newInstance); } }