Пример #1
0
        //------------------------------------------------------------------
        protected void Explose(Car killer)
        {
            if (Lane.Road.Fluid == null)
            {
                return;
            }

            Emitter emitter = Lane.Road.Fluid?.Emitter;

            // Impulse
            Vector2 impulse = Position - killer.Position;
            Vector2 scale   = new Vector2(1.5f, 0);

            System.Action addImpulse = () => emitter.AddImpulse((impulse), Position + impulse * scale);
            addImpulse();
            killer.driver.AddInSequnce(new Repeated(addImpulse, 10));

            // Particle
            System.Action addParticle = () => emitter.AddParticle(Texture, Position - origin + impulse * scale);
            addParticle();

            Destroy();
        }