public void ReplaceGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance) { var index = ServiceComponentsLookup.GameplayServicesInputInputService; var component = (GameplayServices.Input.InputServiceComponent)CreateComponent(index, typeof(GameplayServices.Input.InputServiceComponent)); component.instance = newInstance; ReplaceComponent(index, component); }
public ServiceEntity SetGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance) { if (hasGameplayServicesInputInputService) { throw new Entitas.EntitasException("Could not set GameplayServicesInputInputService!\n" + this + " already has an entity with GameplayServices.Input.InputServiceComponent!", "You should check if the context already has a gameplayServicesInputInputServiceEntity before setting it or use context.ReplaceGameplayServicesInputInputService()."); } var entity = CreateEntity(); entity.AddGameplayServicesInputInputService(newInstance); return(entity); }
public void ReplaceGameplayServicesInputInputService(GameplayServices.Input.IInputService newInstance) { var entity = gameplayServicesInputInputServiceEntity; if (entity == null) { entity = SetGameplayServicesInputInputService(newInstance); } else { entity.ReplaceGameplayServicesInputInputService(newInstance); } }