Skip to content

ParticleSystem

继承自 Component

ParticleSystem类用于创建和管理粒子系统。

可以通过以下方式获取ParticleSystem组件:

typescript
let obj = new GameObject();
let com = obj.AddComponent<ParticleSystem>(ParticleSystem);

成员变量

ParticleSystem.emissionModuleBurstsCount : number
发射器模块的突发计数。
ParticleSystem.playState : PlayState
(只读)播放状态。
ParticleSystem.initialModuleMaxParticles : number
要发射的最大粒子。
ParticleSystem.startDelay : PSCurve
启动延迟曲线。
ParticleSystem.delayAllLoop : boolean
是否延迟粒子系统在每个循环中的启动时间。
ParticleSystem.useScaledTime : boolean
是否使用缩放后的delta时间。
ParticleSystem.velocityModuleLinearVelocityY : PSCurve
y轴上线性控制粒子速度的曲线。
ParticleSystem.initialModuleUse3DRotation : boolean
是否启用3D粒子旋转。
ParticleSystem.looping : boolean
粒子系统是否循环。
ParticleSystem.renderModulePivot : Vector3
旋转粒子的枢轴点。
ParticleSystem.randomSeed : number
粒子系统的随机种子。
ParticleSystem.shapeModuleAlignToDirection : boolean
是否根据粒子的初始行进方向对齐粒子。
ParticleSystem.duration : number
粒子系统的持续时间。
ParticleSystem.initialModuleRotationZ : PSCurve
粒子发射时围绕z轴的初始旋转。
ParticleSystem.simulationSpeed : number
粒子模拟速度。
ParticleSystem.velocityModuleOffsetX : PSCurve
指定以X轨道和径向速度的自定义旋转中心。
ParticleSystem.sizeByVelocityModuleSpeedRange : Vector2
大小曲线之间的最小和最大速度。
ParticleSystem.autoRandomSeed : boolean
是否使用自动随机种子。
ParticleSystem.simulationSpace : PSSimulationSpace
模拟粒子空间。
ParticleSystem.renderModuleSortMode : PSSortMode
粒子的排序模式。
ParticleSystem.shapeModuleRotation : Vector3
发射器的旋转。
ParticleSystem.velocityModuleOrbitalVelocityX : PSCurve
围绕 x 轴根据寿命控制粒子速度的曲线。
ParticleSystem.playOnAwake : boolean
是否在启动时自动播放。
ParticleSystem.shapeModuleSpherizeDirection : number
粒子从起点沿球形运动的方向。
ParticleSystem.velocityModuleOffsetZ : PSCurve
指定以Z轨道和径向速度的自定义旋转中心。
ParticleSystem.simulationSpaceCustom : Transform
自定义粒子模拟空间。
ParticleSystem.initialModuleSizeY : PSCurve
粒子系统首次生成粒子时沿y轴的初始大小。
ParticleSystem.emitterVelocityMode : PSEmitterVelocityMode
粒子系统发射器速度模块发射器速度模式。
ParticleSystem.shapeModuleAngle : number
发射粒子的锥体角度。
ParticleSystem.emitterVelocityCustom : Vector3
发射器速度的自定义值。
ParticleSystem.scalingMode : PSScalingMode
粒子的缩放模式。
ParticleSystem.initialModuleLifetime : PSCurve
粒子初始生命周期曲线。
ParticleSystem.velocityModuleOrbitalVelocityZ : PSCurve
围绕 z 轴根据寿命控制粒子速度的曲线。
ParticleSystem.initialModuleSpeed : PSCurve
粒子系统首次生成粒子时的初始大小。
ParticleSystem.forceModuleSpace : PSForceSpace
粒子系统力场空间。
ParticleSystem.initialModuleColor : PSGradient
初始最小-最大颜色渐变。
ParticleSystem.initialModuleSizeX : PSCurve
粒子系统首次生成粒子时沿x轴的初始大小。
ParticleSystem.shapeModuleRandomizeDirection : number
随机化粒子的起始方向。
ParticleSystem.initialModuleSizeZ : PSCurve
粒子系统首次生成粒子时沿z轴的初始大小。
ParticleSystem.velocityModuleLinearVelocityX : PSCurve
x 轴上线性控制粒子速度的曲线。
ParticleSystem.initialModuleRotationX : PSCurve
粒子发射时围绕x轴的初始旋转。
ParticleSystem.initialModuleRotationY : PSCurve
粒子发射时围绕y轴的初始旋转。
ParticleSystem.shapeModuleLength : number
发射锥体的长度。
ParticleSystem.shapeModuleRadius : any
发射器的直径。
ParticleSystem.renderModuleCameraScale : number
根据相机速度的拉伸。
ParticleSystem.initialModuleFlipRotation : number
翻转旋转。
ParticleSystem.rotationModuleAngularVelocityX : PSCurve
旋转速度x轴角速度。
ParticleSystem.shapeModuleDonutRadius : number
发射粒子的甜甜圈的厚度。
ParticleSystem.initialModuleUse3DSize : boolean
是否启用3D尺寸。
ParticleSystem.emissionModuleEnable : boolean
是否启用发射器模块。
ParticleSystem.emissionModuleRateOverTime : PSCurve
发射器随时间推移生成新粒子的速率。
ParticleSystem.emissionModuleRateOverDistance : PSCurve
粒子系发射器在距离上生成新粒子的速率。
ParticleSystem.shapeModuleRadiusThickness : number
发射器的形状半径厚度。
ParticleSystem.shapeModuleEnable : boolean
是否启用发行形状模块。
ParticleSystem.shapeModuleBoxThickness : Vector3
发射粒子的盒子的厚度。
ParticleSystem.shapeModulePosition : Vector3
发射器的位置。
ParticleSystem.shapeModuleScale : Vector3
发射器的缩放。
ParticleSystem.shapeModuleType : PSShapeType
发射器的形状类型(Mesh暂时不可用)。
ParticleSystem.shapeModuleStyle : PSShapeStyle
发射方式。
ParticleSystem.velocityLimitationModuleDampen : number
控制对超过速度限制的粒子速度的抑制程度。
ParticleSystem.velocityModuleEnable : boolean
指定 velocityModule 是启用还是禁用。
ParticleSystem.shapeModuleRandomizePosition : number
随机化粒子的起始位置。
ParticleSystem.shapeModuleArc : any
发射粒子的圆弧的角度。
ParticleSystem.velocityModuleVelocitySpace : PSVelocitySpace
指定速度是在本地空间(随变换旋转)还是世界空间。
ParticleSystem.velocityModuleLinearVelocityZ : PSCurve
z 轴上线性控制粒子速度的曲线。
ParticleSystem.velocityModuleOrbitalVelocityY : PSCurve
围绕 y 轴根据寿命控制粒子速度的曲线。
ParticleSystem.velocityModuleSpeedModifier : PSCurve
根据寿命控制粒子速度的曲线,而不影响粒子的方向。
ParticleSystem.velocityModuleRadialVelocity : PSCurve
根据寿命控制粒子速度的曲线,远离中心位置。
ParticleSystem.forceModuleForceY : PSCurve
沿局部Y轴对力场体积内的粒子施加线性力。
ParticleSystem.velocityModuleOffsetY : PSCurve
指定以Y轨道和径向速度的自定义旋转中心。
ParticleSystem.velocityLimitationModuleEnable : boolean
指定 velocityLimitationModule 是启用还是禁用。
ParticleSystem.velocityLimitationModuleSeparateAxes : boolean
分别设置每个轴的速度限制。
ParticleSystem.velocityLimitationModuleVelocitySpace : PSVelocitySpace
指定速度限制是在本地坐标系下(随变换旋转)还是世界坐标系。
ParticleSystem.velocityLimitationModuleVelocity : PSCurve
每个轴不使用一条曲线时的最大速度曲线。
ParticleSystem.velocityLimitationModuleVelocitySeparateX : PSCurve
x 轴的最大速度曲线。
ParticleSystem.velocityLimitationModuleVelocitySeparateY : PSCurve
y 轴的最大速度曲线。
ParticleSystem.velocityLimitationModuleVelocitySeparateZ : PSCurve
z 轴的最大速度曲线。
ParticleSystem.velocityLimitationModuleDrag : PSCurve
控制应用于粒子速度的阻力大小。
ParticleSystem.velocityLimitationModuleDragMultiplyBySize : boolean
根据粒子的大小调整此模块应用于粒子的阻力量。
ParticleSystem.velocityLimitationModuleDragMultiplyByVelocity : boolean
根据粒子的速度调整该模块应用于粒子的阻力量。
ParticleSystem.velocityInheritModuleEnable : boolean
指定 InheritVelocityModule 是启用还是禁用。
ParticleSystem.velocityInheritModuleInheritMode : PSVelocityInheritMode
发射器速度模式。
ParticleSystem.rotationModuleAngularVelocityY : PSCurve
旋转速度y轴角速度。
ParticleSystem.velocityInheritModuleMultiplier : PSCurve
曲线乘数。
ParticleSystem.forceModuleEnable : boolean
使用启用粒子力场模块。
ParticleSystem.forceModuleRandomize : boolean
是否将随机性应用于粒子将四向传播的力场轴。
ParticleSystem.forceModuleForceX : PSCurve
沿局部X轴对力场体积内的粒子施加线性力。
ParticleSystem.forceModuleForceZ : PSCurve
沿局部Z轴对力场体积内的粒子施加线性力。
ParticleSystem.colorModuleEnable : boolean
是否启用粒子整个生命周期颜色。
ParticleSystem.colorModuleColor : PSGradient
粒子整个生命周期颜色最小-最大渐变。
ParticleSystem.colorByVelocityModuleEnable : boolean
是否启用ColorByVelocityModule模块。
ParticleSystem.rotationModuleSeparateAxes : boolean
是否分别控制粒子的三个轴(X、Y、Z)上的旋转随速度的变化。
ParticleSystem.colorByVelocityModuleSpeedRange : Vector2
在这些最小和最大速度之间应用颜色渐变。
ParticleSystem.colorByVelocityModuleColor : PSGradient
ColorByVelocity模块的最小-最大颜色渐变。
ParticleSystem.sizeModuleEnable : boolean
是否启用SizeModule。
ParticleSystem.sizeModuleSeparateAxes : boolean
是否启用每个轴上整个生命周期的大小。
ParticleSystem.sizeModuleSizeX : PSCurve
x轴的尺寸随生命周期曲线.
ParticleSystem.sizeModuleSizeY : PSCurve
y轴的生命周期大小曲线。
ParticleSystem.sizeModuleSizeZ : PSCurve
z轴的生命周期大小曲线。
ParticleSystem.sizeByVelocityModuleEnable : boolean
是否启用SizeByVelocilyModule。
ParticleSystem.sizeByVelocityModuleSeparateAxes : boolean
是否每个轴按速度设置大小。
ParticleSystem.sizeByVelocityModuleSizeX : PSCurve
x轴按速度计算尺寸的曲线。
ParticleSystem.sizeByVelocityModuleSizeY : PSCurve
y轴按速度计算尺寸的曲线。
ParticleSystem.sizeByVelocityModuleSizeZ : PSCurve
z轴按速度计算尺寸的曲线。
ParticleSystem.rotationModuleEnable : boolean
是否启用旋转模块。
ParticleSystem.rotationModuleAngularVelocityZ : PSCurve
旋转角度z轴角速度。
ParticleSystem.rotationByVelocityModuleEnable : boolean
是否启用旋转速度模块。
ParticleSystem.rotationByVelocityModuleSeparateAxes : boolean
每个轴上的速度旋转。
ParticleSystem.rotationByVelocityModuleSpeedRange : Vector2
旋转曲线之间的最小和最大速度。
ParticleSystem.rotationByVelocityModuleAngularVelocityX : PSCurve
X轴旋转角速度。
ParticleSystem.rotationByVelocityModuleAngularVelocityY : PSCurve
Y轴旋转角速度。
ParticleSystem.rotationByVelocityModuleAngularVelocityZ : PSCurve
Y轴旋转角速度。
ParticleSystem.renderModuleEnable : boolean
是否启用粒子系统的渲染模块。
ParticleSystem.renderModuleRenderMode : PSRenderMode
粒子的渲染模式。
ParticleSystem.renderModuleRenderSpace : PSRenderSpace
粒子的渲染空间。
ParticleSystem.renderModuleMaxParticleSize : number
粒子的最大尺寸。
ParticleSystem.renderModuleMinParticleSize : number
粒子的最小尺寸。
ParticleSystem.renderModuleVelocityScale : number
根据粒子方向拉伸的粒子数量。
ParticleSystem.renderModuleLengthScale : number
粒子在器运动方向上拉伸的数值,定于为粒子长的与宽度的比。
ParticleSystem.renderModuleNormalDirection : number
粒子的法线方向。
ParticleSystem.renderModuleFlip : Vector3
围绕各个轴翻转的粒子百分比。
ParticleSystem.renderModuleAllowRoll : boolean
是否允许粒子、广告牌围绕器Z轴旋转。

成员方法

ParticleSystem.Play ( ) : void
播放粒子。
ParticleSystem.Pause ( ) : void
暂停粒子系统。
ParticleSystem.Stop ( value : PSStopBehavior? ) : void
使用提供的停止行为停止播放粒子系统。