public void RemoveFromScene() { if (inScene) { if (displayParticle != null) { displayParticle.Dispose(); displayParticle = null; } } inScene = false; }
public void AddToScene() { if (app.DisplayParticleEffects && !inScene) { if (attachmentPointName != null) { DisplayObject parentObj = (parent as StaticObject).DisplayObject; displayParticle = new DisplayParticleSystem(particleEffectName, app.Scene, particleEffectName, velocityScale, particleScale, parentObj, attachmentPointName); displayParticle.Orientation = this.Orientation; } else { Vector3 scale = new Vector3(1, 1, 1); Vector3 rotation = Vector3.Zero; displayParticle = new DisplayParticleSystem(particleEffectName, app.Scene, particleEffectName, ParentPosition, scale, rotation, velocityScale, particleScale); displayParticle.Orientation = this.Orientation; } inScene = true; // displayParticle.Highlight = Highlight; } }