Exemple #1
0
        /// /////////////////////////////////////////////////////////
        /// Common
        /// /////////////////////////////////////////////////////////

        // Constructor
        public RayfireDebris()
        {
            onDemolition = false;
            onActivation = false;
            onImpact     = false;

            debrisReference  = null;
            debrisMaterial   = null;
            emissionMaterial = null;

            emission    = new RFParticleEmission();
            dynamic     = new RFParticleDynamicDebris();
            noise       = new RFParticleNoise();
            collision   = new RFParticleCollisionDebris();
            limitations = new RFParticleLimitations();
            rendering   = new RFParticleRendering();

            // Hidden
            debrisMeshList = new List <Mesh>();

            //pSystem = null;
            hostTm      = null;
            initialized = false;
            amountFinal = 0;
        }
 // Copy from
 public void CopyFrom(RFParticleDynamicDebris source)
 {
     speedMin      = source.speedMin;
     speedMax      = source.speedMax;
     velocityMin   = source.velocityMin;
     velocityMax   = source.velocityMax;
     rotationSpeed = source.rotationSpeed;
     gravityMin    = source.gravityMin;
     gravityMax    = source.gravityMax;
 }
        /// /////////////////////////////////////////////////////////
        /// Velocity
        /// /////////////////////////////////////////////////////////

        // Set velocity
        public static void SetVelocity(ParticleSystem.InheritVelocityModule velocity, RFParticleDynamicDebris dynamic)
        {
            if (dynamic.velocityMin > 0 || dynamic.velocityMax > 0)
            {
                velocity.enabled = true;
                velocity.mode    = ParticleSystemInheritVelocityMode.Initial;
                velocity.curve   = new ParticleSystem.MinMaxCurve(dynamic.velocityMin, dynamic.velocityMax);
            }
        }