Ejemplo n.º 1
0
 private void AddVerticesToBatch(ParticleEmitter emitter)
 {
     particles = emitter.GetInterpolatedArray<Particle>(emitter.NumberOfActiveParticles);
     var length = particles.Length;
     for (int index = 0; index < length; index++)
         AddIndicesAndVerticesForParticle(index);
 }
Ejemplo n.º 2
0
 private void AddZoomingBrick(Sprite brick)
 {
     zoomBrickData.ParticleMaterial = brick.Material;
     zoomBrickData.Size = new RangeGraph<Size>(brick.Size, brick.Size * 2);
     var zoomBrickEmitter = new ParticleEmitter(zoomBrickData, brick.Center);
     zoomBrickEmitter.RenderLayer = 16;
     zoomBrickEmitter.SpawnAndDispose();
 }
Ejemplo n.º 3
0
 private void CreateExplosionEmitter(Vector2D position, float length)
 {
     var explosionEmitter = new ParticleEmitter(explosionData, position) { RenderLayer = 10 };
     explosionEmitter.DisposeAfterSeconds(length);
 }
Ejemplo n.º 4
0
 public void AddEmitterToSystem(ParticleEmitter existingEmitter = null)
 {
     currentEffect.AttachEmitter(existingEmitter ??
         new ParticleEmitter(CreateDefaultEmitterData(), Vector3D.Zero));
     currentEmitterInEffect = currentEffect.AttachedEmitters.Count - 1;
     RefreshAllEffectProperties();
     RaisePropertyChanged("AvailableEmitterIndices");
 }
Ejemplo n.º 5
0
 public void RemoveEmitter(ParticleEmitter emitter)
 {
     AttachedEmitters.Remove(emitter);
 }
Ejemplo n.º 6
0
 public void DisposeEmitter(ParticleEmitter emitter)
 {
     AttachedEmitters.Remove(emitter);
     emitter.Dispose();
 }
Ejemplo n.º 7
0
 public void AttachEmitter(ParticleEmitter emitter)
 {
     AttachedEmitters.Add(emitter);
     emitter.Position = Position;
     emitter.Rotation = Rotation;
 }
Ejemplo n.º 8
0
 public override void Preview(string contentName)
 {
     var particleEmitterData = ContentLoader.Load<ParticleEmitterData>(contentName);
     currentDisplayParticle2D = new ParticleEmitter(particleEmitterData, Vector2D.Half);
 }