/// <summary> /// /// </summary> /// <param name="instance"></param> /// <param name="position"></param> /// <param name="color"></param> /// <param name="radius"></param> /// <param name="fadeInRate"></param> /// <param name="fadeOutRate"></param> public LightStage( SfxInstance instance, Vector3 position, Color4 color, float radius, float fadeInRate, float fadeOutRate ) : base(instance) { if ( fadeInRate < 0 ) { throw new ArgumentOutOfRangeException("fadeInRate < 0"); } if ( fadeOutRate < 0 ) { throw new ArgumentOutOfRangeException("fadeOutRate < 0"); } light = new OmniLight(); light.Position = position; light.RadiusInner = radius * 0.1f; light.RadiusOuter = radius; light.Intensity = Color4.Zero; lightColor = color; lightFadeInRate = fadeInRate; lightFadeOutRate = fadeOutRate; lightIntensity = 0.0001f; lightFadeRate = lightFadeInRate; SfxInstance.rw.LightSet.OmniLights.Add(light); }
/// <summary> /// /// </summary> /// <param name="game"></param> public SfxView( Entity entity, World world, string sfxName ) : base(entity, world) { var fxID = World.GameClient.Atoms[ sfxName ]; var fxEvent = new FXEvent(fxID, entity.ID, entity.Position, entity.LinearVelocity, entity.Rotation); sfx = World.RunFX( fxEvent ); }
/// <summary> /// /// </summary> /// <param name="fxEvent"></param> /// <param name="spriteIndex"></param> /// <param name="delay"></param> /// <param name="period"></param> /// <param name="sleep"></param> /// <param name="count"></param> /// <param name="emit"></param> public ParticleStage( SfxInstance instance, int spriteIndex, float delay, float period, float sleep, int count, bool looped, EmitFunction emit ) : base(instance) { this.looped = false; this.spriteIndex = spriteIndex ; this.delay = delay ; this.period = period ; this.sleep = sleep ; this.count = count ; this.emit = emit ; this.looped = looped; }
/// <summary> /// /// </summary> /// <param name="instance"></param> /// <param name="position"></param> /// <param name="soundPath"></param> public SoundStage( SfxInstance instance, Vector3 position, float radius, string soundPath, bool looped, bool local ) : base(instance) { var sound = instance.sfxSystem.LoadSound( soundPath ); if (sound==null) { return; } emitter = SfxInstance.sw.AllocEmitter(); emitter.Position = position; emitter.DistanceScale = radius; emitter.DopplerScale = 1; emitter.VolumeCurve = null; emitter.LocalSound = local; emitter.PlaySound( sound, looped ? PlayOptions.Looped : PlayOptions.None ); }
/// <summary> /// /// </summary> /// <param name="sfxInstance"></param> public Stage( SfxInstance sfxInstance ) { this.SfxInstance = sfxInstance; }