public void InitializeSmoke(Vector3 position)
        {
            ParticleView  smokeInstance;
            ParticleModel particleModel = new ParticleModel();

            smokeInstance = GameObject.Instantiate <ParticleView>(particlePrefab);
            smokeInstance.transform.position = position + new Vector3(0f, 2.0f, 0f);
            ParticleController particleController = new ParticleController(smokeInstance, particleModel);
        }
Exemple #2
0
        //Ctor
        public ParticleGroup(string name, BlendState blend, DepthStencilState depthStencil, BasicEffect basicEffect)
        {
            this.name         = name;
            particles         = new List <Particle>();
            effect            = basicEffect;
            blendState        = blend;
            this.depthStencil = depthStencil;
            EmitTimer         = 0;
            controller        = new ParticleController();

            effect.TextureEnabled = true;
        }
Exemple #3
0
        //Make a Deep Copy of the ParticleController.
        public ParticleController Clone()
        {
            ParticleController newCtrl = new ParticleController();

            newCtrl = (ParticleController)this.MemberwiseClone();

            newCtrl.lifeSpan              = this.lifeSpan;
            newCtrl.directionOffset       = new Vector3(this.directionOffset.X, this.directionOffset.Y, this.directionOffset.Z);
            newCtrl.directionRange        = new Vector3(this.directionRange.X, this.directionRange.Y, this.directionRange.Z);
            newCtrl.InitialPositionOffset = new Vector3(this.InitialPositionOffset.X, this.InitialPositionOffset.Y, this.InitialPositionOffset.Z);
            newCtrl.Velocity              = new Vector3(this.Velocity.X, this.Velocity.Y, this.Velocity.Z);

            return(newCtrl);
        }
        //Make a Deep Copy of the ParticleController.
        public ParticleController Clone()
        {
            ParticleController newCtrl = new ParticleController();

            newCtrl = (ParticleController)this.MemberwiseClone();

            newCtrl.lifeSpan = this.lifeSpan;
            newCtrl.directionOffset = new Vector3(this.directionOffset.X, this.directionOffset.Y, this.directionOffset.Z);
            newCtrl.directionRange = new Vector3(this.directionRange.X, this.directionRange.Y, this.directionRange.Z);
            newCtrl.InitialPositionOffset = new Vector3(this.InitialPositionOffset.X, this.InitialPositionOffset.Y, this.InitialPositionOffset.Z);
            newCtrl.Velocity = new Vector3(this.Velocity.X, this.Velocity.Y, this.Velocity.Z);

            return newCtrl;
        }
Exemple #5
0
 public void ControllerChannelInitialisation(ParticleController particleController)
 {
     this.particleController = particleController;
 }