"use strict";(self.webpackChunkluna=self.webpackChunkluna||[]).push([[7],{54:(t,e,i)=>{var s=i(0);class r{constructor(){this._seed=1,this._initialSeed=this._seed,TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"Random")}randomizeSeed(){const t=FORCE_STABLE_RANDOM_SEED?1:Math.floor(Math.random()*Math.floor(2147483647));this.setSeed(t)}reset(){this._seed=this._initialSeed}setSeed(t){0===t&&(t=1),this._seed=t,this._initialSeed=this._seed}nextInteger(){return this._seed=16807*this._seed%2147483647}nextFloat(){return this.nextInteger()/2147483647}nextGFloat(){return(this.nextFloat()+this.nextFloat()+this.nextFloat()+this.nextFloat()+this.nextFloat()+this.nextFloat())/6}get initialSeed(){return this._initialSeed}set initialSeed(t){this._initialSeed=t}get seed(){return this._seed}set seed(t){this._seed=t}}var a=i(21),n=i(35);const l=new a.a,o=new a.a,h=0,c=1,u=2,_=3,d=4;class p{constructor(t,e){this._evaluateInplace=this._evaluateColorInplace,t instanceof a.a&&e instanceof a.a?this.init(t,e,new n.a(null,null,null),new n.a(null,null,null),u):t instanceof n.a&&e instanceof n.a?this.init(new a.a,new a.a,t,e,_):t instanceof a.a?this.init(new a.a,t,new n.a(null,null,null),new n.a(null,null,null),h):t instanceof n.a?this.init(new a.a,new a.a,new n.a(null,null,null),t,c):this.init(new a.a,new a.a,new n.a(null,null,null),new n.a(null,null,null),h),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"MinMaxGradient")}init(t,e,i,s,r){return this._colorMax=e,this._colorMin=t,this._gradientMax=s,this._gradientMin=i,this._mode=r,this.applyMode(),this}evaluate(t){const e=new a.a(1,1,1,1);return this._evaluateInplace(e,t,0),e}applyMode(){switch(this._mode){case h:this._evaluateInplace=this._evaluateColorInplace;break;case c:this._evaluateInplace=this._evaluateGradientInplace;break;case u:this._evaluateInplace=this._evaluateTwoColorsInplace;break;case _:this._evaluateInplace=this._evaluateTwoGradientsInplace;break;case d:this._evaluateInplace=this._evaluateGradientRandomInplace}}_evaluateColorInplace(t,e,i){t.copy(this._colorMax)}_evaluateGradientInplace(t,e,i){this.gradient.sampleInplace(e,t)}_evaluateGradientRandomInplace(t,e,i){this.gradient.sampleInplace(i,t)}_evaluateTwoGradientsInplace(t,e,i){this.gradientMin.sampleInplace(e,l),this.gradientMax.sampleInplace(e,o),t.copy(l).lerpTo(o,i)}_evaluateTwoColorsInplace(t,e,i){t.copy(this.colorMin).lerpTo(this._colorMax,i)}get mode(){return this._mode}set mode(t){this._mode=t,this.applyMode()}get isRandom(){return this._mode===u||this._mode===_||this._mode===d}get color(){return this._colorMax}set color(t){this._colorMax=t}get colorMin(){return this._colorMin}set colorMin(t){this._colorMin=t}get colorMax(){return this._colorMax}set colorMax(t){this._colorMax=t}get gradient(){return this._gradientMax}set gradient(t){this._gradientMax=t}get gradientMax(){return this._gradientMax}set gradientMax(t){this._gradientMax=t}get gradientMin(){return this._gradientMin}set gradientMin(t){this._gradientMin=t}get evaluateInplace(){return this._evaluateInplace}get internalMode(){return this._mode}set internalMode(t){switch(this.mode=t,t){case h:case u:break;case c:this._gradientMax=this._gradientMax||new n.a(null,null,null);break;case _:this._gradientMax=this._gradientMax||new n.a(null,null,null),this._gradientMin=this._gradientMin||new n.a(null,null,null)}}get internalGradientMax(){return this._gradientMax=this._gradientMax||new n.a(null,null,null),this._gradientMax}set internalGradientMax(t){this._gradientMax=t}get internalGradientMin(){return this._gradientMin=this._gradientMin||new n.a(null,null,null),this._gradientMin}set internalGradientMin(t){this._gradientMin=t}}var m=i(1);const y=new s.d,S=new r;class g{constructor(t){this._ps=t,this._enabled=!1,this._range=new s.l,this._color=new p(null,null),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ColorBySpeed")}processInplace(t){if(this.range.x>this.range.y){const t=this.range.x;this.range.x=this.range.y,this.range.y=t}const e=t.aliveCount,i=t.color,s=t.animatedVelocity,r=t.velocity,a=t.seed;let n=0,l=0,o=0,h=0,c=0,u=0,_=0;if(this._color.isRandom)for(let t=0;tthis.range.y?1:uthis.range.y?1:ui&&(i+=this._shapeModule._ps.main.duration);let s=i-this._prevTime,r=0;s>e&&(r=s-e,s=e),this._prevTime=this._shapeModule._ps.lifetime-r;const a=this._shapeModule._shapeType===UnityEngine.ParticleSystemShapeType.SingleSidedEdge;let n=0;const l=this._shapeModule._ps.lifePart,o=a?this.radiusMode:this.arcMode,h=a?1:this.arcSpeed.evaluate(l,0)*(360/this._shapeModule.arc),c=a?this.radiusSpread:this.arcSpread;switch(o){case UnityEngine.ParticleSystemShapeMultiModeValue.Loop:this._curValue+=s*h,n=this.roundToSpread(this._curValue,c);break;case UnityEngine.ParticleSystemShapeMultiModeValue.PingPong:this._curValue+=s*h,n=this.pingPong(this._curValue,1),n=this.roundToSpread(n,c);break;case UnityEngine.ParticleSystemShapeMultiModeValue.BurstSpread:case UnityEngine.ParticleSystemShapeMultiModeValue.Random:default:n=t.nextFloat(),n=this.roundToSpread(n,c)}return n}reset(){this._curValue=0,this._prevTime=0}get radius(){return this._shapeModule._radius}get arcMode(){return this._shapeModule._arcMode}get arcSpread(){return this._shapeModule._arcSpread}get arcSpeed(){return this._shapeModule._arcSpeed}get arcSpeedMultiplier(){return this._shapeModule.arcSpeedMultiplier}get radiusMode(){return this._shapeModule._radiusMode}get radiusSpread(){return this._shapeModule._radiusSpread}get radiusSpeed(){return this._shapeModule._radiusSpeed}}class T{constructor(t,e){this._shapeModule=t,this._useVolume=e||!1}applyTransformations(t,e,i){const r=this._shapeModule._ps._random,a=this._shapeModule.circularSpawner.getNextPosition()*this._shapeModule.arc*s.e;t.x=Math.cos(a),t.y=Math.sin(a),t.z=0;const n=1-this._shapeModule.radiusThickness,l=n+(1-n)*r.nextFloat(),o=l*this._shapeModule.radius,h=this._shapeModule.angle*l*s.e;if(0===h?(e.x=0,e.y=0,e.z=1):(e.x=t.x,e.y=t.y,e.z=Math.sqrt(t.x*t.x+t.y*t.y)/Math.tan(h),e.normalize()),t.scale(o),this._useVolume){const i=this._shapeModule.length*r.nextFloat();t.add(e.clone().scale(i))}i.x=r.nextFloat()-.5,i.y=r.nextFloat()-.5,i.z=0,i.normalize()}}class A{constructor(t,e,i){this._shapeModule=t,this._hemisphereMode=e,this._circleMode=i}applyTransformations(t,e,i){const r=this._shapeModule._ps._random,a=this._shapeModule.circularSpawner.getNextPosition()*this._shapeModule.arc*s.e,n=180*r.nextFloat()*s.e;t.x=Math.sin(n)*Math.cos(a),t.y=Math.sin(n)*Math.sin(a),t.z=Math.cos(n),this._hemisphereMode&&(t.z=Math.abs(t.z)),this._circleMode&&(t.z=0),t.normalize(),e.copy(t);const l=this._shapeModule.getPointInRadius(this._shapeModule.radius);t.scale(l),this._circleMode?(i.x=0,i.y=1):(i.x=r.nextFloat()-.5,i.y=r.nextFloat()-.5),i.z=0,i.normalize()}}const w=new s.m,b=new s.m;class z{constructor(t){this._shapeModule=t}applyTransformations(t,e,i){const r=this._shapeModule._ps._random,a=this._shapeModule.circularSpawner.getNextPosition()*this._shapeModule.arc*s.e,n=360*r.nextFloat()*s.e,l=this._shapeModule.radius,o=this._shapeModule.getPointInRadius(this._shapeModule.donutRadius);w.x=l*Math.cos(a),w.y=l*Math.sin(a),w.z=0,b.x=(l+o*Math.cos(n))*Math.cos(a),b.y=(l+o*Math.cos(n))*Math.sin(a),b.z=o*Math.sin(n),e.copy(b).sub(w),t.copy(b),i.x=r.nextFloat()-.5,i.y=r.nextFloat()-.5,i.z=0,i.normalize()}}const P=new Array(3);class R{constructor(t){this._shapeModule=t}applyTransformations(t,e,i){const s=this._shapeModule._ps._random;switch(this._shapeModule.shapeType){case UnityEngine.ParticleSystemShapeType.Box:t.x=s.nextFloat()-.5,t.y=s.nextFloat()-.5,t.z=s.nextFloat()-.5,e.set(0,0,1),i.x=s.nextFloat()-.5,i.y=s.nextFloat()-.5,i.z=0,i.normalize();break;case UnityEngine.ParticleSystemShapeType.BoxShell:{P[0]=s.nextFloat()-.5,P[1]=s.nextFloat()-.5,P[2]=s.nextFloat()-.5;const r=s.nextInteger()%3;P[r]=Math.round(s.nextFloat())-.5,t.x=P[0],t.y=P[1],t.z=P[2],e.set(0,0,1),i.x=s.nextFloat()-.5,i.y=s.nextFloat()-.5,i.z=0,i.normalize();break}case UnityEngine.ParticleSystemShapeType.Rectangle:t.x=s.nextFloat()-.5,t.y=s.nextFloat()-.5,t.z=0,e.set(0,0,1),i.set(0,0,1);break;case UnityEngine.ParticleSystemShapeType.BoxEdge:{P[0]=s.nextFloat()-.5,P[1]=s.nextFloat()-.5,P[2]=s.nextFloat()-.5;const r=Math.floor(3*s.nextFloat());for(let t=0;t<3;t++)t!==r&&(P[t]=Math.round(s.nextFloat())-.5);t.x=P[0],t.y=P[1],t.z=P[2],e.set(0,0,1),i.x=s.nextFloat()-.5,i.y=s.nextFloat()-.5,i.z=0,i.normalize();break}case UnityEngine.ParticleSystemShapeType.SingleSidedEdge:{const s=2*(this._shapeModule.circularSpawner.getNextPosition()-.5);t.x=s*this._shapeModule.radius,t.y=0,t.z=0,e.set(0,1,0),i.set(-1,0,0);break}}}}var E=i(22),C=i(4);const O={Constant:0,Curve:1,TwoCurves:2,TwoConstants:3},F=O;class D{constructor(t,e,i){this._constantMax=-0,this._constantMin=-0,this._curveMax=null,this._curveMin=null,this._curveMultiplier=-0,this._mode=0,"number"==typeof t&&e instanceof E.a&&i instanceof E.a?this.init(0,0,e,i,O.TwoCurves,t):"number"==typeof t&&"number"==typeof e?this.init(t,e,new E.a({}),new E.a({}),O.TwoConstants,1):"number"==typeof t&&e instanceof E.a?this.init(0,0,new E.a({}),e,O.Constant,t):"number"==typeof t?this.init(0,t,new E.a({}),new E.a({}),O.Constant,1):this.init(0,0,new E.a({}),new E.a({}),O.Constant,1),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"MinMaxCurve")}init(t,e,i,s,r,a){this._constantMax=e,this._constantMin=t,this._curveMax=s,this._curveMin=i,this._curveMultiplier=a,this._mode=r,this.applyMode()}applyMode(){switch(this._mode){case O.Constant:this._evaluate=this._evaluateConstant;break;case O.Curve:this._evaluate=this._evaluateCurve;break;case O.TwoConstants:this._evaluate=this._evaluateTwoConstants;break;case O.TwoCurves:this._evaluate=this._evaluateTwoCurves}}_evaluateConstant(t,e){return this._constantMax}_evaluateCurve(t,e){return this._curveMax.value(t)*this._curveMultiplier}_evaluateTwoCurves(t,e){const i=this._curveMin.value(t)*this._curveMultiplier,s=this._curveMax.value(t)*this._curveMultiplier;return(0,C.g)(i,s,e)}_evaluateTwoConstants(t,e){return(0,C.g)(this._constantMin,this.constantMax,e)}integrate(t,e){if(t=t||.01,e=e||0,this._mode===O.Constant)return this._constantMax;let i=0;for(let s=0;s<=1;s+=t)i+=this._evaluate(s,e)*t;return i}getMaxValue(t=null){t=t||1;let e=-Number.MAX_VALUE;for(let i=0;i<=1;i+=.01)e=Math.max(this._evaluate(i,t),e);return e}get isRandom(){return this._mode===O.TwoConstants||this._mode===O.TwoCurves}get mode(){return this._mode}set mode(t){this._mode=t,this.applyMode()}get constant(){return this._constantMax}set constant(t){this._constantMax=t}get constantMax(){return this._constantMax}set constantMax(t){this._constantMax=t}get constantMin(){return this._constantMin}set constantMin(t){this._constantMin=t}get curve(){return this._curveMax}set curve(t){this._curveMax=t}get curveMax(){return this._curveMax}set curveMax(t){this._curveMax=t}get curveMin(){return this._curveMin}set curveMin(t){this._curveMin=t}get curveMultiplier(){return this._curveMultiplier}set curveMultiplier(t){this._curveMultiplier=t}get evaluate(){return this._evaluate}get scalar(){return this._constantMax}set scalar(t){this._constantMax=t,this._curveMultiplier=t}}const V=new s.j,I=new s.m,U=new s.m,X=new s.m,Y=new s.j,L=new s.m,k=new s.m,N=new s.m,B=new s.m,Z=new s.m,j=new s.j,q=new s.m;class G{constructor(t){this._ps=t,this._TRS=s.i.IDENTITY,this._TR=s.i.IDENTITY,this._enabled=!1,this._radiusSpeed=new D(null,null,null),this._arcSpeed=new D(null,null,null),this._circularSpawner=new v(this),this._shapeType=UnityEngine.ParticleSystemShapeType.Cone,this._alignToDirection=!1,this._randomDirectionAmount=0,this._sphericalDirectionAmount=0,this._randomPositionAmount=0,this._radius=0,this._radiusMode=UnityEngine.ParticleSystemShapeMultiModeValue.Loop,this._radiusSpread=0,this._radiusSpeed=new D(null,null,null),this._radiusThickness=0,this._angle=0,this._length=0,this._boxThickness=new s.m,this._arc=0,this._arcMode=UnityEngine.ParticleSystemShapeMultiModeValue.Loop,this._arcSpread=0,this._arcSpeed=new D(null,null,null),this._donutRadius=0,this._position=new s.m,this._rotation=new s.m,this._scale=new s.m,this._trsDirty=!1,this._trDirty=!1,this._meshShapeType=UnityEngine.ParticleSystemMeshShapeType.Vertex,this._mesh=null,this._meshRenderer=null,this._skinnedMeshRenderer=null,this._useMeshMaterialIndex=!1,this._meshMaterialIndex=0,this._useMeshColors=!1,this._normalOffset=0,this._impl=null,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemShape")}applyNextTransform(t,e,i,r){this.impl.applyTransformations(U,X,r),this.randomizePosition(U),this._shapeType===UnityEngine.ParticleSystemShapeType.Cone?(this.impl.applyTransformations(L,k,r),this.randomizeDirection(X,k)):this.randomizeDirection(X,null),this.TRS.transformPoint(U,t),this.TRS.transformVector(X,i),i.normalize(),0===i.x&&0===i.y&&0===i.z&&(i.z=1);const a=Math.sign(this._ps.main.startSpeed.evaluate(this._ps.lifePart,this._ps._random.nextFloat()))||1;this.spherizeDirection(t,i,this.position),i.scale(a),Y.copy(this.rotationBetweenVectors(s.m.UP,i));const n=this._ps.renderer.renderMode;switch(n){case UnityEngine.ParticleSystemRenderMode.Stretch:V.setLookAt(i,new s.m(0,1,0)),V.getEulerAngles_Unity(I),e.add(I);break;case UnityEngine.ParticleSystemRenderMode.Billboard:case UnityEngine.ParticleSystemRenderMode.HorizontalBillboard:case UnityEngine.ParticleSystemRenderMode.VerticalBillboard:case UnityEngine.ParticleSystemRenderMode.Mesh:case UnityEngine.ParticleSystemRenderMode.None:if(this._alignToDirection){let t=i.clone().scale(-1);t=this.TRS.clone().invert().transformVector(t);const r=s.m.UP.clone();0===t.x&&0===t.z&&r.copy(new s.m(1,1,0));const a=(new s.m).cross(t,r),n=(new s.m).cross(a,t);V.setLookAt(t,n),V.getEulerAngles_Unity(I),e.add(I)}break;default:throw new Error('Render mode "'+n+'" not Implemented')}}randomizePosition(t){const e=this._ps._random;this.randomPositionAmount>0&&(N.x=e.nextFloat()-.5,N.y=e.nextFloat()-.5,N.z=e.nextFloat()-.5,N.scale(this.randomPositionAmount),t.add(N))}randomizeDirection(t,e){const i=this._ps._random;this.randomDirectionAmount>0&&(e?B.copy(e):(B.x=i.nextFloat()-.5,B.y=i.nextFloat()-.5,B.z=i.nextFloat()-.5),B.normalize(),t.lerp(t,B,this.randomDirectionAmount)),t.normalize()}spherizeDirection(t,e,i){this.sphericalDirectionAmount>0&&(Z.copy(t).sub(i).normalize(),e.lerp(e,Z,this.sphericalDirectionAmount)),e.normalize()}rotationBetweenVectors(t,e){return q.cross(t,e),j.x=q.x,j.y=q.y,j.z=q.z,j.w=Math.sqrt(t.lengthSq()*e.lengthSq())+t.dot(e),j.normalize()}getPointInRadius(t){const e=this._ps._random,i=1-this.radiusThickness;return(i+(1-i)*e.nextFloat())*t}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get shapeType(){return this._shapeType}set shapeType(t){switch(this._shapeType=t,t){case UnityEngine.ParticleSystemShapeType.Cone:this.impl=new T(this,!1);break;case UnityEngine.ParticleSystemShapeType.ConeVolume:this.impl=new T(this,!0);break;case UnityEngine.ParticleSystemShapeType.Sphere:this.impl=new A(this,!1,!1);break;case UnityEngine.ParticleSystemShapeType.Hemisphere:this.impl=new A(this,!0,!1);break;case UnityEngine.ParticleSystemShapeType.Circle:this.impl=new A(this,!1,!0);break;case UnityEngine.ParticleSystemShapeType.Donut:this.impl=new z(this);break;case UnityEngine.ParticleSystemShapeType.Box:case UnityEngine.ParticleSystemShapeType.BoxShell:case UnityEngine.ParticleSystemShapeType.BoxEdge:case UnityEngine.ParticleSystemShapeType.Rectangle:case UnityEngine.ParticleSystemShapeType.SingleSidedEdge:default:this.impl=new R(this)}}get randomDirectionAmount(){return this._randomDirectionAmount}set randomDirectionAmount(t){this._randomDirectionAmount=t}get sphericalDirectionAmount(){return this._sphericalDirectionAmount}set sphericalDirectionAmount(t){this._sphericalDirectionAmount=t}get randomPositionAmount(){return this._randomPositionAmount}set randomPositionAmount(t){this._randomPositionAmount=t}get alignToDirection(){return this._alignToDirection}set alignToDirection(t){this._alignToDirection=t}get radius(){return this._radius}set radius(t){this._radius=t}get radiusMode(){return this._radiusMode}set radiusMode(t){this._radiusMode=t}get radiusSpread(){return this._radiusSpread}set radiusSpread(t){this._radiusSpread=t}get radiusSpeed(){return this._radiusSpeed}set radiusSpeed(t){this._radiusSpeed=t}get radiusSpeedMultiplier(){return this._radiusSpeed.curveMultiplier}set radiusSpeedMultiplier(t){this._radiusSpeed.curveMultiplier=t}get radiusThickness(){return this._radiusThickness}set radiusThickness(t){this._radiusThickness=t}get angle(){return this._angle}set angle(t){this._angle=t}get length(){return this._length}set length(t){this._length=t}get boxThickness(){return this._boxThickness}set boxThickness(t){this._boxThickness=t}get arc(){return this._arc}set arc(t){this._arc=t}get arcMode(){return this._arcMode}set arcMode(t){this._arcMode=t}get arcSpread(){return this._arcSpread}set arcSpread(t){this._arcSpread=t}get arcSpeed(){return this._arcSpeed}set arcSpeed(t){this._arcSpeed=t}get arcSpeedMultiplier(){return this._arcSpeed.curveMultiplier}set arcSpeedMultiplier(t){this._arcSpeed.curveMultiplier=t}get donutRadius(){return this._donutRadius}set donutRadius(t){this._donutRadius=t}get position(){return this._position}set position(t){this.trsDirty=!0,this.trDirty=!0,this._position=t}get rotation(){return this._rotation}set rotation(t){this.trsDirty=!0,this.trDirty=!0,this._rotation=t}get scale(){return this._scale}set scale(t){this.trsDirty=!0,this._scale=t}get TRS(){if(this.trsDirty){const t=new s.j;t.setFromEulerAngles_Unity(this.rotation.x,this.rotation.y,this.rotation.z),this._TRS=(new s.i).setTRS(this.position,t,this.scale),this.trsDirty=!1}return this._TRS}get TR(){if(this.trDirty){const t=new s.j;t.setFromEulerAngles_Unity(this.rotation.x,this.rotation.y,this.rotation.z),this._TR=(new s.i).setTRS(this.position,t,new s.m(1,1,1)),this.trDirty=!1}return this._TR}get trsDirty(){return this._trsDirty}set trsDirty(t){this._trsDirty=t}get trDirty(){return this._trDirty}set trDirty(t){this._trDirty=t}get impl(){return this._impl}set impl(t){this._impl=t}get circularSpawner(){return this._circularSpawner}set circularSpawner(t){this._circularSpawner=t}get meshShapeType(){return this._meshShapeType}set meshShapeType(t){this._meshShapeType=t}get useMeshMaterialIndex(){return this._useMeshMaterialIndex}set useMeshMaterialIndex(t){this._useMeshMaterialIndex=t}get meshMaterialIndex(){return this._meshMaterialIndex}set meshMaterialIndex(t){this._meshMaterialIndex=t}get useMeshColors(){return this._useMeshColors}set useMeshColors(t){this._useMeshColors=t}get normalOffset(){return this._normalOffset}set normalOffset(t){this._normalOffset=t}get skinnedMeshRenderer(){return this._skinnedMeshRenderer}set skinnedMeshRenderer(t){this._skinnedMeshRenderer=t}get meshRenderer(){return this._meshRenderer}set meshRenderer(t){this._meshRenderer=t}get mesh(){return this._mesh}set mesh(t){this._mesh=t}get arcParameters(){return{value:this._arc,spread:this._arcSpread,speed:this._arcSpeed,mode:this._arcMode}}set arcParameters(t){this._arc=t.value,this._arcSpread=t.spread,this._arcSpeed=t.speed,this._arcMode=t.mode}get radiusParameters(){return{value:this._radius,spread:this._radiusSpread,speed:this._radiusSpeed,mode:this._radiusMode}}set radiusParameters(t){this._radius=t.value,this._radiusSpread=t.spread,this._radiusSpeed=t.speed,this._radiusMode=t.mode}get counterName(){return m.d.PARTICLES_SHAPE}}const W=new s.d,H=new r;class Q{constructor(t){this._ps=t,this._enabled=!1,this._color=new p(null,null),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ColorOverLifetime")}processInplace(t){const e=t.aliveCount,i=t.color,s=t.lifePart,r=t.seed;let a=0;if(this._color.isRandom)for(let t=0;t=t&&(this._value-=t)}get accumulated(){return Math.floor(this._value)}}class J{constructor(t){this._ps=t,this._accumulator=new $,this._enabled=!0,this._rateOverTime=new D(10,null,null),this._rateOverDistance=new D(null,null,null),this._bursts=[],this._burstCount=0,this._lastSpawnTime_rate=0,this._ps.events.on("ParticleSystemNewLoop",this.handleParticleSystemLoop),this._emission=null,this._previousPosition=new s.m,TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemEmitter")}setBursts(t){this._bursts=t}getBursts(t){for(let e=0;ee&&(r=(0,s.p)(r,e,this._dampen)),r*i}applyDragInplace(t){const e=this._ps._random,i=t.aliveCount,s=t.animatedVelocity,r=t.velocity,a=t.dt,n=t.lifePart,l=t.s,o=t.seed;let h=0,c=0,u=0,_=0,d=0,p=0,m=0,y=0,S=0;for(let t=0;tit.x&&(at.x=this.applyDamp(at.x,it.x)),Math.abs(at.y)>it.y&&(at.y=this.applyDamp(at.y,it.y)),Math.abs(at.z)>it.z&&(at.z=this.applyDamp(at.z,it.z));else{const t=at.length(),e=this.applyDamp(t,it.z);at.normalize().scale(e)}s[n]=at.x-i[n],s[n+1]=at.y-i[n+1],s[n+2]=at.z-i[n+2]}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get limit(){return this._limit}set limit(t){this._limit=t}get limitMultiplier(){return this._limitX.curveMultiplier}set limitMultiplier(t){this._limitX.curveMultiplier=t}get separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=t}get limitX(){return this._limitX}set limitX(t){this._limitX=t}get limitY(){return this._limitY}set limitY(t){this._limitY=t}get limitZ(){return this._limitZ}set limitZ(t){this.limitY=t}get limitXMultiplier(){return this._limitX.curveMultiplier}set limitXMultiplier(t){this._limitX.curveMultiplier=t}get limitYMultiplier(){return this._limitY.curveMultiplier}set limitYMultiplier(t){this._limitY.curveMultiplier=t}get limitZMultiplier(){return this._limitZ.curveMultiplier}set limitZMultiplier(t){this._limitZ.curveMultiplier=t}get space(){return this._space}set space(t){this._space=t}get dampen(){return this._dampen}set dampen(t){this._dampen=t}get drag(){return this._drag}set drag(t){this._drag=t}get dragMultiplier(){return this._drag.curveMultiplier}set dragMultiplier(t){this._drag.curveMultiplier=t}get multiplyDragByParticleSize(){return this._multiplyDragByParticleSize}set multiplyDragByParticleSize(t){this._multiplyDragByParticleSize=t}get multiplyDragByParticleVelocity(){return this._multiplyDragByParticleVelocity}set multiplyDragByParticleVelocity(t){this._multiplyDragByParticleVelocity=t}get counterName(){return m.d.PARTICLES_LIMIT_VELOCITY_OVER_LIFETIME}}class lt{constructor(t){this._ps=t,this._duration=5,this._loop=!0,this._prewarm=!0,this._startDelay=new D(null,null,null),this._startLifetime=new D(5,null,null),this._startSpeed=new D(5,null,null),this._startSize3D=!1,this._startSizeX=new D(null,null,null),this._startSizeY=new D(null,null,null),this._startSizeZ=new D(null,null,null),this._startRotation3D=!1,this._startRotationX=new D(null,null,null),this._startRotationY=new D(null,null,null),this._startRotationZ=new D(null,null,null),this._flipRotation=!1,this._startColor=new p(null,null),this._gravityModifier=new D(null,null,null),this._simulationSpace=UnityEngine.ParticleSystemSimulationSpace.Local,this._customSimulationSpace=null,this._simulationSpeed=1,this._useUnscaledTime=!0,this._scalingMode=UnityEngine.ParticleSystemScalingMode.Local,this._playOnAwake=!0,this.maxParticles=10,this._emitterVelocityMode=UnityEngine.ParticleSystemEmitterVelocityMode.Transform,this._stopAction=UnityEngine.ParticleSystemStopAction.None,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemMain")}get duration(){return this._duration}set duration(t){this._duration=t}get loop(){return this._loop}set loop(t){this._loop=t}get prewarm(){return this._prewarm}set prewarm(t){this._prewarm=t}get startDelay(){return this._startDelay}set startDelay(t){this._startDelay=t}get startDelayMultiplier(){return this._startDelay.curveMultiplier}set startDelayMultiplier(t){this._startDelay.curveMultiplier=t}get startLifetime(){return this._startLifetime}set startLifetime(t){this._startLifetime=t}get startLifetimeMultiplier(){return this._startLifetime.curveMultiplier}set startLifetimeMultiplier(t){this._startLifetime.curveMultiplier=t}get startSpeed(){return this._startSpeed}set startSpeed(t){this._startSpeed=t}get startSpeedMultiplier(){return this._startSpeed.curveMultiplier}set startSpeedMultiplier(t){this._startSpeed.curveMultiplier=t}get startSize3D(){return this._startSize3D}set startSize3D(t){this._startSize3D=t}get startSize(){return this._startSizeX}set startSize(t){this._startSizeX=t}get startSizeX(){return this._startSizeX}set startSizeX(t){this._startSizeX=t}get startSizeY(){return this._startSizeY}set startSizeY(t){this._startSizeY=t}get startSizeZ(){return this._startSizeZ}set startSizeZ(t){this._startSizeZ=t}get startSizeMultiplier(){return this._startSizeX.curveMultiplier}set startSizeMultiplier(t){this._startSizeX.curveMultiplier=t}get startSizeXMultiplier(){return this._startSizeX.curveMultiplier}set startSizeXMultiplier(t){this._startSizeX.curveMultiplier=t}get startSizeYMultiplier(){return this._startSizeY.curveMultiplier}set startSizeYMultiplier(t){this._startSizeY.curveMultiplier=t}get startSizeZMultiplier(){return this._startSizeZ.curveMultiplier}set startSizeZMultiplier(t){this._startSizeZ.curveMultiplier=t}get startRotation3D(){return this._startRotation3D}set startRotation3D(t){this._startRotation3D=t}get startRotation(){return this._startRotationZ}set startRotation(t){this._startRotationZ=t}get startRotationX(){return this._startRotationX}set startRotationX(t){this._startRotationX=t}get startRotationY(){return this._startRotationY}set startRotationY(t){this._startRotationY=t}get startRotationZ(){return this._startRotationZ}set startRotationZ(t){this._startRotationZ=t}get startRotationMultiplier(){return this._startRotationZ.curveMultiplier}set startRotationMultiplier(t){this._startRotationZ.curveMultiplier=t}get startRotationXMultiplier(){return this._startRotationX.curveMultiplier}set startRotationXMultiplier(t){this._startRotationX.curveMultiplier=t}get startRotationYMultiplier(){return this._startRotationY.curveMultiplier}set startRotationYMultiplier(t){this._startRotationY.curveMultiplier=t}get startRotationZMultiplier(){return this._startRotationZ.curveMultiplier}set startRotationZMultiplier(t){this._startRotationZ.curveMultiplier=t}get flipRotation(){return this._flipRotation}set flipRotation(t){this._flipRotation=t}get startColor(){return this._startColor}set startColor(t){this._startColor=t}get gravityModifier(){return this._gravityModifier}set gravityModifier(t){this._gravityModifier=t}get gravityModifierMultiplier(){return this._gravityModifier.curveMultiplier}set gravityModifierMultiplier(t){this._gravityModifier.curveMultiplier=t}get simulationSpace(){return this._simulationSpace}set simulationSpace(t){this._simulationSpace=t}get customSimulationSpace(){return this._customSimulationSpace}set customSimulationSpace(t){this._customSimulationSpace=t}get simulationSpeed(){return this._simulationSpeed}set simulationSpeed(t){this._simulationSpeed=t}get useUnscaledTime(){return this._useUnscaledTime}set useUnscaledTime(t){this._useUnscaledTime=t}get scalingMode(){return this._scalingMode}set scalingMode(t){this._scalingMode=t}get playOnAwake(){return this._playOnAwake}set playOnAwake(t){this._playOnAwake=t}get maxParticles(){return this._ps._cache.maxParticles}set maxParticles(t){this._ps._cache.maxParticles=t}get emitterVelocityMode(){return this._emitterVelocityMode}set emitterVelocityMode(t){this._emitterVelocityMode=t}get stopAction(){return this._stopAction}set stopAction(t){this._stopAction=t}}const ot=new s.m(0,0,0);class ht{constructor(t){this._ps=t,this._enabled=!1,this._separateAxes=!1,this._strengthX=new D(null,null,null),this._strengthY=new D(null,null,null),this._strengthZ=new D(null,null,null),this._frequency=1,this._damping=!1,this._octaveCount=1,this._octaveMultiplier=1,this._octaveScale=1,this._quality=UnityEngine.ParticleSystemNoiseQuality.Low,this._scrollSpeed=new D(null,null,null),this._remapEnabled=!1,this._remapX=new D(null,null,null),this._remapY=new D(null,null,null),this._remapZ=new D(null,null,null),this._positionAmount=new D(null,null,null),this._rotationAmount=new D(null,null,null),this._sizeAmount=new D(null,null,null),this._scrollValue=0,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"Noise")}processInplace(t){const e=this._ps._random,i=t.aliveCount,r=t.dt,a=t.lifePart,n=t.s,l=t.animatedVelocity,o=t.seed;let h=0,c=0,u=0,_=0,d=0,p=0,m=1;for(let t=0;tt.range.y?r=1:i=t.range.x&&i<=t.range.y&&(r=(i-t.range.x)/(t.range.y-t.range.x)),e.evaluate(r,s)}processInplace(t){const e=t.aliveCount,i=t.angularVelocity,r=t.animatedVelocity,a=t.velocity,n=t.seed;let l=0,o=0;const h=this.x._mode===F.Constant||this.x.mode===F.TwoConstants?this.getRotationAmountConst:this.getRotationAmount;for(let t=0;tthis.range.y){const t=this.range.x;this.range.x=this.range.y,this.range.y=t}const e=this._ps._random,i=t.aliveCount,s=t.s,r=t.velocity,a=t.animatedVelocity,n=t.seed;let l=0,o=0,h=0,c=0,u=0,_=0,d=0;for(let t=0;tthis._range.y?1:_0){this.checkIsSpriteFromSameAtlas(this._sprites,t)&&this._sprites.push(t)}else this._sprites.push(t)}getSprite(t){return this._sprites[t]}getAtlasTexture(){return null===this._sprites[0]?null:this._sprites[0].texture}getFramesCount(){return this._animation===UnityEngine.ParticleSystemAnimationType.WholeSheet?this._numTilesX*this._numTilesY:this._numTilesX}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get animation(){return this._animation}set animation(t){this._animation=t}get cycleCount(){return this._cycleCount}set cycleCount(t){this._cycleCount=t}get flipU(){return this._flipU}set flipU(t){this._flipU=t}get flipV(){return this._flipV}set flipV(t){this._flipV=t}get frameOverTime(){return this._frameOverTime}set frameOverTime(t){this._frameOverTime=t}get frameOverTimeMultiplier(){return this._frameOverTime.curveMultiplier}set frameOverTimeMultiplier(t){this._frameOverTime.curveMultiplier=t}get mode(){return this._mode}set mode(t){this._mode=t}get numTilesX(){return this._numTilesX}set numTilesX(t){this._numTilesX=t}get numTilesY(){return this._numTilesY}set numTilesY(t){this._numTilesY=t}get rowIndex(){return this._rowIndex}set rowIndex(t){this._rowIndex=t}get spriteCount(){return this._spriteCount}set spriteCount(t){this._spriteCount=t}get startFrame(){return this._startFrame}set startFrame(t){this._startFrame=t}get startFrameMultiplier(){return this._startFrame.curveMultiplier}set startFrameMultiplier(t){this._startFrame.curveMultiplier=t}get useRandomRow(){return this._useRandomRow}set useRandomRow(t){this._useRandomRow=t}get sprites(){return this._sprites}set sprites(t){let e=!0;if(t.length>1){const i=t[0].texture.name;for(let s=1;sMt.b?1/h[t]:0,_.scale(d),i[l]+=_.x,i[l+1]+=_.y,i[l+2]+=_.z),ft.x=this._x.evaluate(o,Tt.nextFloat()),ft.y=this._y.evaluate(o,Tt.nextFloat()),ft.z=this._z.evaluate(o,Tt.nextFloat()),this._space===S&&g.transformVector(ft,ft);const e=this._radial.evaluate(o,Tt.nextFloat());0!==e&&(vt.set(a[l],a[l+1],a[l+2]),vt.sub(xt).normalize().scale(e),ft.add(vt)),i[l]+=ft.x,i[l+1]+=ft.y,i[l+2]+=ft.z}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get z(){return this._z}set z(t){this._z=t}get xMultiplier(){return this._x.curveMultiplier}set xMultiplier(t){this._x.curveMultiplier=t}get yMultiplier(){return this._y.curveMultiplier}set yMultiplier(t){this._y.curveMultiplier=t}get zMultiplier(){return this._z.curveMultiplier}set zMultiplier(t){this._z.curveMultiplier=t}get orbitalX(){return this._orbitalX}set orbitalX(t){this._orbitalX=t}get orbitalY(){return this._orbitalY}set orbitalY(t){this._orbitalY=t}get orbitalZ(){return this._orbitalZ}set orbitalZ(t){this._orbitalZ=t}get orbitalXMultiplier(){return this._orbitalX.curveMultiplier}set orbitalXMultiplier(t){this._orbitalX.curveMultiplier=t}get orbitalYMultiplier(){return this._orbitalY.curveMultiplier}set orbitalYMultiplier(t){this._orbitalY.curveMultiplier=t}get orbitalZMultiplier(){return this._orbitalZ.curveMultiplier}set orbitalZMultiplier(t){this._orbitalZ.curveMultiplier=t}get orbitalOffsetX(){return this._orbitalOffsetX}set orbitalOffsetX(t){this._orbitalOffsetX=t}get orbitalOffsetY(){return this._orbitalOffsetY}set orbitalOffsetY(t){this._orbitalOffsetY=t}get orbitalOffsetZ(){return this._orbitalOffsetZ}set orbitalOffsetZ(t){this._orbitalOffsetZ=t}get orbitalOffsetXMultiplier(){return this._orbitalOffsetX.curveMultiplier}set orbitalOffsetXMultiplier(t){this._orbitalOffsetX.curveMultiplier=t}get orbitalOffsetYMultiplier(){return this._orbitalOffsetY.curveMultiplier}set orbitalOffsetYMultiplier(t){this._orbitalOffsetY.curveMultiplier=t}get orbitalOffsetZMultiplier(){return this._orbitalOffsetZ.curveMultiplier}set orbitalOffsetZMultiplier(t){this._orbitalOffsetZ.curveMultiplier=t}get radial(){return this._radial}set radial(t){this._radial=t}get radialMultiplier(){return this._radial.curveMultiplier}set radialMultiplier(t){this._radial.curveMultiplier=t}get speedModifier(){return this._speedModifier}set speedModifier(t){this._speedModifier=t}get speedModifierMultiplier(){return this._speedModifier.curveMultiplier}set speedModifierMultiplier(t){this._speedModifier.curveMultiplier=t}get space(){return this._space}set space(t){this._space=t}get counterName(){return m.d.PARTICLES_VELOCITY_OVER_LIFETIME}}class wt{constructor(t,e){this._ps=t,this._decomposedToObjects=!1,this._particles=[],this._capacity=0,this._aliveCount=0,this._maxParticles=e||0,this._t=new Float32Array(0),this._r=new Float32Array(0),this._s=new Float32Array(0),this._rotation3D=new Float32Array(0),this._startSize3D=new Float32Array(0),this._startRotationAxis=new Float32Array(0),this._angularVelocity=new Float32Array(0),this._velocity=new Float32Array(0),this._animatedVelocity=new Float32Array(0),this._totalVelocity=new Float32Array(0),this._color=new Float32Array(0),this._startColor=new Float32Array(0),this._elapsedTime=new Float32Array(0),this._lifetime=new Float32Array(0),this._lifePart=new Float32Array(0),this._dt=new Float32Array(0),this._birthTime=new Float32Array(0),this._startFrame=new Uint8Array(0),this._texSheetOffsetX=new Float32Array(0),this._texSheetOffsetY=new Float32Array(0),this._texSheetScaleX=new Float32Array(0),this._texSheetScaleY=new Float32Array(0),this._seed=new Uint32Array(0),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleCache")}initializeNewParticle(t,e){const i=e,s=3*i,r=4*i;this._t[s]=t.translation.x,this._t[s+1]=t.translation.y,this._t[s+2]=t.translation.z,this._r[r]=t.rotation.x,this._r[r+1]=t.rotation.y,this._r[r+2]=t.rotation.z,this._r[r+3]=t.rotation.w,this._rotation3D[s]=t.rotation3D.x,this._rotation3D[s+1]=t.rotation3D.y,this._rotation3D[s+2]=t.rotation3D.z,this._s[s]=t.scale.x,this._s[s+1]=t.scale.y,this._s[s+2]=t.scale.z,this._startSize3D[s]=t.scale.x,this._startSize3D[s+1]=t.scale.y,this._startSize3D[s+2]=t.scale.z,this._startRotationAxis[s]=t.startRotationAxis.x,this._startRotationAxis[s+1]=t.startRotationAxis.y,this._startRotationAxis[s+2]=t.startRotationAxis.z,this._angularVelocity[s]=0,this._angularVelocity[s+1]=0,this._angularVelocity[s+2]=0,this._velocity[s]=t.velocity.x,this._velocity[s+1]=t.velocity.y,this._velocity[s+2]=t.velocity.z,this._animatedVelocity[s]=0,this._animatedVelocity[s+1]=0,this._animatedVelocity[s+2]=0,this._totalVelocity[s]=0,this._totalVelocity[s+1]=0,this._totalVelocity[s+2]=0,this._color[r]=t.color.r,this._color[r+1]=t.color.g,this._color[r+2]=t.color.b,this._color[r+3]=t.color.a,this._startColor[r]=t.color.r,this._startColor[r+1]=t.color.g,this._startColor[r+2]=t.color.b,this._startColor[r+3]=t.color.a,this._elapsedTime[i]=0,this._lifetime[i]=t.lifetime,this._lifePart[i]=0,this._dt[i]=0,this._birthTime[i]=t.birthTimeOffset,this._startFrame[i]=t.startFrame,this._texSheetOffsetX[i]=t.texSheetOffsetX,this._texSheetOffsetY[i]=t.texSheetOffsetY,this._texSheetScaleX[i]=t.texSheetScaleX,this._texSheetScaleY[i]=t.texSheetScaleY,this._seed[i]=x.nextInteger()}resizeRaw(t){t=Math.min(Math.max(t,1),this.maxParticles),this._capacity=t,this._t=this.getTypedArray(Float32Array,this._t,t,4),this._r=this.getTypedArray(Float32Array,this._r,t,4),this._s=this.getTypedArray(Float32Array,this._s,t,3),this._rotation3D=this.getTypedArray(Float32Array,this._rotation3D,t,3),this._startSize3D=this.getTypedArray(Float32Array,this._startSize3D,t,3),this._startRotationAxis=this.getTypedArray(Float32Array,this._startRotationAxis,t,3),this._angularVelocity=this.getTypedArray(Float32Array,this._angularVelocity,t,3),this._velocity=this.getTypedArray(Float32Array,this._velocity,t,3),this._animatedVelocity=this.getTypedArray(Float32Array,this._animatedVelocity,t,3),this._totalVelocity=this.getTypedArray(Float32Array,this._totalVelocity,t,3),this._color=this.getTypedArray(Float32Array,this._color,t,4),this._startColor=this.getTypedArray(Float32Array,this._startColor,t,4),this._elapsedTime=this.getTypedArray(Float32Array,this._elapsedTime,t,1),this._lifetime=this.getTypedArray(Float32Array,this._lifetime,t,1),this._lifePart=this.getTypedArray(Float32Array,this._lifePart,t,1),this._dt=this.getTypedArray(Float32Array,this._dt,t,1),this._birthTime=this.getTypedArray(Float32Array,this._birthTime,t,1),this._startFrame=this.getTypedArray(Uint8Array,this._startFrame,t,1),this._texSheetOffsetX=this.getTypedArray(Float32Array,this._texSheetOffsetX,t,1),this._texSheetOffsetY=this.getTypedArray(Float32Array,this._texSheetOffsetY,t,1),this._texSheetScaleX=this.getTypedArray(Float32Array,this._texSheetScaleX,t,1),this._texSheetScaleY=this.getTypedArray(Float32Array,this._texSheetScaleY,t,1),this._seed=this.getTypedArray(Uint32Array,this._seed,t,1)}getTypedArray(t,e,i,s){const r=new t(i*s);let a=0;for(a=0;athis.maxParticles)return null;this.aliveCount>=this._capacity&&(0===this._capacity?this.resizeRaw(this.estimateParticlesCount()):(DEBUG&&UnityEngine.Debug.LogError$1("ESTIMATION IS WRONG"),this.resizeRaw(2*this._capacity)));const t=this.aliveCount;return this.aliveCount++,t}release(t){const e=this.aliveCount-1;if(--this.aliveCount,0===e)return;const i=3*t,s=4*t,r=3*e,a=4*e;this._t[i]=this._t[r],this._t[i+1]=this._t[r+1],this._t[i+2]=this._t[r+2],this._r[s]=this._r[a],this._r[s+1]=this._r[a+1],this._r[s+2]=this._r[a+2],this._r[s+3]=this._r[a+3],this._s[i]=this._s[r],this._s[i+1]=this._s[r+1],this._s[i+2]=this._s[r+2],this._rotation3D[i]=this._rotation3D[r],this._rotation3D[i+1]=this._rotation3D[r+1],this._rotation3D[i+2]=this._rotation3D[r+2],this._startSize3D[i]=this._startSize3D[r],this._startSize3D[i+1]=this._startSize3D[r+1],this._startSize3D[i+2]=this._startSize3D[r+2],this._startRotationAxis[i]=this._startRotationAxis[r],this._startRotationAxis[i+1]=this._startRotationAxis[r+1],this._startRotationAxis[i+2]=this._startRotationAxis[r+2],this._angularVelocity[i]=this._angularVelocity[r],this._angularVelocity[i+1]=this._angularVelocity[r+1],this._angularVelocity[i+2]=this._angularVelocity[r+2],this._velocity[i]=this._velocity[r],this._velocity[i+1]=this._velocity[r+1],this._velocity[i+2]=this._velocity[r+2],this._animatedVelocity[i+0]=this._animatedVelocity[r],this._animatedVelocity[i+1]=this._animatedVelocity[r+1],this._animatedVelocity[i+2]=this._animatedVelocity[r+2],this._totalVelocity[i+0]=this._totalVelocity[r],this._totalVelocity[i+1]=this._totalVelocity[r+1],this._totalVelocity[i+2]=this._totalVelocity[r+2],this._elapsedTime[t]=this._elapsedTime[e],this._lifetime[t]=this._lifetime[e],this._lifePart[t]=this._lifePart[e],this._dt[t]=this._dt[e],this._birthTime[t]=this._birthTime[e],this._color[s]=this._color[a],this._color[s+1]=this._color[a+1],this._color[s+2]=this._color[a+2],this._color[s+3]=this._color[a+3],this._startColor[s]=this._startColor[a],this._startColor[s+1]=this._startColor[a+1],this._startColor[s+2]=this._startColor[a+2],this._startColor[s+3]=this._startColor[a+3],this._startFrame[t]=this._startFrame[e],this._texSheetOffsetX[t]=this._texSheetOffsetX[e],this._texSheetOffsetY[t]=this._texSheetOffsetY[e],this._texSheetScaleX[t]=this._texSheetScaleX[e],this._texSheetScaleY[t]=this._texSheetScaleY[e],this._seed[t]=this._seed[e]}clear(){this.aliveCount=0}dispose(){this._particles=null,this.aliveCount=0,this.maxParticles=0}estimateParticlesCount(){const t=this._ps.emission,e=this._ps.main.startLifetime.getMaxValue(),i=t.rateOverTime.getMaxValue()*e*1.03,s=10*t.rateOverDistance.getMaxValue();let r=0;const a=t.bursts;for(let t=0;t0){const t=this.entity.getWorldTransform();for(let i=0;ithis.main.duration&&this.main.loop&&(this._lifetime-=this.main.duration,this._events.fire("ParticleSystemNewLoop")),this.lifetime>this.main.duration&&!this.main.loop&&(this._shouldEmit=!1),this.updateCurrentVelocity(t),this.cleanupOldParticles(t),this._shouldEmit&&this.emission&&this.emission.enabled&&(this.startModuleCounter(this.emission.counterName),this.emission.update(i,e),this.endModuleCounter(this.emission.counterName)),this._updateParticles(i,e),this.checkStopAction())}cleanupOldParticles(t){const e=this._cache.aliveCount,i=this._cache.elapsedTime,s=this._cache.lifetime;for(let r=e-1;r>=0;--r)i[r]+t>s[r]&&this._cache.release(r)}doOnChildren(t,e,i){if(t&&this.entity){const t=this.entity.allChildren();for(let s=0;s0}get entity(){return this._entity}get lifePart(){return this._lifetime/this.main.duration}get lifetime(){return this._lifetime}set lifetime(t){this._lifetime=t}get particleCount(){return this._cache.aliveCount}get emittedParticlesCount(){return this._emittedCount}get main(){return this._main}set main(t){this._main=t}get emission(){return this._emission}set emission(t){this._emission=t}get shape(){return this._shape}set shape(t){this._shape=t}get velocityOverLifetime(){return this._velocityOverLifetime}set velocityOverLifetime(t){this._velocityOverLifetime=t}get colorOverLifetime(){return this._colorOverLifetime}set colorOverLifetime(t){this._colorOverLifetime=t}get colorBySpeed(){return this._colorBySpeed}set colorBySpeed(t){this._colorBySpeed=t}get sizeOverLifetime(){return this._sizeOverLifetime}set sizeOverLifetime(t){this._sizeOverLifetime=t}get sizeBySpeed(){return this._sizeBySpeed}set sizeBySpeed(t){this._sizeBySpeed=t}get rotationOverLifetime(){return this._rotationOverLifetime}set rotationOverLifetime(t){this._rotationOverLifetime=t}get rotationBySpeed(){return this._rotationBySpeed}set rotationBySpeed(t){this._rotationBySpeed=t}get textureSheetAnimation(){return this._textureSheetAnimation}set textureSheetAnimation(t){this._textureSheetAnimation=t}get time(){return this._playTime}get currentVelocity(){return this._currentVelocity}get isPaused(){return this._paused}get isPlaying(){return this.isActive&&!this._paused}get isStopped(){return!this._shouldEmit}get isEmitting(){return this._shouldEmit}get useAutoRandomSeed(){return this._useAutoRandomSeed}set useAutoRandomSeed(t){!this._useAutoRandomSeed&&t&&this._random.randomizeSeed(),this._useAutoRandomSeed=t}get randomSeed(){return this._randomSeed}set randomSeed(t){this._randomSeed=t,this.useAutoRandomSeed||this._random.setSeed(t)}get events(){return this._events}set events(t){this._events=t}get noise(){return this._noise}set noise(t){this._noise=t}get forceOverLifetime(){return this._forceOverLifetime}set forceOverLifetime(t){this._forceOverLifetime=t}get limitVelocityOverLifetime(){return this._limitVelocityOverLifetime}set limitVelocityOverLifetime(t){this._limitVelocityOverLifetime=t}get inheritVelocity(){return this._inheritVelocity}set inheritVelocity(t){this._inheritVelocity=t}startModuleCounter(t){t&&m.d.instance.startSubSection(t)}endModuleCounter(t){t&&m.d.instance.endSubSection(t)}},pc.Particle=f,pc.ParticleSystemSystem=pe,pc.ParticleSystemRenderer=class{constructor(){this._model=null,this._mesh=null,this._instancingVertexFormat=null,this._instancingData=null,this._worldRotationTransform=new s.i,this._worldTranslationTransform=new s.i,this._alignment=UnityEngine.ParticleSystemRenderSpace.World,this._renderMode=UnityEngine.ParticleSystemRenderMode.Billboard,this._lengthScale=1,this._velocityScale=1,this._sortMode=UnityEngine.ParticleSystemSortMode.None,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemRenderer")}_updateInstancingData(t,e){const i=this.model.meshInstances;if(0===i.length)return;const r=this._instancingData._buffer,a=new Float32Array(r.lock());se.set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),re.set(-Number.MAX_SAFE_INTEGER,-Number.MAX_SAFE_INTEGER,-Number.MAX_SAFE_INTEGER);const n=this.renderMode===UnityEngine.ParticleSystemRenderMode.Stretch,l=!!t.textureSheetAnimation&&t.textureSheetAnimation.enabled,o=this._instancingVertexFormat.size/4,h=t.textureSheetAnimation,c=1/h.numTilesX,u=1/h.numTilesY;let _=0,d=0,p=0,m=0,y=0,S=0,g=0;const M=e.aliveCount;for(_=0;_this._instancingData._buffer.numVertices&&this._instancingData._buffer.resize(t),this._instancingData.count=t)}_sortParticles(t,e){const i=this.sortMode;if(0===i)return;t.decompose();const s=t._particles;switch(ie=this.model.entity.getPosition(),i){case UnityEngine.ParticleSystemSortMode.Distance:s.sort(this.sortByDistance);break;case UnityEngine.ParticleSystemSortMode.OldestInFront:s.sort(this.sortOldestInFront);break;case UnityEngine.ParticleSystemSortMode.YoungestInFront:s.sort(this.sortYoungestInFront);case UnityEngine.ParticleSystemSortMode.None:}for(let t=0;t0&&this._sortParticles(i,i.aliveCount),this._resizeInstancingBuffer(i.aliveCount),this._updateInstancingData(t,i)}get mesh(){return this.model.mesh}set mesh(t){this._mesh=t,this.renderMode===UnityEngine.ParticleSystemRenderMode.Mesh&&(this.model.mesh=t,this.updateMeshInstances())}get alignment(){return this._alignment}set alignment(t){this._alignment=t}get renderMode(){return this._renderMode}set renderMode(t){this._renderMode=t,this.updateRenderMode()}get lengthScale(){return this._lengthScale}set lengthScale(t){this._lengthScale=t}get velocityScale(){return this._velocityScale}set velocityScale(t){this._velocityScale=t}get sortMode(){return this._sortMode}set sortMode(t){this._sortMode=t}get model(){return this._model}set model(t){this._model=t}get worldRotationTransform(){return this._worldRotationTransform}set worldRotationTransform(t){this._worldRotationTransform=t}get worldTranslationTransform(){return this._worldTranslationTransform}set worldTranslationTransform(t){this._worldTranslationTransform=t}},pc.ParticleSystemRendererSystem=ce,pc.ParticleSystemRendererComponent=_e,pc.ParticleSystemComponent=de,pc.ParticleSystemBurst=class{constructor(){this._timeToFire=0,this._repeatInterval=0,this._repeatCount=1/0,this._time=0,this._count=new D(null,null,null),this._cycleCount=0,this._enabled=!1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemBurst")}recalculateRepeatCount(){this._repeatCount=this.cycleCount>0?this.cycleCount:1/0}resetTimeToFire(){this._timeToFire=this._time}get time(){return this._time}set time(t){this._time=t}get count(){return this._count}set count(t){this._count=t}get maxCount(){return this._count.constantMax}set maxCount(t){this._count.constantMax=t}get minCount(){return this._count.constantMin}set minCount(t){this._count.constantMin=t}get cycleCount(){return this._cycleCount}set cycleCount(t){this._cycleCount=t}get repeatInterval(){return this._repeatInterval}set repeatInterval(t){this._repeatInterval=t}get shouldFire(){return this._repeatCount>0}get repeatCount(){return this._repeatCount}set repeatCount(t){this._repeatCount=t}get timeToFire(){return this._timeToFire}set timeToFire(t){this._timeToFire=t}},pc.MinMaxGradient=p,pc.MinMaxCurve=D,pc.markParticleSystemModuleAsUsed=()=>{TRACE&&window.traceResults.markModuleAsUsed(window.traceResults.EngineModules.ParticleSystem)}}},t=>{t.O(0,[1],(()=>{return e=54,t(t.s=e);var e}));t.O()}]);