// Update is called once per frame
    void Update()
    {
        if (Particules == null)
        {
            Setup();
        }

        if (startSize != oldStartSize)
        {
            ModuleMain.startSize = startSize;
            oldStartSize         = startSize;
        }

        if (RateOverTIme != oldRateOverTime)
        {
            ModuleEmission.rateOverTime = RateOverTIme;
            oldRateOverTime             = RateOverTIme;
        }


        if (Couleur1 != oldColor1 || Couleur2 != oldColor2)
        {
            ParticleSystem.MinMaxGradient minMaxGradient = new ParticleSystem.MinMaxGradient(Couleur1, Couleur2);
            ModuleMain.startColor = minMaxGradient;
            oldColor1             = Couleur1;
            oldColor2             = Couleur2;
        }

        if (MeshShapeType != OldMeshShapeType)
        {
            OldMeshShapeType          = MeshShapeType;
            ModuleShape.meshShapeType = MeshShapeType;
        }
        if (oldWindZoneMultiplier != WindZoneMultiplier)
        {
            ModuleExternalForce.multiplier = WindZoneMultiplier;
            oldWindZoneMultiplier          = WindZoneMultiplier;
        }

        if (oldLimiteMax != LimitMax)
        {
            oldLimiteMax            = LimitMax;
            ModuleMain.maxParticles = LimitMax;
            //Setup();
        }

        if (oldstartLifetime != startLifetime)
        {
            ParticleSystem.MinMaxCurve minMax = new ParticleSystem.MinMaxCurve(startLifetime.x, startLifetime.y);
            ModuleMain.startLifetime = minMax;
            oldstartLifetime         = startLifetime;
        }
    }
 protected override void ReadFromImpl(object obj)
 {
     base.ReadFromImpl(obj);
     ParticleSystem.ShapeModule uo = (ParticleSystem.ShapeModule)obj;
     enabled                  = uo.enabled;
     shapeType                = uo.shapeType;
     randomDirectionAmount    = uo.randomDirectionAmount;
     sphericalDirectionAmount = uo.sphericalDirectionAmount;
     randomPositionAmount     = uo.randomPositionAmount;
     alignToDirection         = uo.alignToDirection;
     radius                = uo.radius;
     radiusMode            = uo.radiusMode;
     radiusSpread          = uo.radiusSpread;
     radiusSpeed           = uo.radiusSpeed;
     radiusSpeedMultiplier = uo.radiusSpeedMultiplier;
     radiusThickness       = uo.radiusThickness;
     angle                = uo.angle;
     length               = uo.length;
     boxThickness         = uo.boxThickness;
     meshShapeType        = uo.meshShapeType;
     mesh                 = ToID(uo.mesh);
     meshRenderer         = ToID(uo.meshRenderer);
     skinnedMeshRenderer  = ToID(uo.skinnedMeshRenderer);
     sprite               = ToID(uo.sprite);
     spriteRenderer       = ToID(uo.spriteRenderer);
     useMeshMaterialIndex = uo.useMeshMaterialIndex;
     meshMaterialIndex    = uo.meshMaterialIndex;
     useMeshColors        = uo.useMeshColors;
     normalOffset         = uo.normalOffset;
     arc                          = uo.arc;
     arcMode                      = uo.arcMode;
     arcSpread                    = uo.arcSpread;
     arcSpeed                     = uo.arcSpeed;
     arcSpeedMultiplier           = uo.arcSpeedMultiplier;
     donutRadius                  = uo.donutRadius;
     position                     = uo.position;
     rotation                     = uo.rotation;
     scale                        = uo.scale;
     texture                      = ToID(uo.texture);
     textureClipChannel           = uo.textureClipChannel;
     textureClipThreshold         = uo.textureClipThreshold;
     textureColorAffectsParticles = uo.textureColorAffectsParticles;
     textureAlphaAffectsParticles = uo.textureAlphaAffectsParticles;
     textureBilinearFiltering     = uo.textureBilinearFiltering;
     textureUVChannel             = uo.textureUVChannel;
     meshSpawnMode                = uo.meshSpawnMode;
     meshSpawnSpread              = uo.meshSpawnSpread;
     meshSpawnSpeed               = uo.meshSpawnSpeed;
     meshSpawnSpeedMultiplier     = uo.meshSpawnSpeedMultiplier;
 }