2 using System.Collections.Generic;
3 using System.Collections.Specialized;
4 using System.Diagnostics;
7 using SiliconStudio.Paradox;
8 using SiliconStudio.Paradox.Effects;
9 using SiliconStudio.Paradox.Effects.Modules;
10 using SiliconStudio.Paradox.Engine;
11 using SiliconStudio.Paradox.EntityModel;
12 using SiliconStudio.Paradox.Games;
13 using SiliconStudio.Core;
14 using SiliconStudio.Core.Collections;
15 using SiliconStudio.Core.Mathematics;
17 namespace ScriptShader.Effects
36 private List<ParticleUpdater> updaters;
40 : base(new
PropertyKey[] { ParticleEmitterComponent.Key, TransformationComponent.Key })
42 this.particlePlugin = particlePlugin;
43 updaters =
new List<ParticleUpdater>();
51 Emitter = entity.Get(ParticleEmitterComponent.Key),
53 Mesh = entity.Get(MeshComponent.Key),
59 data.Emitter.OnAddToSystem(Services);
61 if (data.
Mesh != null)
63 throw new NotImplementedException();
72 particlePlugin.Updaters.Add(data.Emitter);
77 if (data.
Mesh != null)
79 throw new NotImplementedException();
85 particlePlugin.Updaters.Remove(data.Emitter);
86 updaters.Remove(data);
91 throw new NotImplementedException();
99 foreach (var matchingEntity
in enabledEntities)
101 var entity = matchingEntity.Key;
102 var name = entity.Name;
103 var particleEmitterComponent = matchingEntity.Value.Emitter;
104 var transformationComponent = matchingEntity.Value.Transform;
106 particleEmitterComponent.Parameters.Set(TransformationKeys.World, transformationComponent.WorldMatrix);
109 particleEmitterComponent.OnUpdateSystem();
Game entity. It usually aggregates multiple EntityComponent
override ParticleUpdater GenerateAssociatedData(Entity entity)
ParticleEmitterComponent Emitter
TransformationComponent Transformation
Gets or sets the Transformation associated to this entity. Added for convenience over usual Get/Set m...
Entity processor, triggered on various EntitySystem events such as Entity and Component additions and...
TransformationComponent Transform
override void OnEntityAdded(Entity entity, ParticleUpdater data)
override void OnEntityRemoved(Entity entity, ParticleUpdater data)
ParticleProcessor(ParticlePlugin particlePlugin)
A class that represents a tag propety.