1 line
103 KiB
JavaScript
1 line
103 KiB
JavaScript
"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;t<e;t++)n=3*t,l=4*t,S.setSeed(a[t]),o=s[n]+r[n],h=s[n+1]+r[n+1],c=s[n+2]+r[n+2],u=Math.sqrt(o*o+h*h+c*c),_=u>this.range.y?1:u<this.range.x?0:(u-this.range.x)/(this.range.y-this.range.x),this._color.evaluateInplace(y,_,S.nextFloat()),i[l]*=y.r,i[l+1]*=y.g,i[l+2]*=y.b,i[l+3]*=y.a;else for(let t=0;t<e;t++)n=3*t,l=4*t,o=s[n]+r[n],h=s[n+1]+r[n+1],c=s[n+2]+r[n+2],u=Math.sqrt(o*o+h*h+c*c),_=u>this.range.y?1:u<this.range.x?0:(u-this.range.x)/(this.range.y-this.range.x),this._color.evaluateInplace(y,_,0),i[l]*=y.r,i[l+1]*=y.g,i[l+2]*=y.b,i[l+3]*=y.a}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get color(){return this._color}set color(t){this._color=t}get range(){return this._range}set range(t){this._range=t}get counterName(){return m.d.PARTICLES_COLOR_BY_SPEED}}const M=new r,x=M;class f{constructor(){this._t=new s.m,this._r=new s.j,this._s=new s.m,this._rotation3D=new s.m,this._tmpScale=new s.m,this._animatedVelocity=new s.m,this._velocity=new s.m,this._startSize3D=new s.m,this._angularVelocity=new s.m,this._startRotationAxis=new s.m(0,0,1),this._color=new s.d(1,1,1,1),this._startColor=new s.d(1,1,1,1),this._texSheetAnimationInitialized=!1,this._startFrame=0,this._texSheetOffsetX=0,this._texSheetOffsetY=0,this._texSheetScaleX=0,this._texSheetScaleY=0,this._lifetime=0,this._elapsedTime=0,this._birthTimeOffset=0,this._cacheIndex=0,this._dt=0,this._birthTime=0,this._seed=1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"Particle")}initialize(t,e,i){this._t.copy(t.translation),this._r.copy(t.rotation),this._rotation3D.copy(t.rotation3D),this._startSize3D.copy(t.scale),this._s.copy(t.scale),t.startRotationAxis&&this._startRotationAxis.copy(t.startRotationAxis),this._color.copy(t.color),this._startColor.copy(t.color),this._lifetime=t.lifetime,this._tmpScale.set(1,1,1),this._birthTimeOffset=t.birthTimeOffset,this._startFrame=t.startFrame,this._texSheetOffsetX=t.texSheetOffsetX,this._texSheetOffsetY=t.texSheetOffsetY,this._texSheetScaleX=t.texSheetScaleX,this._texSheetScaleY=t.texSheetScaleY;const s=i,r=3*s,a=4*s;e.t[r]=this._t.x,e.t[r+1]=this._t.y,e.t[r+2]=this._t.z,e.r[a]=this._r.x,e.r[a+1]=this._r.y,e.r[a+2]=this._r.z,e.r[a+3]=this._r.w,e.rotation3D[r]=this._rotation3D.x,e.rotation3D[r+1]=this._rotation3D.y,e.rotation3D[r+2]=this._rotation3D.z,e.s[r]=this._s.x,e.s[r+1]=this._s.y,e.s[r+2]=this._s.z,e.startSize3D[r]=this._startSize3D.x,e.startSize3D[r+1]=this._startSize3D.y,e.startSize3D[r+2]=this._startSize3D.z,e.startRotationAxis[r]=this._startRotationAxis.x,e.startRotationAxis[r+1]=this._startRotationAxis.y,e.startRotationAxis[r+2]=this._startRotationAxis.z,e.angularVelocity[r]=this._angularVelocity.x,e.angularVelocity[r+1]=this._angularVelocity.y,e.angularVelocity[r+2]=this._angularVelocity.z,e._totalVelocity[r]=0,e._totalVelocity[r+1]=0,e._totalVelocity[r+2]=0,e.velocity[r]=this._velocity.x,e.velocity[r+1]=this._velocity.y,e.velocity[r+2]=this._velocity.z,e.animatedVelocity[r]=0,e.animatedVelocity[r+1]=0,e.animatedVelocity[r+2]=0,e.color[a]=this._color.r,e.color[a+1]=this._color.g,e.color[a+2]=this._color.b,e.color[a+3]=this._color.a,e.startColor[a]=this._startColor.r,e.startColor[a+1]=this._startColor.g,e.startColor[a+2]=this._startColor.b,e.startColor[a+3]=this._startColor.a,e.elapsedTime[s]=0,e.lifetime[s]=this._lifetime,e.dt[s]=0,e.birthTime[s]=this._birthTimeOffset,e.startFrame[s]=this._startFrame,e.texSheetOffsetX[s]=this.texSheetOffsetX,e.texSheetOffsetY[s]=this.texSheetOffsetY,e.texSheetScaleX[s]=this.texSheetScaleX,e.texSheetScaleY[s]=this.texSheetScaleY,e.seed[s]=M.nextInteger()}copy(t){this._t.copy(t._t),this._r.copy(t._r),this._s.copy(t._s),this._rotation3D.copy(t._rotation3D),this._startSize3D.copy(t._startSize3D),this._startRotationAxis.copy(t._startRotationAxis),this._animatedVelocity.copy(t._animatedVelocity),this._velocity.copy(t._velocity),this._tmpScale.copy(t._tmpScale),this._angularVelocity.copy(t._angularVelocity),this._color.copy(t._color),this._startColor.copy(t._startColor),this._texSheetAnimationInitialized=t._texSheetAnimationInitialized,this._elapsedTime=t._elapsedTime,this._lifetime=t._lifetime,this._dt=t._dt,this._birthTime=t._birthTime,this._birthTimeOffset=t._birthTimeOffset,this._startFrame=t._startFrame,this._texSheetOffsetX=t._texSheetOffsetX,this._texSheetOffsetY=t._texSheetOffsetY,this._texSheetScaleX=t._texSheetScaleX,this._texSheetScaleY=t._texSheetScaleY,this._seed=t._seed}get lifePart(){return this._elapsedTime/this._lifetime}get isAlive(){return this._elapsedTime<this._lifetime}get seed(){return this._seed}set seed(t){this._seed=t}get texSheetOffsetX(){return this._texSheetOffsetX}set texSheetOffsetX(t){this._texSheetOffsetX=t}get texSheetOffsetY(){return this._texSheetOffsetY}set texSheetOffsetY(t){this._texSheetOffsetY=t}get startFrame(){return this._startFrame}set startFrame(t){this._startFrame=t}get startColor(){return this._startColor}set startColor(t){this._startColor=t}get color(){return this._color}set color(t){this._color=t}get birthTime(){return this._birthTime}set birthTime(t){this._birthTime=t}get dt(){return this._dt}set dt(t){this._dt=t}get lifetime(){return this._lifetime}set lifetime(t){this._lifetime=t}get elapsedTime(){return this._elapsedTime}set elapsedTime(t){this._elapsedTime=t}get animatedVelocity(){return this._animatedVelocity}get velocity(){return this._velocity}set velocity(t){this._velocity=t}get angularVelocity(){return this._angularVelocity}set angularVelocity(t){this._angularVelocity=t}get startRotationAxis(){return this._startRotationAxis}set startRotationAxis(t){this._startRotationAxis=t}get startSize3D(){return this._startSize3D}set startSize3D(t){this._startSize3D=t}get rotation3D(){return this._rotation3D}set rotation3D(t){this._rotation3D=t}get s(){return this._s}set s(t){this._s=t}get r(){return this._r}set r(t){this._r=t}get t(){return this._t}set t(t){this._t=t}get texSheetScaleY(){return this._texSheetScaleY}set texSheetScaleY(t){this._texSheetScaleY=t}get texSheetScaleX(){return this._texSheetScaleX}set texSheetScaleX(t){this._texSheetScaleX=t}}class v{constructor(t){this._shapeModule=t,this._curValue=0,this._prevTime=0}roundToSpread(t,e){return 0===e?t%1:Math.floor(t/e)*e%1}pingPong(t,e){const i=Math.floor(t/e),s=t-e*i;return i%2==0?s:1-s}getNextPosition(){const t=x,e=1/this._shapeModule._ps.emission.rateOverTime.evaluate(this._shapeModule._ps.lifePart,0);let i=this._shapeModule._ps.lifetime;this._prevTime>i&&(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<e;t++)a=4*t,H.setSeed(r[t]),this._color.evaluateInplace(W,s[t],H.nextFloat()),i[a]*=W.r,i[a+1]*=W.g,i[a+2]*=W.b,i[a+3]*=W.a;else for(let t=0;t<e;t++)a=4*t,this._color.evaluateInplace(W,s[t],0),i[a]*=W.r,i[a+1]*=W.g,i[a+2]*=W.b,i[a+3]*=W.a}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get color(){return this._color}set color(t){this._color=t}get counterName(){return m.d.PARTICLES_COLOR_OVER_LIFETIME}}class ${constructor(){this._value=0,TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"IntAccumulator")}update(t){this._value+=t}take(t){this._value>=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;e<this._burstCount;++e)t[e]=this._bursts[e];return this._burstCount}getBurst(t){return this._bursts[t]}handleParticleSystemLoop(){const t=this._emission;for(let e=0;e<t.bursts.length;++e)t.bursts[e].recalculateRepeatCount(),t.bursts[e].resetTimeToFire()}recalculateBurstData(){for(let t=0;t<this._bursts.length;++t){const e=this._bursts[t];null!==e.timeToFire&&void 0!==e.timeToFire||(e.recalculateRepeatCount(),e.timeToFire=e.time)}}reinitBurstData(){for(let t=0;t<this._bursts.length;++t){const e=this._bursts[t];e.recalculateRepeatCount(),e.timeToFire=e.time}}getParticlesFromBursts(t){let e=0;for(let i=0;i<this._bursts.length;++i){const s=this._bursts[i];s.timeToFire-=t,s.shouldFire&&s.timeToFire<0&&(e+=s.count.evaluate(this._ps.lifePart,0),s.timeToFire=s.repeatInterval,s.repeatCount-=1)}return e}update(t,e){this.recalculateBurstData();const i=this.getParticlesFromBursts(t),s=this._ps._entity.worldTransform.getTranslation();this.previousPosition||(this.previousPosition=s.clone());const r=s.clone().sub(this.previousPosition).length();this.previousPosition=s;const a=i+this.rateOverDistance.evaluate(t,0)*r;if(this._accumulator.update(a),this._ps.main.maxParticles<=this._ps.particleCount)return this._lastSpawnTime_rate=this._ps._playTime,0;const n=Math.min(this._accumulator.accumulated,this._ps.main.maxParticles-this._ps.particleCount);this._accumulator.take(n);for(let t=0;t<n;++t)this._ps.createParticle(e,0);const l=1/this.rateOverTime.evaluate(this._ps.lifePart,0);for(;this._lastSpawnTime_rate+l<this._ps._playTime;){if(this._ps.main.maxParticles<=this._ps.particleCount)return this._lastSpawnTime_rate+=t,0;const i=this._ps._playTime-this._lastSpawnTime_rate-l;this._lastSpawnTime_rate+=l,this._ps.createParticle(e,i)}return 0}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get rateOverTime(){return this._rateOverTime}set rateOverTime(t){this._rateOverTime=t}get rateOverTimeMultiplier(){return this._rateOverTime.curveMultiplier}set rateOverTimeMultiplier(t){this._rateOverTime.curveMultiplier=t}get rateOverDistance(){return this._rateOverDistance}set rateOverDistance(t){this._rateOverDistance=t}get rateOverDistanceMultiplier(){return this._rateOverDistance.curveMultiplier}set rateOverDistanceMultiplier(t){this._rateOverDistance.curveMultiplier=t}get burstCount(){return this._burstCount}set burstCount(t){this._burstCount=t}get bursts(){return this._bursts}set bursts(t){this._bursts=t}get lastSpawnTime_rate(){return this._lastSpawnTime_rate}set lastSpawnTime_rate(t){this._lastSpawnTime_rate=t}get accumulator(){return this._accumulator}set accumulator(t){this._accumulator=t}get emission(){return this._emission}set emission(t){this._emission=t}get previousPosition(){return this._previousPosition}set previousPosition(t){this._previousPosition=t}get m_Bursts(){return this._bursts}set m_Bursts(t){this._burstCount=t.length,this._bursts=t}get counterName(){return m.d.PARTICLES_EMITTER}}const K=new s.m,tt=new r;class et{constructor(t){this._ps=t,this._enabled=!1,this._mode=UnityEngine.ParticleSystemInheritVelocityMode.Initial,this._curve=new D(null,null,null),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"InheritVelocity")}processInplace(t){if(this._ps.main.simulationSpace!==UnityEngine.ParticleSystemSimulationSpace.World)return;if(this._mode===UnityEngine.ParticleSystemInheritVelocityMode.Initial)return;const e=t.aliveCount,i=t.animatedVelocity,s=t.lifePart,r=t.seed;let a=0,n=0,l=0;K.copy(this._ps.currentVelocity);for(let t=0;t<e;t++)a=3*t,n=s[t],tt.setSeed(r[t]),l=this._curve.evaluate(n,tt.nextFloat()),i[a]+=K.x*l,i[a+1]+=K.y*l,i[a+2]+=K.z*l}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get mode(){return this._mode}set mode(t){this._mode=t}get curve(){return this._curve}set curve(t){this._curve=t}get curveMultiplier(){return this._curve.curveMultiplier}set curveMultiplier(t){this._curve.curveMultiplier=t}get counterName(){return m.d.PARTICLES_INHERIT_VELOCITY}}const it=new s.m,st=new s.m,rt=new s.m,at=new s.m;class nt{constructor(t){this._ps=t,this._enabled=!1,this._separateAxes=!1,this._limit=new D(null,null,null),this._limitX=new D(null,null,null),this._limitY=new D(null,null,null),this._limitZ=new D(null,null,null),this._space=0,this._dampen=0,this._drag=new D(null,null,null),this._multiplyDragByParticleSize=!1,this._multiplyDragByParticleVelocity=!1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"LimitVelocityOverLifetime")}applyDamp(t,e){const i=Math.sign(t);let r=Math.abs(t);return r>e&&(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;t<i;t++)h=3*t,c=n[t],e.setSeed(o[t]),u=1,_=s[h]+r[h],d=s[h+1]+r[h+1],p=s[h+2]+r[h+2],m=Math.sqrt(_*_+d*d+p*p),st.x=r[h],st.y=r[h+1],st.z=r[h+2],rt.x=l[h],rt.y=l[h+1],rt.z=l[h+2],y=a[t],c=n[t],S=this._drag.evaluate(c,e.nextFloat()),this._multiplyDragByParticleSize&&this._multiplyDragByParticleVelocity?(u=this.getScaleModifier(rt),st.scale(1-S*u*m*y)):this._multiplyDragByParticleSize?(u=this.getScaleModifier(rt),st.x=Math.sign(st.x)*Math.max(Math.abs(st.x)-S*u*y,0),st.y=Math.sign(st.y)*Math.max(Math.abs(st.y)-S*u*y,0),st.z=Math.sign(st.z)*Math.max(Math.abs(st.z)-S*u*y,0)):this._multiplyDragByParticleVelocity?st.scale(1-S*m*y):(st.x=Math.sign(st.x)*Math.max(Math.abs(st.x)-S*y,0),st.y=Math.sign(st.y)*Math.max(Math.abs(st.y)-S*y,0),st.z=Math.sign(st.z)*Math.max(Math.abs(st.z)-S*y,0)),r[h]=st.x,r[h+1]=st.y,r[h+2]=st.z}getScaleModifier(t){const e=Math.max(t.x,t.y,t.z);return Math.PI*e*e/4}processInplace(t){this.applyDragInplace(t);const e=t.aliveCount,i=t.animatedVelocity,s=t.velocity,r=t.lifePart,a=t.seed;let n=0,l=0;const o=this._ps._random,h=UnityEngine.ParticleSystemSimulationSpace.World,c=this._ps.entity.worldTransformInverse;for(let t=0;t<e;t++){if(n=3*t,l=r[t],o.setSeed(a[t]),at.x=i[n]+s[n],at.y=i[n+1]+s[n+1],at.z=i[n+2]+s[n+2],this._separateAxes)it.x=this._limitX.evaluate(l,o.nextFloat()),it.y=this._limitY.evaluate(l,o.nextFloat()),it.z=this._limitZ.evaluate(l,o.nextFloat());else{const t=this._limit.evaluate(l,o.nextFloat());it.x=t,it.y=t,it.z=t}if(this._space===h&&c.transformVector(it,it),this._separateAxes)Math.abs(at.x)>it.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;t<i;t++){if(h=3*t,c=a[t],u=r[t],e.setSeed(o[t]),this._scrollValue+=u*this._scrollSpeed.evaluate(c,e.nextFloat()),_=4*(0,s.q)(0,5*c/this.frequency%255),d=4*(0,s.q)(.33,5*c/this.frequency%255),p=4*(0,s.q)(.66,5*c/this.frequency%255),ot.set(0,0,0),m=this._positionAmount.evaluate(c,e.nextFloat()),this.separateAxes)ot.x=this._strengthX.evaluate(c,e.nextFloat()),ot.y=this._strengthY.evaluate(c,e.nextFloat()),ot.z=this._strengthZ.evaluate(c,e.nextFloat());else{const t=this._strengthX.evaluate(c,e.nextFloat());ot.x=t,ot.y=t,ot.z=t}ot.x*=_*m,ot.y*=d*m,ot.z*=p*m,this.damping&&ot.scale(1/this.frequency),l[h]+=ot.x,l[h+1]+=ot.y,l[h+2]+=ot.z;const i=1+.5*(this.damping?_*this.sizeAmount.evaluate(c,e.nextFloat())/this.frequency:_*this.sizeAmount.evaluate(c,e.nextFloat()));n[h]*=i,n[h+1]*=i,n[h+2]*=i}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=t}get strength(){return this._strengthX}set strength(t){this._strengthX=t}get strengthX(){return this._strengthX}set strengthX(t){this._strengthX=t}get strengthY(){return this._strengthY}set strengthY(t){this._strengthY=t}get strengthZ(){return this._strengthZ}set strengthZ(t){this._strengthZ=t}get strengthMultiplier(){return this._strengthX.curveMultiplier}set strengthMultiplier(t){this._strengthX.curveMultiplier=t}get strengthXMultiplier(){return this._strengthX.curveMultiplier}set strengthXMultiplier(t){this._strengthX.curveMultiplier=t}get strengthYMultiplier(){return this._strengthY.curveMultiplier}set strengthYMultiplier(t){this._strengthY.curveMultiplier=t}get strengthZMultiplier(){return this._strengthZ.curveMultiplier}set strengthZMultiplier(t){this._strengthZ.curveMultiplier=t}get frequency(){return this._frequency}set frequency(t){this._frequency=t}get damping(){return this._damping}set damping(t){this._damping=t}get octaveCount(){return this._octaveCount}set octaveCount(t){this._octaveCount=t}get octaveMultiplier(){return this._octaveMultiplier}set octaveMultiplier(t){this._octaveMultiplier=t}get octaveScale(){return this._octaveScale}set octaveScale(t){this._octaveScale=t}get quality(){return this._quality}set quality(t){this._quality=t}get scrollSpeed(){return this._scrollSpeed}set scrollSpeed(t){this._scrollSpeed=t}get scrollSpeedMultiplier(){return this._scrollSpeed.curveMultiplier}set scrollSpeedMultiplier(t){this._scrollSpeed.curveMultiplier=t}get remapEnabled(){return this._remapEnabled}set remapEnabled(t){this._remapEnabled=t}get remap(){return this._remapX}set remap(t){this._remapX=t}get remapX(){return this._remapX}set remapX(t){this._remapX=t}get remapY(){return this._remapY}set remapY(t){this._remapY=t}get remapZ(){return this._remapZ}set remapZ(t){this._remapZ=t}get remapMultiplier(){return this._remapX.curveMultiplier}set remapMultiplier(t){this._remapX.curveMultiplier=t}get remapXMultiplier(){return this._remapX.curveMultiplier}set remapXMultiplier(t){this._remapX.curveMultiplier=t}get remapYMultiplier(){return this._remapY.curveMultiplier}set remapYMultiplier(t){this._remapY.curveMultiplier=t}get remapZMultiplier(){return this._remapZ.curveMultiplier}set remapZMultiplier(t){this._remapZ.curveMultiplier=t}get positionAmount(){return this._positionAmount}set positionAmount(t){this._positionAmount=t}get rotationAmount(){return this._rotationAmount}set rotationAmount(t){this._rotationAmount=t}get sizeAmount(){return this._sizeAmount}set sizeAmount(t){this._sizeAmount=t}get scrollValue(){return this._scrollValue}set scrollValue(t){this._scrollValue=t}get counterName(){return m.d.PARTICLES_NOISE}}const ct=new s.m,ut=new r,_t=new s.m;class dt{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._separateAxes=!1,this._range=new s.l,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemRotationBySpeed")}getRotationAmountConst(t,e,i,s){return e.evaluate(0,s)}getRotationAmount(t,e,i,s){let r=0;return i>t.range.y?r=1:i<t.range.x?r=0: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;t<e;t++)l=3*t,ut.setSeed(n[t]),ct.x=r[l]+a[l],ct.y=r[l+1]+a[l+1],ct.z=r[l+2]+a[l+2],o=ct.length(),this._separateAxes?(_t.x=h(this,this._x,o,ut.nextFloat())*s.k,_t.y=h(this,this._y,o,ut.nextFloat())*s.k,_t.z=h(this,this._z,o,ut.nextFloat())*s.k):(_t.x=0,_t.y=0,_t.z=h(this,this._z,o,ut.nextFloat())*s.k),i[l]+=_t.x,i[l+1]+=_t.y,i[l+2]+=_t.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 separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=t}get range(){return this._range}set range(t){this._range=t}get counterName(){return m.d.PARTICLES_ROTATION_BY_SPEED}}const pt=new s.m;class mt{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._separateAxes=!1,this._range=new s.l,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemSizeBySpeed")}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=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;t<i;t++)l=3*t,e.setSeed(n[t]),h=r[l]+a[l+1],c=r[l+1]+a[l+2],u=r[l+2]+a[l+3],_=Math.sqrt(h*h+c*c+u*u),d=_>this._range.y?1:_<this._range.x?0:(_-this._range.x)/(this._range.y-this._range.x),this._separateAxes?(pt.x=this._x.evaluate(d,e.nextFloat()),pt.y=this._y.evaluate(d,e.nextFloat()),pt.z=this._z.evaluate(d,e.nextFloat())):(o=this._x.evaluate(d,e.nextFloat()),pt.x=o,pt.y=o,pt.z=o),s[l]*=pt.x,s[l+1]*=pt.y,s[l+2]*=pt.z}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get size(){return this._x}set size(t){this._x=t}get sizeMultiplier(){return this._x.curveMultiplier}set sizeMultiplier(t){this._x.curveMultiplier=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 range(){return this._range}set range(t){this._range=t}get separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=t}get counterName(){return m.d.PARTICLES_SIZE_BY_SPEED}}const yt=new s.m;class St{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._separateAxes=!1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemSizeOverLifetime")}processInplace(t){const e=this._ps._random,i=t.aliveCount,s=t.lifePart,r=t.s,a=t.seed;let n=0,l=0,o=0;for(let t=0;t<i;t++)n=3*t,l=s[t],e.setSeed(a[t]),this._separateAxes?(yt.x=this._x.evaluate(l,e.nextFloat()),yt.y=this._y.evaluate(l,e.nextFloat()),yt.z=this._z.evaluate(l,e.nextFloat())):(o=this._x.evaluate(l,e.nextFloat()),yt.x=o,yt.y=o,yt.z=o),r[n]*=yt.x,r[n+1]*=yt.y,r[n+2]*=yt.z}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._ps.setActiveModule(this,t)}get size(){return this._x}set size(t){this._x=t}get sizeMultiplier(){return this._x.curveMultiplier}set sizeMultiplier(t){this._x.curveMultiplier=t}get separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=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 counterName(){return m.d.PARTICLES_SIZE_OVER_LIFETIME}}class gt{constructor(t){this._ps=t,this._enabled=!1,this._mode=UnityEngine.ParticleSystemAnimationMode.Grid,this._frameOverTime=new D(null,null,null),this._animation=UnityEngine.ParticleSystemAnimationType.SingleRow,this._numTilesX=0,this._numTilesY=0,this._cycleCount=0,this._flipU=0,this._flipV=0,this._rowIndex=0,this._spriteCount=0,this._useRandomRow=!1,this._startFrame=new D(null,null,null),this._sprites=null,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemTextureSheetAnimation")}processGridMode(t){const e=this._ps._random,i=this.getFramesCount(),s=t.aliveCount,r=t.startFrame,a=t.texSheetOffsetX,n=t.texSheetOffsetY,l=t.lifePart,o=t.seed;let h=0,c=0,u=0;const _=UnityEngine.ParticleSystemAnimationType.SingleRow;for(let t=0;t<s;t++)h=l[t],c=r[t],e.setSeed(o[t]),u=Math.floor(this._frameOverTime.evaluate(h,e.nextFloat())*i*this._cycleCount)+c,this._animation===_||(u%=this._numTilesX*this._numTilesY,n[t]=Math.floor(u/this._numTilesX)),a[t]=u%this._numTilesX}processSpriteMode(t){const e=this._ps._random,i=this.sprites.length,s=t.aliveCount,r=t.startFrame,a=t.lifePart,n=t.seed;let l=0,o=0,h=0;const c=t.texSheetOffsetX,u=t.texSheetOffsetY,_=t.texSheetScaleX,d=t.texSheetScaleY,p=t.s;for(let t=0;t<s;t++){l=a[t],o=r[t],e.setSeed(n[t]),h=Math.floor((this._frameOverTime.evaluate(l,e.nextFloat())*i*this._cycleCount+o)%i);const s=this.getSprite(h);if(null===s)break;const m=s.handle.getTextureRectWithTransparency(),y=s.handle.getTextureRectWithoutTransparency(),S=s.texture;_[t]=y.size.x/S.width,d[t]=y.size.y/S.height,c[t]=y.position.x/(S.width*_[t]),u[t]=y.position.y/(S.height*d[t]),p[3*t]*=y.size.x/m.m_Width,p[3*t+1]*=y.size.y/m.m_Height}}processInplace(t){this._mode===UnityEngine.ParticleSystemAnimationMode.Grid?this.processGridMode(t):this._mode===UnityEngine.ParticleSystemAnimationMode.Sprites&&this.processSpriteMode(t)}checkIsSpriteFromSameAtlas(t,e){const i=t[0];if(i&&i){return i.texture.name===e.texture.name}return!1}addSprite(t){if(this._sprites.length>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;s<t.length;s++){if(e=i===t[s].texture.name,!e)return void console.error("Sprites you trying to add are from different sprite atlases")}}this._sprites=t}get counterName(){return m.d.PARTICLES_TEXTURE_SHEET_ANIMATION}}var Mt=i(3);const xt=new s.m,ft=new s.m,vt=new s.m,Tt=new r;class At{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._orbitalX=new D(null,null,null),this._orbitalY=new D(null,null,null),this._orbitalZ=new D(null,null,null),this._orbitalOffsetX=new D(null,null,null),this._orbitalOffsetY=new D(null,null,null),this._orbitalOffsetZ=new D(null,null,null),this._radial=new D(null,null,null),this._speedModifier=new D(null,null,null),this._space=UnityEngine.ParticleSystemSimulationSpace.World,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemVelocityOverLifetime")}processInplace(t){xt.x=xt.y=xt.z=0,this._ps.shape&&this._ps.shape.enabled&&xt.copy(this._ps.shape.position);const e=t.aliveCount,i=t.animatedVelocity,r=t.lifePart,a=t.t,n=t.seed;let l=0,o=0;const h=t.dt,c=new s.m,u=new s.m,_=new s.m;let d=0;const p=new s.m,m=new s.m,y=new s.h,S=UnityEngine.ParticleSystemSimulationSpace.World,g=this._ps.entity.worldTransformInverse;for(let t=0;t<e;t++){l=3*t,o=r[t],Tt.setSeed(n[t]),p.set(this.orbitalX.evaluate(o,Tt.nextFloat()),this.orbitalY.evaluate(o,Tt.nextFloat()),this.orbitalZ.evaluate(o,Tt.nextFloat())),0===p.x&&0===p.y&&0===p.z||(m.set(this.orbitalOffsetX.evaluate(o,Tt.nextFloat()),this.orbitalOffsetY.evaluate(o,Tt.nextFloat()),this.orbitalOffsetZ.evaluate(o,Tt.nextFloat())),p.scale(h[t]),y.setFromEulerAngles(p.x,p.y,p.z),c.set(a[l],a[l+1],a[l+2]),c.sub(m),y.transformVector(c,u),_.set(u.x-c.x,u.y-c.y,u.z-c.z),d=h[t]>Mt.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;a<e.length;++a)r[a]=e[a];return r}get(t){return this._particles.length<=t&&this._particles.length<this.maxParticles?null:this._particles[t]}acquire(){if(this.aliveCount>this.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;t<a.length;t++){const i=a[t],s=i.count.getMaxValue();r+=0===i.cycleCount?Math.max(s*(1/i.repeatInterval)*e,s):Math.min(s*(1/i.repeatInterval)*e,s*i.cycleCount)}let n=i+s+r;return n=Math.ceil(n),n}decompose(){if(this._decomposedToObjects)return;this.resizeDecomposed(this._capacity);let t=0,e=0,i=0,s=null;for(t=0;t<this._aliveCount;t++)e=3*t,i=4*t,s=this._particles[t],s._cacheIndex=t,s.t.x=this._t[e],s.t.y=this._t[e+1],s.t.z=this._t[e+2],s.r.x=this._r[i],s.r.y=this._r[i+1],s.r.z=this._r[i+2],s.r.w=this._r[i+3],s.s.x=this._s[e],s.s.y=this._s[e+1],s.s.z=this._s[e+2],s.rotation3D.x=this._rotation3D[e],s.rotation3D.y=this._rotation3D[e+1],s.rotation3D.z=this._rotation3D[e+2],s.startSize3D.x=this._startSize3D[e],s.startSize3D.y=this._startSize3D[e+1],s.startSize3D.z=this._startSize3D[e+2],s.startRotationAxis.x=this._startRotationAxis[e],s.startRotationAxis.y=this._startRotationAxis[e+1],s.startRotationAxis.z=this._startRotationAxis[e+2],s.angularVelocity.x=this._angularVelocity[e],s.angularVelocity.y=this._angularVelocity[e+1],s.angularVelocity.z=this._angularVelocity[e+2],s.velocity.x=this._velocity[e],s.velocity.y=this._velocity[e+1],s.velocity.z=this._velocity[e+2],s.animatedVelocity.x=this._animatedVelocity[e],s.animatedVelocity.y=this._animatedVelocity[e+1],s.animatedVelocity.z=this._animatedVelocity[e+2],s.elapsedTime=this._elapsedTime[t],s.lifetime=this._lifetime[t],s.dt=this._dt[t],s.birthTime=this._birthTime[t],s.color.r=this._color[i],s.color.g=this._color[i+1],s.color.b=this._color[i+2],s.color.a=this._color[i+3],s.startColor.r=this._startColor[i],s.startColor.g=this._startColor[i+1],s.startColor.b=this._startColor[i+2],s.startColor.a=this._startColor[i+3],s.startFrame=this._startFrame[t],s.texSheetOffsetX=this._texSheetOffsetX[t],s.texSheetOffsetY=this._texSheetOffsetY[t],s.texSheetScaleX=this._texSheetScaleX[t],s.texSheetScaleY=this._texSheetScaleY[t],s.seed=this._seed[t];for(let t=this._aliveCount;t<this._particles.length;t++)this._particles[t].elapsedTime=this._particles[t].lifetime;this._decomposedToObjects=!0}recompose(){let t=0,e=0,i=0,s=null;for(t=0;t<this._aliveCount;t++)e=3*t,i=4*t,s=this._particles[t],s._cacheIndex=t,this._t[e]=s.t.x,this._t[e+1]=s.t.y,this._t[e+2]=s.t.z,this._r[i]=s.r.x,this._r[i+1]=s.r.y,this._r[i+2]=s.r.z,this._r[i+3]=s.r.w,this._s[e]=s.s.x,this._s[e+1]=s.s.y,this._s[e+2]=s.s.z,this._rotation3D[e]=s.rotation3D.x,this._rotation3D[e+1]=s.rotation3D.y,this._rotation3D[e+2]=s.rotation3D.z,this._startSize3D[e]=s.startSize3D.x,this._startSize3D[e+1]=s.startSize3D.y,this._startSize3D[e+2]=s.startSize3D.z,this._startRotationAxis[e]=s.startRotationAxis.x,this._startRotationAxis[e+1]=s.startRotationAxis.y,this._startRotationAxis[e+2]=s.startRotationAxis.z,this._angularVelocity[e]=s.angularVelocity.x,this._angularVelocity[e+1]=s.angularVelocity.y,this._angularVelocity[e+2]=s.angularVelocity.z,this._velocity[e]=s.velocity.x,this._velocity[e+1]=s.velocity.y,this._velocity[e+2]=s.velocity.z,this._animatedVelocity[e]=s.animatedVelocity.x,this._animatedVelocity[e+1]=s.animatedVelocity.y,this._animatedVelocity[e+2]=s.animatedVelocity.z,this._elapsedTime[t]=s.elapsedTime,this._lifetime[t]=s.lifetime,this._lifePart[t]=s.lifePart,this._dt[t]=s.dt,this._birthTime[t]=s.birthTime,this._color[i]=s.color.r,this._color[i+1]=s.color.g,this._color[i+2]=s.color.b,this._color[i+3]=s.color.a,this._startColor[i]=s.startColor.r,this._startColor[i+1]=s.startColor.g,this._startColor[i+2]=s.startColor.b,this._startColor[i+3]=s.startColor.a,this._startFrame[t]=s.startFrame,this._texSheetOffsetX[t]=s.texSheetOffsetX,this._texSheetOffsetY[t]=s.texSheetOffsetY,this._texSheetScaleX[t]=s.texSheetScaleX,this._texSheetScaleY[t]=s.texSheetScaleY,this._seed[t]=s.seed}resizeDecomposed(t){if(t=Math.min(Math.max(t,1),this.maxParticles),this._particles.length<t){const e=new Array(t);let i=0;for(i=0;i<this._particles.length;++i)e[i]=this._particles[i];for(i=0;i<t;++i)e[i]=new f;this._particles=e}}get maxParticles(){return this._maxParticles}set maxParticles(t){this._maxParticles=t}get aliveCount(){return this._aliveCount}set aliveCount(t){this._aliveCount=t}get seed(){return this._seed}set seed(t){this._seed=t}get texSheetOffsetX(){return this._texSheetOffsetX}set texSheetOffsetX(t){this._texSheetOffsetX=t}get texSheetOffsetY(){return this._texSheetOffsetY}set texSheetOffsetY(t){this._texSheetOffsetY=t}get startFrame(){return this._startFrame}set startFrame(t){this._startFrame=t}get birthTime(){return this._birthTime}set birthTime(t){this._birthTime=t}get dt(){return this._dt}set dt(t){this._dt=t}get lifetime(){return this._lifetime}set lifetime(t){this._lifetime=t}get elapsedTime(){return this._elapsedTime}set elapsedTime(t){this._elapsedTime=t}get startColor(){return this._startColor}set startColor(t){this._startColor=t}get color(){return this._color}set color(t){this._color=t}get animatedVelocity(){return this._animatedVelocity}set animatedVelocity(t){this._animatedVelocity=t}get velocity(){return this._velocity}set velocity(t){this._velocity=t}get angularVelocity(){return this._angularVelocity}set angularVelocity(t){this._angularVelocity=t}get startRotationAxis(){return this._startRotationAxis}set startRotationAxis(t){this._startRotationAxis=t}get startSize3D(){return this._startSize3D}set startSize3D(t){this._startSize3D=t}get rotation3D(){return this._rotation3D}set rotation3D(t){this._rotation3D=t}get s(){return this._s}set s(t){this._s=t}get r(){return this._r}set r(t){this._r=t}get t(){return this._t}set t(t){this._t=t}get lifePart(){return this._lifePart}set lifePart(t){this._lifePart=t}get decomposedToObjects(){return this._decomposedToObjects}set decomposedToObjects(t){this._decomposedToObjects=t}get texSheetScaleY(){return this._texSheetScaleY}set texSheetScaleY(t){this._texSheetScaleY=t}get texSheetScaleX(){return this._texSheetScaleX}set texSheetScaleX(t){this._texSheetScaleX=t}}const bt=new s.m,zt=new r,Pt=new s.m;class Rt{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._separateAxes=!1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemRotationOverLifetime")}processInplace(t){const e=t.aliveCount,i=t.angularVelocity,r=t.startRotationAxis,a=t.lifePart,n=t.seed;let l=0,o=0;for(let t=0;t<e;t++)l=3*t,o=a[t],zt.setSeed(n[t]),bt.x=r[l],bt.y=r[l+1],bt.z=r[l+2],this._separateAxes?(Pt.x=this._x.evaluate(o,zt.nextFloat())*s.k,Pt.y=this._y.evaluate(o,zt.nextFloat())*s.k,Pt.z=this._z.evaluate(o,zt.nextFloat())*s.k):(Pt.x=0,Pt.y=0,Pt.z=this._z.evaluate(o,zt.nextFloat())*s.k),i[l]+=Pt.x,i[l+1]+=Pt.y,i[l+2]+=Pt.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 separateAxes(){return this._separateAxes}set separateAxes(t){this._separateAxes=t}get counterName(){return m.d.PARTICLES_ROTATION_OVER_LIFETIME}}const Et=new s.m,Ct=new r;class Ot{constructor(t){this._ps=t,this._enabled=!1,this._x=new D(null,null,null),this._y=new D(null,null,null),this._z=new D(null,null,null),this._space=0,this._randomized=!1,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ForceOverLifetime")}processInplace(t){const e=t.aliveCount,i=t.velocity,s=t.lifePart,r=t.dt;let a=0,n=0,l=0;const o=UnityEngine.ParticleSystemSimulationSpace.World;for(let h=0;h<e;h++){a=3*h,n=s[h],l=r[h];const e=this._randomized?this._ps._random.nextInteger():t.seed[h];Ct.setSeed(e),Et.x=this._x.evaluate(n,Ct.nextFloat()),Et.y=this._y.evaluate(n,Ct.nextFloat()),Et.z=this._z.evaluate(n,Ct.nextFloat()),this._space===o&&this._ps.entity.worldTransformInverse.transformVector(Et,Et),Et.scale(l),i[a]+=Et.x,i[a+1]+=Et.y,i[a+2]+=Et.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 space(){return this._space}set space(t){this._space=t}get randomized(){return this._randomized}set randomized(t){this._randomized=t}get counterName(){return m.d.PARTICLES_FORCE_OVER_LIFETIME}}var Ft=i(2);const Dt=new r,Vt={translation:new s.m,rotation:new s.j,rotation3D:new s.m,startRotationAxis:new s.m,scale:new s.m,direction:new s.m,velocity:new s.m,lifetime:0,color:new s.d,birthTimeOffset:0,startFrame:0,texSheetOffsetX:0,texSheetOffsetY:0,texSheetScaleX:1,texSheetScaleY:1},It={res:!1,withChildren:!1,restart:!1,fixedTimeStep:!1,time:0},Ut=new s.j,Xt=new s.m,Yt=new s.i,Lt=new s.m,kt=new s.m,Nt=new s.m,Bt=new s.m,Zt=new s.j,jt=new s.m;let qt=null;function Gt(t,e){return qt.get(Object.getPrototypeOf(t))-qt.get(Object.getPrototypeOf(e))}function Wt(t,e){e.res=e.res&&t.isAlive(!1)}function Ht(t){t.stop(!1,!1)}function Qt(t){t.play(!1)}function $t(t,e){t.simulate(e.time,e.withChildren,e.restart,e.fixedTimeStep)}var Jt=i(5);let Kt=null,te=null;const ee=new s.m;let ie=new s.m;const se=new s.m,re=new s.m,ae=new Float32Array([-.5,-.5,0,1,1,1,1,0,0,-.5,.5,0,1,1,1,1,0,1,.5,.5,0,1,1,1,1,1,1,.5,-.5,0,1,1,1,1,1,0]),ne=new Float32Array([-.5,-1,0,1,1,1,1,1,0,-.5,0,0,1,1,1,1,0,0,.5,0,0,1,1,1,1,0,1,.5,-1,0,1,1,1,1,1,1]),le=new Uint16Array([0,1,2,2,3,0]),oe=[{semantic:Ft.c.SEMANTIC_POSITION,components:3,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_COLOR,components:4,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_TEXCOORD0,components:2,type:Ft.c.TYPE_FLOAT32}],he=[{semantic:Ft.c.SEMANTIC_TEXCOORD5,components:3,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_TEXCOORD6,components:4,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_TEXCOORD7,components:3,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_ATTR0,components:4,type:Ft.c.TYPE_FLOAT32},{semantic:Ft.c.SEMANTIC_ATTR1,components:4,type:Ft.c.TYPE_FLOAT32}];class ce extends m.j{constructor(t){super(t),this.id="particleSystemRenderer"}}var ue=i(12);class _e extends ue.a{constructor(){super(),this.code=UnityEngine.Object.FromHandle(UnityEngine.ParticleSystemRenderer,this),this._particleSystemRenderer=new pc.ParticleSystemRenderer,this._particleSystemRenderer._model=this._model,this._meshCount=0,this._activeVertexStreamsCount=0,this._cameraVelocityScale=0,this._normalDirection=0,this._sortingFudge=0,this._minParticleSize=0,this._maxParticleSize=.5,this._pivot=new s.m,this["__UnityEngine.ParticleSystemRenderer"]=null,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemRendererComponent")}update(t,e){this.particleSystemRenderer.render(t,e)}onEnable(){return!!super.onEnable()&&(m.a.getApplication().scene.addRenderer(this),!0)}onDisable(){return!!super.onDisable()&&(m.a.getApplication().scene.removeRenderer(this),!0)}get meshInstances(){return this.model.meshInstances}get particleSystemRenderer(){return this._particleSystemRenderer}set particleSystemRenderer(t){this._particleSystemRenderer=t}get renderMode(){return this.particleSystemRenderer.renderMode}set renderMode(t){this.particleSystemRenderer.renderMode=t}get alignment(){return this.particleSystemRenderer.alignment}set alignment(t){this.particleSystemRenderer.alignment=t}set mesh(t){this.particleSystemRenderer.mesh=t}get mesh(){return this.particleSystemRenderer.mesh}set lengthScale(t){this.particleSystemRenderer.lengthScale=t}set velocityScale(t){this.particleSystemRenderer.velocityScale=t}set sortMode(t){this.particleSystemRenderer.sortMode=t}get pivot(){return this._pivot}set pivot(t){this._pivot=t}get maxParticleSize(){return this._maxParticleSize}set maxParticleSize(t){this._maxParticleSize=t}get minParticleSize(){return this._minParticleSize}set minParticleSize(t){this._minParticleSize=t}get sortingFudge(){return this._sortingFudge}set sortingFudge(t){this._sortingFudge=t}get normalDirection(){return this._normalDirection}set normalDirection(t){this._normalDirection=t}get cameraVelocityScale(){return this._cameraVelocityScale}set cameraVelocityScale(t){this._cameraVelocityScale=t}get activeVertexStreamsCount(){return this._activeVertexStreamsCount}set activeVertexStreamsCount(t){this._activeVertexStreamsCount=t}get meshCount(){return this._meshCount}set meshCount(t){this._meshCount=t}}class de extends m.k{constructor(t){super(),this.counters=m.d.instance,this._particleSystem=t.particleSystem,this._renderer=null,this["__UnityEngine.ParticleSystem"]=null,pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemComponent")}_fetchRenderer(){const t=this.entity._unityComponents.particleSystemRenderer[0];return t?(this._particleSystem.renderer=t,t):null}_queuesToSubscribe(){return["onUpdate"]}onAttached(){super.onAttached(),this._particleSystem._entity=this.entity,this._renderer||(this._renderer=this._fetchRenderer())}onAwake(){super.onAwake(),this._particleSystem._entity=this.entity,this._renderer||(this._renderer=this._fetchRenderer())}onEnable(){return!!super.onEnable()&&(this._particleSystem.main.playOnAwake&&this._particleSystem.play(!0),!0)}onDestroy(){return this._particleSystem._cache.dispose(),!!super.onDestroy()&&(this._renderer&&!this._renderer._destroyed&&(this._renderer.enabled&&(this._renderer.enabled=!1),this._renderer.destroy(),this._renderer=null),!0)}onUpdate(t){this._renderer||(this._renderer=this._fetchRenderer()),this._particleSystem.update(t,this.entity.getWorldTransform()),this._renderer&&this._renderer.enabled&&(this.counters.startSubSection(m.d.PARTICLES_RENDERER),this._renderer.update(this._particleSystem,t),this.counters.endSubSection(m.d.PARTICLES_RENDERER))}onDisable(){return!!super.onDisable()&&(this._particleSystem.stop(!0,UnityEngine.ParticleSystemStopBehavior.StopEmittingAndClear),!0)}}class pe extends m.j{constructor(t){super(t),this.id="particlesystem",this.performanceSamplerSection=m.d.PARTICLES,TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystemSystem")}}pc.ParticleSystem=class{constructor(){this._entity=null,this._renderer=null,this._useAutoRandomSeed=!0,this._randomSeed=0,this._random=new r,this._cache=new wt(this,0),this._shouldEmit=!1,this._paused=!1,this._lifetime=0,this._playTime=0,this._delayTimer=0,this._emittedCount=0,this._previousPosition=new s.m,this._currentVelocity=new s.m,this._scaleFactor=new s.m,this._events=new Ft.a(this),this._colorBySpeed=new g(this),this._colorOverLifetime=new Q(this),this._emission=new J(this),this._main=new lt(this),this._rotationBySpeed=new dt(this),this._rotationOverLifetime=new Rt(this),this._shape=new G(this),this._sizeBySpeed=new mt(this),this._sizeOverLifetime=new St(this),this._textureSheetAnimation=new gt(this),this._velocityOverLifetime=new At(this),this._noise=new ht(this),this._inheritVelocity=new et(this),this._forceOverLifetime=new Ot(this),this._limitVelocityOverLifetime=new nt(this),this._activeModulesSet=new Set,this._activeModules=[],qt||(qt=new Map,qt.set(et.prototype,0),qt.set(Ot.prototype,1),qt.set(At.prototype,2),qt.set(Q.prototype,3),qt.set(g.prototype,4),qt.set(Rt.prototype,5),qt.set(dt.prototype,6),qt.set(St.prototype,7),qt.set(mt.prototype,8),qt.set(gt.prototype,9),qt.set(ht.prototype,10),qt.set(nt.prototype,11)),pc.markParticleSystemModuleAsUsed(),TESTS&&pc.hiddenShapeValidator.addObjectToValidationSet(this,"ParticleSystem")}setActiveModule(t,e){e?this._activeModulesSet.add(t):this._activeModulesSet.delete(t),t._enabled=e,this._activeModules.length=0;for(const t of this._activeModulesSet)this._activeModules.push(t);this._activeModules.sort(Gt)}isAlive(t){return It.res=this.isActive,this.doOnChildren(t,Wt,It),It.res}clear(){this._cache.clear()}stop(t,e){if(this.isActive){switch(t=void 0===t||t,e=void 0===e?UnityEngine.ParticleSystemStopBehavior.StopEmitting:e){case UnityEngine.ParticleSystemStopBehavior.StopEmittingAndClear:this._shouldEmit=!1,this.clear();break;case UnityEngine.ParticleSystemStopBehavior.StopEmitting:default:this._shouldEmit=!1}this.doOnChildren(t,Ht,It),this.checkStopAction()}}pause(){this._paused=!0}play(t){this._paused?this._paused=!1:(this._shouldEmit=!0,this._paused=!1,this._lifetime=0,this._delayTimer=0,this._playTime=0,this._cache.aliveCount=0,this.emission.lastSpawnTime_rate=0,this.emission.reinitBurstData(),t=void 0===t||t,this.doOnChildren(t,Qt,It),this.main.prewarm&&this.prewarm())}prewarm(){m.d.instance.startSection(m.d.PARTICLES);const t=this.main.startLifetime.evaluate(this.lifePart,0);this.runSimulation(t,!0),m.d.instance.endSection(m.d.PARTICLES)}simulate(t,e,i,s){m.d.instance.startSection(m.d.PARTICLES),i&&this.stop(e,UnityEngine.ParticleSystemStopBehavior.StopEmittingAndClear),this._paused=!1,this.isActive||this.play(!1),this.runSimulation(t,s),this.pause(),It.time=t,It.withChildren=e,It.restart=i,It.fixedTimeStep=s,this.doOnChildren(e,$t,It),m.d.instance.endSection(m.d.PARTICLES)}runSimulation(t,e){const i=e?UnityEngine.Time.fixedDeltaTime:1/30,s=this.entity.getWorldTransform();let r=0,a=0;for(;r<t;)a=Math.min(t-r,i),this.update(a,s),r+=a}updateCurrentVelocity(t){const e=this.entity._unityComponents.rigidbody[0];this.main.emitterVelocityMode===UnityEngine.ParticleSystemEmitterVelocityMode.Rigidbody&&e?this._currentVelocity.copy(e.velocity):(Lt.copy(this.entity.getPosition()),this._currentVelocity.copy(Lt).sub(this._previousPosition).scale(1/t),this._previousPosition.copy(Lt))}createParticle(t,e){Vt.translation.copy(s.m.ZERO),Vt.rotation.copy(s.j.IDENTITY),Vt.rotation3D.copy(s.m.ZERO),Vt.scale.copy(s.m.ONE);const i=this._cache.acquire();if(null===i)return;++this._emittedCount;const r=this.lifePart;this.shape&&this.shape.enabled?(this.startModuleCounter(this.shape.counterName),this.shape.applyNextTransform(Vt.translation,Vt.rotation3D,Vt.direction,Vt.startRotationAxis),this.endModuleCounter(this.shape.counterName)):(Vt.direction.set(0,0,1),Vt.startRotationAxis.set(0,0,1)),this.main.simulationSpace===UnityEngine.ParticleSystemSimulationSpace.World&&(t.transformPoint(Vt.translation,Vt.translation),t.transformVector(Vt.direction,Vt.direction),Vt.direction.normalize());const a=this.renderer.renderMode;a!==UnityEngine.ParticleSystemRenderMode.Stretch&&(this.main.startRotation3D?(Vt.rotation3D.x+=this.main.startRotationX.evaluate(r,Dt.nextFloat())*s.k,Vt.rotation3D.y+=this.main.startRotationY.evaluate(r,Dt.nextFloat())*s.k,Vt.rotation3D.z+=this.main.startRotationZ.evaluate(r,Dt.nextFloat())*s.k):(Vt.rotation3D.x+=0,Vt.rotation3D.y+=0,Vt.rotation3D.z+=this.main.startRotationZ.evaluate(r,Dt.nextFloat())*s.k,a===UnityEngine.ParticleSystemRenderMode.Billboard?Vt.startRotationAxis.copy(Vt.rotation.transformVector(s.m.FORWARD)).normalize():Vt.startRotationAxis.normalize(),Ut.setFromAxisAngle(Vt.startRotationAxis,Vt.rotation3D.z))),this.main.startSize3D?(Vt.scale.x=this.main.startSizeX.evaluate(r,Dt.nextFloat()),Vt.scale.y=this.main.startSizeY.evaluate(r,Dt.nextFloat()),Vt.scale.z=this.main.startSizeZ.evaluate(r,Dt.nextFloat())):Vt.scale.copy(s.m.ONE).scale(this.main.startSize.evaluate(r,Dt.nextFloat()));const n=Math.abs(this.main.startSpeed.evaluate(r,Dt.nextFloat()));Vt.velocity.copy(Vt.direction).scale(n);const l=this._inheritVelocity;if(l.enabled&&l.mode===UnityEngine.ParticleSystemInheritVelocityMode.Initial){const t=l.curve.evaluate(0,Dt.nextFloat());kt.copy(this.currentVelocity).scale(t),Vt.velocity.add(kt)}this.main.startColor.evaluateInplace(Vt.color,r,Dt.nextFloat()),Vt.lifetime=this.main.startLifetime.evaluate(r,Dt.nextFloat()),Vt.birthTimeOffset=e;const o=this.textureSheetAnimation;o.enabled&&(Vt.startFrame=o.startFrame.evaluate(r,0)*o.getFramesCount(),o.animation===UnityEngine.ParticleSystemAnimationType.SingleRow&&(Vt.texSheetOffsetY=o.useRandomRow?Dt.nextInteger()%o.numTilesY:o.rowIndex)),this._cache.initializeNewParticle(Vt,i)}_updateParticles(t,e){const i=this._cache.aliveCount;if(0===i)return;this._cache.decomposedToObjects=!1,this.main.simulationSpace===UnityEngine.ParticleSystemSimulationSpace.Local?Yt.copy(e).invert():Yt.copy(s.i.IDENTITY),this._updateScaleFactor(),this._updateGravityDelta(t,Yt,Xt);const r=this._cache.dt,a=this._cache.birthTime,n=this._cache.velocity,l=this._cache.animatedVelocity;let o=0,h=0,c=0;for(c=0;c<i;c++){const e=a[c];0!==e?(r[c]=e,a[c]=0):r[c]=t,o=3*c,l[o]=0,l[o+1]=0,l[o+2]=0}const u=this._cache.s,_=this._cache.startSize3D;if(this.sizeBySpeed.enabled||this.sizeOverLifetime.enabled||this._noise.enabled||this._textureSheetAnimation&&this._textureSheetAnimation._mode===UnityEngine.ParticleSystemAnimationMode.Sprites)for(c=0;c<i;c++)o=3*c,u[o]=_[o],u[o+1]=_[o+1],u[o+2]=_[o+2];const d=this._cache.angularVelocity;for((this.rotationOverLifetime.enabled||this.rotationBySpeed.enabled)&&d.fill(0),c=0;c<i;c++)o=3*c,n[o]+=Xt.x,n[o+1]+=Xt.y,n[o+2]+=Xt.z;const p=this._cache._totalVelocity,m=this._cache.color,y=this._cache.startColor;for(c=0;c<i;c++)h=4*c,m[h]=y[h],m[h+1]=y[h+1],m[h+2]=y[h+2],m[h+3]=y[h+3];for(let t=0;t<this._activeModules.length;t++){const e=this._activeModules[t],i=e.counterName;this.startModuleCounter(i),e.processInplace(this._cache),this.endModuleCounter(i)}for(c=0;c<i;c++)o=3*c,p[o]=n[o]+l[o],p[o+1]=n[o+1]+l[o+1],p[o+2]=n[o+2]+l[o+2];if(this.velocityOverLifetime.enabled){const t=this.velocityOverLifetime._speedModifier,e=this._cache.lifePart;let s=0,r=0;for(c=0;c<i;c++)r=e[c],s=t.evaluate(r,Dt.nextFloat()),o=3*c,p[o]*=s,p[o+1]*=s,p[o+2]*=s}const S=this._scaleFactor;for(c=0;c<i;c++)o=3*c,p[o]*=S.x,p[o+1]*=S.y,p[o+2]*=S.z;const g=this._cache.t;for(c=0;c<i;c++)o=3*c,g[o]+=p[o]*r[c],g[o+1]+=p[o+1]*r[c],g[o+2]+=p[o+2]*r[c];const M=this.renderer.renderMode,x=UnityEngine.Camera.main,f=new s.m,v=x?x.handle.entity.forward:new s.m(0,0,1);v.normalize();const T=new s.m,A=this._cache.r,w=this._cache.rotation3D,b=this._cache.startRotationAxis;for(c=0;c<i;c++){o=3*c,h=4*c,Nt.x=w[o],Nt.y=w[o+1],Nt.z=w[o+2];const t=r[c];if(jt.x=d[o]*t,jt.y=d[o+1]*t,jt.z=d[o+2]*t,Nt.add(jt),w[o]=Nt.x,w[o+1]=Nt.y,w[o+2]=Nt.z,Bt.x=b[o],Bt.y=b[o+1],Bt.z=b[o+2],M===UnityEngine.ParticleSystemRenderMode.Stretch)T.x=p[o],T.y=p[o+1],T.z=p[o+2],T.normalize(),f.cross(T,v),f.cross(f,T),Zt.setLookAt(v,T);else if(M===UnityEngine.ParticleSystemRenderMode.Billboard)this.renderer.alignment===UnityEngine.ParticleSystemRenderSpace.View?Zt.setFromEulerAngles_Unity(Nt.x,Nt.y,-Nt.z):Zt.setFromEulerAngles_Unity(-Nt.x,-Nt.y,-Nt.z);else if(M===UnityEngine.ParticleSystemRenderMode.Mesh){this.rotationBySpeed.enabled&&this.rotationBySpeed.separateAxes||this.rotationOverLifetime.enabled&&this.rotationOverLifetime.separateAxes||this.main.startRotation3D||this.shape.alignToDirection?Zt.setFromEulerAngles_Unity(Nt.x,Nt.y,Nt.z):Zt.setFromAxisAngle(Bt,Nt.z)}A[h]=Zt.x,A[h+1]=Zt.y,A[h+2]=Zt.z,A[h+3]=Zt.w}const z=this._cache.elapsedTime,P=this._cache.lifePart,R=this._cache.lifetime;for(c=0;c<i;c++)z[c]+=r[c],P[c]=z[c]/R[c]}_updateGravityDelta(t,e,i){const s=this.main.gravityModifier.evaluate(this.lifePart,0);i.copy(UnityEngine.Physics.gravity),i.scale(s).scale(t),e.transformVector(i,i),this.main.scalingMode===UnityEngine.ParticleSystemScalingMode.Local&&this.main.simulationSpace===UnityEngine.ParticleSystemSimulationSpace.Local&&this._entity.parent&&i.mul(this._entity.parent.getLossyScale())}_updateScaleFactor(){this._scaleFactor.copy(s.m.ONE),this.main.scalingMode===UnityEngine.ParticleSystemScalingMode.Hierarchy?this._scaleFactor.copy(this.entity.getLossyScale()):this.main.scalingMode===UnityEngine.ParticleSystemScalingMode.Local&&this._scaleFactor.copy(this.entity.getLocalScale())}emit(t){m.d.instance.startSection(m.d.PARTICLES);const e=(0,s.o)(t,0,this.main.maxParticles-this._cache.aliveCount);if(e>0){const t=this.entity.getWorldTransform();for(let i=0;i<e;++i)this.createParticle(t,0)}m.d.instance.endSection(m.d.PARTICLES)}update(t,e){if(!this.isActive||this._paused)return;m.d.instance.recordParticleSystem(),m.d.instance.recordParticles(this._cache.aliveCount);let i=t;i*=this.main.simulationSpeed,this.main.useUnscaledTime||(i*=UnityEngine.Time.timeScale),this._delayTimer<this.main.startDelay.evaluate(0,0)?this._delayTimer+=i:(this._lifetime+=i,this._playTime+=i,this._lifetime>this.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;s<t.length;s++){const r=t[s]._unityComponents.particlesystem[0];r&&e(r._particleSystem,i)}}}getParticles(t){if(!t)return null;this._cache.decompose();const e=Math.min(this._cache.aliveCount,t.length);for(let i=0;i<e;i++)t[i].Handle.copy(this._cache.get(i));return e}setParticles(t,e){if(!t)return;m.d.instance.startSection(m.d.PARTICLES),this._cache.decompose();const i=Math.min(this.main.maxParticles,e,t.length);for(let e=0;e<i;e++){const i=this._cache.get(e);i.copy(t[e].Handle),i.s=t[e].startSize3D}const r=this.entity.getWorldTransform();this.main.simulationSpace===UnityEngine.ParticleSystemSimulationSpace.Local?Yt.copy(r).invert():Yt.copy(s.i.IDENTITY),this._updateGravityDelta(0,Yt,Xt),this._cache.recompose(),this._updateParticles(0,r),m.d.instance.endSection(m.d.PARTICLES)}checkStopAction(){if(!this.isActive)switch(this.main.stopAction){case UnityEngine.ParticleSystemStopAction.None:break;case UnityEngine.ParticleSystemStopAction.Disable:this.entity.enabled=!1;break;case UnityEngine.ParticleSystemStopAction.Destroy:new pc.DestroyEntityTask(this.entity,0).execute();break;case UnityEngine.ParticleSystemStopAction.Callback:for(let t=0;t<this.entity._unityComponents.monoBehaviour.length;t++){this.entity._unityComponents.monoBehaviour[t].onParticleSystemStopped()}break;default:throw new Error('Stop action "'+this.main.stopAction+'" not supported')}}get renderer(){return this._renderer||(this._renderer=this.entity._unityComponents.particleSystemRenderer[0]),this._renderer}set renderer(t){this._renderer=t}get isActive(){return this._shouldEmit||this._cache.aliveCount>0}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;_<M;_++){const t=o*_;d=3*_,m=e.t[d],y=e.t[d+1],S=e.t[d+2];const i=e.s[d],s=e.s[d+1],r=e.s[d+2],n=Math.sqrt(i*i+s*s+r*r);se.x=Math.min(se.x,m-n),se.y=Math.min(se.y,y-n),se.z=Math.min(se.z,S-n),re.x=Math.max(re.x,m+n),re.y=Math.max(re.y,y+n),re.z=Math.max(re.z,S+n),a[t+0]=m,a[t+1]=y,a[t+2]=S}for(_=0;_<M;_++){const t=o*_;p=4*_,a[t+3]=e.r[p],a[t+4]=e.r[p+1],a[t+5]=e.r[p+2],a[t+6]=e.r[p+3]}if(n)for(_=0;_<M;_++){const t=o*_;d=3*_,m=e.velocity[d]+e.animatedVelocity[d],y=e.velocity[d+1]+e.animatedVelocity[d+1],S=e.velocity[d+2]+e.animatedVelocity[d+2],g=Math.sqrt(m*m+y*y+S*S),a[t+7]=e.s[d],a[t+8]=e.s[d+1]*this.lengthScale+g*this.velocityScale,a[t+9]=e.s[d+2]}else for(_=0;_<M;_++){const t=o*_;d=3*_,a[t+7]=e.s[d],a[t+8]=e.s[d+1],a[t+9]=e.s[d+2]}for(_=0;_<M;_++){const t=o*_;p=4*_,a[t+10]=e.color[p],a[t+11]=e.color[p+1],a[t+12]=e.color[p+2],a[t+13]=e.color[p+3]}if(l)for(_=0;_<M;_++){const t=o*_;h.mode===UnityEngine.ParticleSystemAnimationMode.Grid?(a[t+14]=c,a[t+15]=u,a[t+16]=e.texSheetOffsetX[_],a[t+17]=h.numTilesY-e.texSheetOffsetY[_]-1):(a[t+14]=e.texSheetScaleX[_],a[t+15]=e.texSheetScaleY[_],a[t+16]=e.texSheetOffsetX[_],a[t+17]=e.texSheetOffsetY[_])}else for(_=0;_<M;_++){const t=o*_;a[t+14]=1,a[t+15]=1,a[t+16]=0,a[t+17]=0}for(let e=0;e<i.length;e++){const r=i[e];let a=null;switch(t.main.scalingMode){case UnityEngine.ParticleSystemScalingMode.Hierarchy:a=r.node.getLossyScale();break;case UnityEngine.ParticleSystemScalingMode.Local:a=r.node.getLocalScale();break;case UnityEngine.ParticleSystemScalingMode.Shape:a=s.m.ONE}if(l&&h.mode===UnityEngine.ParticleSystemAnimationMode.Sprites){const t=h.getAtlasTexture();if(null===t)break;this.model.setParameter("_MainTex",t.handle)}this.worldRotationTransform.setTRS(s.m.ZERO,r.node.getRotation(),s.m.ONE),this.worldTranslationTransform.setTRS(r.node.getPosition(),s.j.IDENTITY,s.m.ONE),r.setParameter("matrix_modelRotation",this.worldRotationTransform.data),r.setParameter("matrix_modelTranslation",this.worldTranslationTransform.data),r.setParameter("system_scale",[a.x,a.y,a.z]),r.setParameter("localToWorldMatrix",s.i.IDENTITY.data),this.renderMode===UnityEngine.ParticleSystemRenderMode.Stretch?r.setParameter("renderer_alignment",UnityEngine.ParticleSystemRenderSpace.World):t.shape.enabled&&t.shape.alignToDirection?r.setParameter("renderer_alignment",UnityEngine.ParticleSystemRenderSpace.Local):r.setParameter("renderer_alignment",this.alignment),r.setParameter("worldSimulationSpace",t.main.simulationSpace===UnityEngine.ParticleSystemSimulationSpace.World?1:0),r.parameters._TintColor||!r.material||r.material.parameters._TintColor||r.setParameter("_TintColor",[1,1,1,1]),r.worldAabbOverride||(r.worldAabbOverride=new s.b);const n=r.worldAabbOverride;n.setMinMax(se,re),t.main.simulationSpace!==UnityEngine.ParticleSystemSimulationSpace.World&&(this._worldTranslationTransform.setTRS(r.node.getPosition(),r.node.getRotation(),s.m.ONE),n.setFromTransformedAabb(n,this._worldTranslationTransform))}r.unlock()}changeRenderMode(){switch(this.renderMode){case UnityEngine.ParticleSystemRenderMode.Billboard:case UnityEngine.ParticleSystemRenderMode.Stretch:case UnityEngine.ParticleSystemRenderMode.HorizontalBillboard:case UnityEngine.ParticleSystemRenderMode.VerticalBillboard:this.model.mesh=this._prepareBillboardMesh();break;case UnityEngine.ParticleSystemRenderMode.Mesh:this.model.mesh=this._mesh?this._mesh:null;break;case UnityEngine.ParticleSystemRenderMode.None:this.model.mesh=null}}prepareInstances(){const t=this.model.meshInstances,e=m.a.getApplication();for(let i=0;i<t.length;i++){const s=t[i];s.instancingData=this._prepareInstancingData(),s.constAttributes.COLOR=[1,1,1,1],e.isUrp&&(s.constAttributes.NORMAL=[0,0,-1,1]),s._shaderDefs|=Ft.c.SHADERDEF_PARTICLES_INSTANCING}}updateRenderMode(){this.changeRenderMode(),this.updateMeshInstances()}updateMeshInstances(){this.model.update(),this.prepareInstances()}_prepareInstancingData(){if(!this._instancingData){const t=m.a.getApplication();this._instancingVertexFormat=new Jt.z(t.graphicsDevice,he),this._instancingData={_buffer:new Jt.y(t.graphicsDevice,this._instancingVertexFormat,0,Ft.c.BUFFER_DYNAMIC,new Float32Array(0)),count:0,offset:0}}return this._instancingData}_prepareQuad(t){const e=m.a.getApplication(),i=new Jt.g,s=new Jt.z(e.graphicsDevice,oe);return i.vertexBuffer=new Jt.y(e.graphicsDevice,s,4,Ft.c.BUFFER_STATIC,t),i.indexBuffer[0]=new Jt.c(e.graphicsDevice,Ft.c.INDEXFORMAT_UINT16,6,Ft.c.BUFFER_STATIC,le),i.primitive[0].type=Ft.c.PRIMITIVE_TRIANGLES,i.primitive[0].base=0,i.primitive[0].count=6,i.primitive[0].indexed=!0,i.subMeshes=[i],i}_prepareBillboardMesh(){return null===Kt&&(Kt=this._prepareQuad(ae)),null===te&&(te=this._prepareQuad(ne)),this.renderMode===UnityEngine.ParticleSystemRenderMode.Stretch?te:Kt}_resizeInstancingBuffer(t){this._instancingData&&(t>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;t<e;t++)s[t]._cacheIndex=t;t.recompose()}sortByDistance(t,e){if(!t.isAlive)return 1;if(!e.isAlive)return-1;const i=m.a.getApplication().getMainCamera().node.position;ee.copy(t.t).sub(i).add(ie);const s=ee.lengthSq();ee.copy(e.t).sub(i).add(ie);return s-ee.lengthSq()}sortOldestInFront(t,e){return t.isAlive?e.isAlive?t.elapsedTime-e.elapsedTime:-1:1}sortYoungestInFront(t,e){return t.isAlive?e.isAlive?e.elapsedTime-t.elapsedTime:-1:1}render(t,e){const i=t._cache;i.aliveCount>0&&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()}]); |