Ejemplo n.º 1
0
 public ExploderParams(ExploderObject exploder)
 {
     Position                    = ExploderUtils.GetCentroid(exploder.gameObject);
     DontUseTag                  = exploder.DontUseTag;
     Radius                      = exploder.Radius;
     UseCubeRadius               = exploder.UseCubeRadius;
     CubeRadius                  = exploder.CubeRadius;
     ForceVector                 = exploder.ForceVector;
     UseForceVector              = exploder.UseForceVector;
     Force                       = exploder.Force;
     FrameBudget                 = exploder.FrameBudget;
     TargetFragments             = exploder.TargetFragments;
     ExplodeSelf                 = exploder.ExplodeSelf;
     HideSelf                    = exploder.HideSelf;
     ThreadOptions               = exploder.ThreadOption;
     DestroyOriginalObject       = exploder.DestroyOriginalObject;
     SplitMeshIslands            = exploder.SplitMeshIslands;
     FragmentOptions             = exploder.FragmentOptions.Clone();
     FragmentDeactivation        = exploder.FragmentDeactivation.Clone();
     FragmentSFX                 = exploder.FragmentSFX.Clone();
     Use2DCollision              = exploder.Use2DCollision;
     FragmentPoolSize            = exploder.FragmentPoolSize;
     DisableRadiusScan           = exploder.DisableRadiusScan;
     UniformFragmentDistribution = exploder.UniformFragmentDistribution;
     DisableTriangulation        = exploder.DisableTriangulation;
     ExploderGameObject          = exploder.gameObject;
     CuttingStyle                = exploder.CuttingStyle;
 }
Ejemplo n.º 2
0
 public void InitSFX(FragmentSFX sfx)
 {
     if (Object.op_Implicit((Object)sfx.FragmentEmitter))
     {
         if (!Object.op_Implicit((Object)this.particleChild))
         {
             GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)sfx.FragmentEmitter);
             if (Object.op_Implicit((Object)gameObject))
             {
                 gameObject.get_transform().set_position(Vector3.get_zero());
                 this.particleChild = new GameObject("Particles");
                 this.particleChild.get_transform().set_parent(((Component)this).get_gameObject().get_transform());
                 gameObject.get_transform().set_parent(this.particleChild.get_transform());
             }
         }
         if (Object.op_Implicit((Object)this.particleChild))
         {
             this.particleSystems = (ParticleSystem[])this.particleChild.GetComponentsInChildren <ParticleSystem>();
         }
         this.emmitersTimeout   = sfx.ParticleTimeout;
         this.stopEmitOnTimeout = (double)this.emmitersTimeout > 0.0;
     }
     else
     {
         if (!Object.op_Implicit((Object)this.particleChild))
         {
             return;
         }
         Object.Destroy((Object)this.particleChild);
         sfx.ParticleTimeout    = -1f;
         this.stopEmitOnTimeout = false;
     }
 }
Ejemplo n.º 3
0
 public ExploderParams(ExploderObject exploder)
 {
     this.Position                    = ExploderUtils.GetCentroid(((Component)exploder).get_gameObject());
     this.DontUseTag                  = exploder.DontUseTag;
     this.Radius                      = exploder.Radius;
     this.UseCubeRadius               = exploder.UseCubeRadius;
     this.CubeRadius                  = exploder.CubeRadius;
     this.ForceVector                 = exploder.ForceVector;
     this.UseForceVector              = exploder.UseForceVector;
     this.Force                       = exploder.Force;
     this.FrameBudget                 = exploder.FrameBudget;
     this.TargetFragments             = exploder.TargetFragments;
     this.ExplodeSelf                 = exploder.ExplodeSelf;
     this.HideSelf                    = exploder.HideSelf;
     this.ThreadOptions               = exploder.ThreadOption;
     this.DestroyOriginalObject       = exploder.DestroyOriginalObject;
     this.SplitMeshIslands            = exploder.SplitMeshIslands;
     this.FragmentOptions             = exploder.FragmentOptions.Clone();
     this.FragmentDeactivation        = exploder.FragmentDeactivation.Clone();
     this.FragmentSFX                 = exploder.FragmentSFX.Clone();
     this.Use2DCollision              = exploder.Use2DCollision;
     this.FragmentPoolSize            = exploder.FragmentPoolSize;
     this.DisableRadiusScan           = exploder.DisableRadiusScan;
     this.UniformFragmentDistribution = exploder.UniformFragmentDistribution;
     this.DisableTriangulation        = exploder.DisableTriangulation;
     this.ExploderGameObject          = ((Component)exploder).get_gameObject();
     this.CuttingStyle                = exploder.CuttingStyle;
 }
Ejemplo n.º 4
0
        public void SetSFXOptions(FragmentSFX sfx)
        {
            if (this.pool == null)
            {
                return;
            }
            int num = 0;

            foreach (Fragment fragment in this.pool)
            {
                if (!fragment.IsActive && num++ <= sfx.EmitersMax)
                {
                    fragment.InitSFX(sfx);
                }
            }
        }
Ejemplo n.º 5
0
        public void SetSFXOptions(FragmentSFX sfx)
        {
            if (pool != null)
            {
                int counter = 0;

                foreach (var fragment in pool)
                {
                    if (!fragment.IsActive)
                    {
                        if (counter++ <= sfx.EmitersMax)
                        {
                            fragment.InitSFX(sfx);
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public void InitSFX(FragmentSFX sfx)
        {
            if (sfx.FragmentEmitter)
            {
                if (!particleChild)
                {
                    var dup = Instantiate(sfx.FragmentEmitter) as GameObject;

                    if (dup)
                    {
                        dup.transform.position         = Vector3.zero;
                        particleChild                  = new GameObject("Particles");
                        particleChild.transform.parent = gameObject.transform;

                        dup.transform.parent = particleChild.transform;
                    }
                }

                if (particleChild)
                {
                    particleSystems = particleChild.GetComponentsInChildren <ParticleSystem>();
                }

                emmitersTimeout   = sfx.ParticleTimeout;
                stopEmitOnTimeout = emmitersTimeout > 0.0f;
            }
            else
            {
                if (particleChild)
                {
                    Destroy(particleChild);
                    sfx.ParticleTimeout = -1.0f;
                    stopEmitOnTimeout   = false;
                }
            }
        }