/// <summary> /// Initializes a new instance of the <see cref="RabbitEmiterBehavior" /> class. /// </summary> /// <param name="rabbits">The rabbits.</param> public RabbitEmiterBehavior(List <Rabbit> rabbits) { this.rabbits = rabbits; this.deadRabbits = new List <Rabbit>(); // Explosion this.explosion = new Entity("explosion") .AddComponent(new Transform2D()) .AddComponent(ParticleFactory.CreateExplosion()) .AddComponent(new Material2D(new BasicMaterial2D(Directories.TexturePath + "starParticle.wpk", DefaultLayers.Additive))) .AddComponent(new ParticleSystemRenderer2D("explosion")); // Cached this.explosionSystem = this.explosion.FindComponent <ParticleSystem2D>(); this.explosionTransform = this.explosion.FindComponent <Transform2D>(); }