コード例 #1
0
        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));
        }
コード例 #2
0
 public void AddParticleProcessorTo(ParticleEmitterViewModel particleEmitter)
 {
     var velocityProcessor =
         new VelocityParticleProcessor()
         {
             InitialVelocity = particleEmitter.ParticleEmitter.EmissionVelocity,
             FinalVelocity = particleEmitter.ParticleEmitter.EmissionVelocity
         };
     particleEmitter.Children.Add(
         new ParticleProcessorViewModel(velocityProcessor, particleEmitter, this, _removeParticleProcessorCommand));
 }
コード例 #3
0
 public void SetParticleSpawnProcessorTo(ParticleEmitterViewModel particleEmitterViewModel)
 {
     var spawnProcessor = particleEmitterViewModel.ParticleEmitter.SetParticleSpawnProcessor<DefaultParticleSpawnProcessor>();
     particleEmitterViewModel.Children.Add(
         new ParticleSpawnProcessorViewModel(spawnProcessor, particleEmitterViewModel, this, _replaceParticleProcessorCommand));
 }
コード例 #4
0
        public void AddParticleEmitterTo(ParticleEffectViewModel particleEffectViewModel)
        {
            var emitter = ParticleEffect.AddEmitter();
            var emitterViewModel = new ParticleEmitterViewModel("name", this, _setParticleSpawnProcessorCommand,
                _setParticleProcessorCommand, particleEffectViewModel, emitter);

            SetParticleEmitterDefaultValues(emitter, emitterViewModel);

            particleEffectViewModel.Children.Add(emitterViewModel);
        }