private void AddVerticesToBatch(ParticleEmitter emitter) { particles = emitter.GetInterpolatedArray<Particle>(emitter.NumberOfActiveParticles); var length = particles.Length; for (int index = 0; index < length; index++) AddIndicesAndVerticesForParticle(index); }
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(); }
private void CreateExplosionEmitter(Vector2D position, float length) { var explosionEmitter = new ParticleEmitter(explosionData, position) { RenderLayer = 10 }; explosionEmitter.DisposeAfterSeconds(length); }
public void AddEmitterToSystem(ParticleEmitter existingEmitter = null) { currentEffect.AttachEmitter(existingEmitter ?? new ParticleEmitter(CreateDefaultEmitterData(), Vector3D.Zero)); currentEmitterInEffect = currentEffect.AttachedEmitters.Count - 1; RefreshAllEffectProperties(); RaisePropertyChanged("AvailableEmitterIndices"); }
public void RemoveEmitter(ParticleEmitter emitter) { AttachedEmitters.Remove(emitter); }
public void DisposeEmitter(ParticleEmitter emitter) { AttachedEmitters.Remove(emitter); emitter.Dispose(); }
public void AttachEmitter(ParticleEmitter emitter) { AttachedEmitters.Add(emitter); emitter.Position = Position; emitter.Rotation = Rotation; }
public override void Preview(string contentName) { var particleEmitterData = ContentLoader.Load<ParticleEmitterData>(contentName); currentDisplayParticle2D = new ParticleEmitter(particleEmitterData, Vector2D.Half); }