protected void UpdateService(T newInstance) { _service = newInstance; GameServiceCollection.SetService(newInstance); _isActive = true; }
protected void RemoveService(bool throwIfNotExists = false) { if (!GameServiceCollection.TryRemoveService <T>() && throwIfNotExists) { throw new System.Exception($"Service \"{nameof(T)}\" is currently not injected"); } _isActive = false; }
protected void InjectService(bool throwIfExists = false) { if (!GameServiceCollection.TryAddService(_service) && throwIfExists) { throw new System.Exception($"Service \"{nameof(T)}\" has already been injected"); } _isActive = true; }
protected void RemoveService() { GameServiceCollection.RemoveService <T>(); _isActive = false; }
protected void InjectService() { GameServiceCollection.AddService(_service); _isActive = true; }
private void Start() { _battle = GameServiceCollection.GetService <BattleService>(); _battle.StartBattle(this); }