internal Waiter(Func<bool> condition, Action<TimeSpan> whileWaiting, Action onValid) { this.condition = condition; this.whileWaiting = whileWaiting; this.onValid = onValid; this.Alive = true; this.EngineState = ServiceHelper.Get<IEngineStateManager>(); this.Camera = ServiceHelper.Get<IDefaultCameraManager>(); }
public GlitchyRespawner(Game game, TrileInstance instance, bool soundEmitter) : base(game) { this.UpdateOrder = -2; this.DrawOrder = 10; this.Instance = instance; this.EmitOrNot = soundEmitter; this.TargetRenderer = ServiceHelper.Get<ITargetRenderingManager>(); this.LightingPostProcess = ServiceHelper.Get<ILightingPostProcess>(); this.LevelMaterializer = ServiceHelper.Get<ILevelMaterializer>(); this.GameState = ServiceHelper.Get<IGameStateManager>(); this.CameraManager = ServiceHelper.Get<IDefaultCameraManager>(); this.LevelManager = ServiceHelper.Get<IGameLevelManager>(); this.CMProvider = ServiceHelper.Get<IContentManagerProvider>(); }
internal SoundEmitter(SoundEffect sound, bool looped, float pitch, float volumeFactor, bool paused, Vector3? position) { this.SM = ServiceHelper.Get<ISoundManager>(); this.EngineState = ServiceHelper.Get<IEngineStateManager>(); this.CameraManager = ServiceHelper.Get<IDefaultCameraManager>(); ILevelManager levelManager = ServiceHelper.Get<ILevelManager>(); this.VolumeLevel = this.SM.GetVolumeLevelFor(sound.Name); this.VolumeMaster = this.EngineState.DotLoading ? 0.0f : 1f; this.FadeDistance = 10f; this.AxisMask = Vector3.One; this.VolumeFactor = volumeFactor; this.position = position; if (SoundManager.NoMoreSounds) return; try { this.Cue = sound.CreateInstance(levelManager.LowPass); this.Pitch = pitch; this.Cue.IsLooped = looped; if (!paused) { this.Cue.Volume = volumeFactor * this.VolumeLevel; this.Cue.Play(); this.Update(); } else { this.Cue.Volume = 0.0f; this.Cue.Play(); this.Cue.Pause(); } } catch (InstancePlayLimitException ex) { Logger.Log("SoundEmitter", LogSeverity.Warning, "Couldn't create sound instance (too many instances)"); } }
public Particle() { this.Camera = ServiceHelper.Get<IDefaultCameraManager>(); }