private void Inject(JesterEntity jesterEntity, AudioService audioService, ParticleService particleService, UserInputModel userInputModel) { _jesterEntity = jesterEntity; _audioService = audioService; _particleService = particleService; _userInputModel = userInputModel; }
public GameState( GameRoundEntity owner, GameStateModel model, UserInputModel userInputModel, JesterEntity jesterEntity, AudioService audioService, ParticleService particleService) : base(owner) { _model = model; _userInputModel = userInputModel; _jesterEntity = jesterEntity; _audioService = audioService; _particleService = particleService; _audioService.ResetPausedSlots(); _particleService.ResetPausedSlots(); _userInputModel.OnPause .Subscribe(_ => model.IsPaused.Value = !model.IsPaused.Value) .AddTo(owner); _jesterEntity.OnKicked .Subscribe(_ => model.OnRoundStart.Execute()) .AddTo(owner); _jesterEntity.OnLanded .Subscribe(_ => model.OnRoundEnd.Execute()) .AddTo(owner); _model.IsPaused .Subscribe(OnPauseChanged) .AddTo(owner); }
// ToDo Instantiate so that injection can occur public virtual void Setup(AudioService audioService, ParticleService particleService, MainCamera mainCamera) { AudioService = audioService; ParticleService = particleService; Camera = mainCamera; Observable.EveryLateUpdate() .Subscribe(_ => OnLateUpdate()) .AddTo(this); }
private void Inject( JesterEntity jesterEntity, FlightStatsModel flightStatsModel, AudioService audioService, ParticleService particleService, MainCamera mainCamera) { _jesterEntity = jesterEntity; _flightStatsModel = flightStatsModel; _audioService = audioService; _particleService = particleService; _mainCamera = mainCamera; }
public SpriteEffect(JesterEntity owner, JesterSpriteEffectsConfig config, ParticleService particleService) : base(owner) { _config = config; _particleService = particleService; Observable.EveryFixedUpdate() .Where(_ => !IsPaused.Value) .Subscribe(_ => OnUpdate()) .AddTo(owner); owner.OnKicked .Subscribe(_ => OnKicked()) .AddTo(owner); Owner.OnShot .Subscribe(_ => OnShot()) .AddTo(Owner); Owner.Collisions.OnGround .Where(_ => _listenForImpacts) .Subscribe(_ => OnGround()) .AddTo(Owner); Owner.Collisions.OnBoost .Subscribe(_ => OnBoost()) .AddTo(Owner); IsPaused .Subscribe(OnPause) .AddTo(owner); owner.OnLanded .Subscribe(_ => OnLanded()) .AddTo(owner); }