Exemplo n.º 1
0
        // Create single debris particle system
        public static void CreateDustImpact(RayfireDust dust, Vector3 impactPos, Vector3 impactNormal)
        {
            // Particle system
            ParticleSystem ps = dust.CreateParticleSystem(dust);

            // Align over impact
            dust.hostTm.position = impactPos;
            dust.hostTm.LookAt(impactPos + impactNormal);

            // Set amount
            dust.amountFinal = dust.emission.burstAmount;

            // Create debris
            dust.CreateDust(dust.rigid.transForm, dust, null, -1, ps);
        }
Exemplo n.º 2
0
        // Create single dust particle system
        public static void CreateDustRigid(RayfireDust target)
        {
            // No particles
            if (target.amountFinal < target.limitations.minParticles && target.emission.distanceRate == 0)
            {
                return;
            }

            // Particle system
            ParticleSystem ps = target.CreateParticleSystem(target);

            // Get emit material index
            int emitMatIndex = GetEmissionMatIndex(target.rigid.meshRenderer, target.emissionMaterial);

            // Create debris
            target.CreateDust(target.rigid.transForm, target, target.rigid.meshFilter, emitMatIndex, ps);
        }