public override void CleanUp()
        {
            base.CleanUp();

            Misc.TaskScheduler.RemoveTask(fireParticleTask);
            fireParticleTask = null;
        }
Esempio n. 2
0
        public Chimney(Vector2 position) : base(position)
        {
            //
            // Create object that will instantiate smoke particles every 30 milliseconds.
            //

            var random = new Random();

            smokeParticleTask = Misc.TaskScheduler.AddTask(() =>
            {
                var smoke = new Smoke(transform.position + new Vector2(3 + (float)random.NextDouble() + 0.5f, -1));
                smoke.SetRadius(0.95f, 1.95f);
                //smoke.SetRadiusDecreaseSpeed(0.1f);
                ParticleManager.AddParticle(smoke);
            }, 0.130, -1, this.id);
        }
        public FirePit(Vector2 position) : base(position)
        {
            particleNumber = 1;

            var random = new Random();

            //
            // Create object that will instantiate smoke particles every 30 milliseconds.
            //

            fireParticleTask = Misc.TaskScheduler.AddTask(() =>
            {
                for (int i = 0; i < particleNumber; i += 1)
                {
                    var smoke = new Smoke(transform.position + new Vector2(4 + random.Next(2) - 1, 3 + random.Next(2) - 1));
                    smoke.SetColor(Misc.util.Choose <byte>(7, 9));
                    ParticleManager.AddParticle(smoke);
                }
            }, 0.04, -1, this.id);
        }