public override void Tick(float dTime) { base.Tick(dTime); Timer += dTime; if ((Attach != null || !KillWhenDetached) && Timer > 0.05f) { for (int i = 0; i < 10; ++i) { Particle p = Smoke.NewParticle(); p.Position = SmoothAbsolutePosition + VecRandom.Instance.NextUnitVector3() * Smoke.PointSize / 4; p.Speed = VecRandom.Instance.NextUnitVector3() * Smoke.PointSize / 4; Smoke.Spawn(p); } Timer = 0; } if (Attach == null && KillWhenDetached) { TimeDetached += dTime; if (TimeDetached > 5) { Kill = true; } } foreach (Particle p in Smoke.Particles) { if (p != null) { if (p.Age > 0.3f) { float a = (p.Age > 0.6f) ? 0 : (1 - (p.Age - 0.3f) * (1.0f / 0.3f)); p.Color = new Color4f(a, a, a, 1); } } } }