Example #1
0
 public ParticleEmitter AddEmitter()
 {
     var particleEmitter = new ParticleEmitter(_particleBodyFactory);
     _particleEmitters.Add(particleEmitter);
     if (OnParticleEmitterSpawned != null)
         OnParticleEmitterSpawned(particleEmitter);
     return particleEmitter;
 }
 public ParticleEmitterViewModel(
     string name, 
     INodeAddedCallback nodeAddCB, 
     ICommand setParticleSpawnProcessor, 
     ICommand setParticleProcessor,
     TreeViewItemViewModel parent,
     ParticleEmitter emitter)
     : base(name, parent, nodeAddCB, emitter)
 {
     SetParticleSpawnProcessor = setParticleSpawnProcessor;
     SetParticleProcessor = setParticleProcessor;
     ParticleEmitter = emitter;
 }
 private void OnParticleEmitterSpawnedHandler(ParticleEmitter emitter)
 {
     emitter.OnParticleSpawned += OnParticleSpawnedHandler;
 }
        private void SetParticleEmitterDefaultValues(ParticleEmitter emitter, ParticleEmitterViewModel emitterViewModel)
        {
            var spawnProcessor = emitter.SetParticleSpawnProcessor<DefaultParticleSpawnProcessor>();
            var velocityProcessor =
                new VelocityParticleProcessor()
                {
                    InitialVelocity = emitter.EmissionVelocity,
                    FinalVelocity = emitter.EmissionVelocity
                };
            var directionProcessor =
                new DirectionParticleProcessor()
                {
                    InitialDirection = emitter.EmissionDirection,
                    FinalDirection = emitter.EmissionDirection
                };

            emitter.ParticleProcessors.Add(velocityProcessor);
            emitter.ParticleProcessors.Add(directionProcessor);

            emitterViewModel.Children.Add(
                new ParticleSpawnProcessorViewModel(spawnProcessor, emitterViewModel, this, _replaceParticleProcessorCommand));
            emitterViewModel.Children.Add(
                new ParticleProcessorViewModel(velocityProcessor, emitterViewModel, this, _removeParticleProcessorCommand));
            emitterViewModel.Children.Add(
                new ParticleProcessorViewModel(directionProcessor, emitterViewModel, this, _removeParticleProcessorCommand));
        }
 public void ReplaceParticleProcessorFromEmitter(ParticleEmitter particleEmitter, Type spawnProcessorType)
 {
 }
 public void RemoveParticleProcessorFromEmitter(ParticleProcessorViewModel particleProcessor, ParticleEmitter particleEmitter)
 {
 }
 private void OnCreatedHandler()
 {
     ParticleEmitter = new ParticleEmitter(Scene.PhysicalWorld);
     ParticleEmitter.OnParticleSpawned += OnParticleSpawnedHandler;
 }