mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
particle doc (#4576)
This commit is contained in:
@@ -12,7 +12,7 @@ const COLOR_OVERTIME_RAND_OFFSET = 91041;
|
||||
export default class ColorOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -20,7 +20,7 @@ export default class ColorOvertimeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* 颜色随时间变化的参数,各个 key 之间线性差值变化
|
||||
* @zh 颜色随时间变化的参数,各个 key 之间线性差值变化
|
||||
*/
|
||||
@property({
|
||||
type: GradientRange,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CCClass } from '../../../../core/data';
|
||||
import { ccclass, property } from '../../../../core/data/class-decorator';
|
||||
import { Enum } from '../../../../core/value-types';
|
||||
import { Enum, ValueType } from '../../../../core/value-types';
|
||||
import { lerp } from '../../../../core/vmath';
|
||||
import { AnimationCurve } from '../../../geom-utils';
|
||||
|
||||
@@ -12,39 +12,63 @@ export const Mode = Enum({
|
||||
});
|
||||
|
||||
@ccclass('cc.CurveRange')
|
||||
export default class CurveRange {
|
||||
export default class CurveRange {
|
||||
|
||||
public static Mode = Mode;
|
||||
|
||||
/**
|
||||
* @zh 曲线类型[[Mode]]
|
||||
*/
|
||||
@property({
|
||||
type: Mode,
|
||||
})
|
||||
public mode = Mode.Constant;
|
||||
|
||||
/**
|
||||
* @zh 当mode为Curve时,使用的曲线
|
||||
*/
|
||||
@property({
|
||||
type: AnimationCurve,
|
||||
})
|
||||
public curve = new AnimationCurve();
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoCurves时,使用的曲线下限
|
||||
*/
|
||||
@property({
|
||||
type: AnimationCurve,
|
||||
})
|
||||
public curveMin = new AnimationCurve();
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoCurves时,使用的曲线上限
|
||||
*/
|
||||
@property({
|
||||
type: AnimationCurve,
|
||||
})
|
||||
public curveMax = new AnimationCurve();
|
||||
|
||||
/**
|
||||
* @zh 当mode为Constant时,曲线的值
|
||||
*/
|
||||
@property
|
||||
public constant = 0;
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoConstants时,曲线的上限
|
||||
*/
|
||||
@property
|
||||
public constantMin = 0;
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoConstants时,曲线的下限
|
||||
*/
|
||||
@property
|
||||
public constantMax = 0;
|
||||
|
||||
/**
|
||||
* @zh 应用于曲线插值的系数
|
||||
*/
|
||||
@property
|
||||
public multiplier = 1;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ const _temp_v3 = cc.v3();
|
||||
export default class ForceOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -22,7 +22,7 @@ export default class ForceOvertimeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* X 轴方向上的加速度分量
|
||||
* @zh X 轴方向上的加速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -32,7 +32,7 @@ export default class ForceOvertimeModule {
|
||||
public x = new CurveRange();
|
||||
|
||||
/**
|
||||
* Y 轴方向上的加速度分量
|
||||
* @zh Y 轴方向上的加速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -42,7 +42,7 @@ export default class ForceOvertimeModule {
|
||||
public y = new CurveRange();
|
||||
|
||||
/**
|
||||
* Z 轴方向上的加速度分量
|
||||
* @zh Z 轴方向上的加速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -52,7 +52,7 @@ export default class ForceOvertimeModule {
|
||||
public z = new CurveRange();
|
||||
|
||||
/**
|
||||
* 加速度计算时采用的坐标系
|
||||
* @zh 加速度计算时采用的坐标系 [[Space]]
|
||||
*/
|
||||
@property({
|
||||
type: Space,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CCClass } from '../../../../core/data';
|
||||
import { ccclass, property } from '../../../../core/data/class-decorator';
|
||||
import { Enum } from '../../../../core/value-types';
|
||||
import { Enum, ValueType } from '../../../../core/value-types';
|
||||
import { color4 } from '../../../../core/vmath';
|
||||
import Gradient, { AlphaKey, ColorKey } from './gradient';
|
||||
|
||||
@@ -33,6 +33,9 @@ export default class GradientRange {
|
||||
})
|
||||
private _mode = Mode.Color;
|
||||
|
||||
/**
|
||||
* @zh 渐变色类型 [[Mode]]
|
||||
*/
|
||||
@property({
|
||||
type: Mode,
|
||||
})
|
||||
@@ -54,25 +57,43 @@ export default class GradientRange {
|
||||
this._mode = m;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 当mode为Color时的颜色
|
||||
*/
|
||||
@property
|
||||
public color = cc.Color.WHITE;
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoColors时的颜色下限
|
||||
*/
|
||||
@property
|
||||
public colorMin = cc.Color.WHITE;
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoColors时的颜色上限
|
||||
*/
|
||||
@property
|
||||
public colorMax = cc.Color.WHITE;
|
||||
|
||||
/**
|
||||
* @zh 当mode为Gradient时的颜色渐变
|
||||
*/
|
||||
@property({
|
||||
type: Gradient,
|
||||
})
|
||||
public gradient = new Gradient();
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoGradients时的颜色渐变下限
|
||||
*/
|
||||
@property({
|
||||
type: Gradient,
|
||||
})
|
||||
public gradientMin = new Gradient();
|
||||
|
||||
/**
|
||||
* @zh 当mode为TwoGradients时的颜色渐变上限
|
||||
*/
|
||||
@property({
|
||||
type: Gradient,
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@ const _temp_v3 = cc.v3();
|
||||
export default class LimitVelocityOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -22,7 +22,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* X 轴方向上的速度下限
|
||||
* @zh X 轴方向上的速度下限
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -32,7 +32,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public limitX = new CurveRange();
|
||||
|
||||
/**
|
||||
* Y 轴方向上的速度下限
|
||||
* @zh Y 轴方向上的速度下限
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -42,7 +42,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public limitY = new CurveRange();
|
||||
|
||||
/**
|
||||
* Z 轴方向上的速度下限
|
||||
* @zh Z 轴方向上的速度下限
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -52,7 +52,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public limitZ = new CurveRange();
|
||||
|
||||
/**
|
||||
* 速度下限
|
||||
* @zh 速度下限
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -62,7 +62,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public limit = new CurveRange();
|
||||
|
||||
/**
|
||||
* 当前速度与速度下限的插值
|
||||
* @zh 当前速度与速度下限的插值
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 7,
|
||||
@@ -70,7 +70,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public dampen = 3;
|
||||
|
||||
/**
|
||||
* 是否三个轴分开限制
|
||||
* @zh 是否三个轴分开限制
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
@@ -78,7 +78,7 @@ export default class LimitVelocityOvertimeModule {
|
||||
public separateAxes = false;
|
||||
|
||||
/**
|
||||
* 计算速度下限时采用的坐标系
|
||||
* @zh 计算速度下限时采用的坐标系 [[Space]]
|
||||
*/
|
||||
@property({
|
||||
type: Space,
|
||||
|
||||
@@ -11,7 +11,7 @@ const ROTATION_OVERTIME_RAND_OFFSET = 125292;
|
||||
export default class RotationOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -22,7 +22,7 @@ export default class RotationOvertimeModule {
|
||||
private _separateAxes = false;
|
||||
|
||||
/**
|
||||
* 是否三个轴分开设定旋转(暂不支持)
|
||||
* @zh 是否三个轴分开设定旋转(暂不支持)
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
@@ -41,7 +41,7 @@ export default class RotationOvertimeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕 X 轴设定旋转
|
||||
* @zh 绕 X 轴设定旋转
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -52,7 +52,7 @@ export default class RotationOvertimeModule {
|
||||
public x = new CurveRange();
|
||||
|
||||
/**
|
||||
* 绕 Y 轴设定旋转
|
||||
* @zh 绕 Y 轴设定旋转
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -63,7 +63,7 @@ export default class RotationOvertimeModule {
|
||||
public y = new CurveRange();
|
||||
|
||||
/**
|
||||
* 绕 X 轴设定旋转
|
||||
* @zh 绕 X 轴设定旋转
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
|
||||
@@ -11,7 +11,7 @@ const SIZE_OVERTIME_RAND_OFFSET = 39825;
|
||||
export default class SizeOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -19,7 +19,7 @@ export default class SizeOvertimeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* 决定是否在每个轴上独立控制粒子大小
|
||||
* @zh 决定是否在每个轴上独立控制粒子大小
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
@@ -27,7 +27,7 @@ export default class SizeOvertimeModule {
|
||||
public separateAxes = false;
|
||||
|
||||
/**
|
||||
* 定义一条曲线来决定粒子在其生命周期中的大小变化
|
||||
* @zh 定义一条曲线来决定粒子在其生命周期中的大小变化
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -36,7 +36,7 @@ export default class SizeOvertimeModule {
|
||||
public size = new CurveRange();
|
||||
|
||||
/**
|
||||
* 定义一条曲线来决定粒子在其生命周期中 X 轴方向上的大小变化
|
||||
* @zh 定义一条曲线来决定粒子在其生命周期中 X 轴方向上的大小变化
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -45,7 +45,7 @@ export default class SizeOvertimeModule {
|
||||
public x = new CurveRange();
|
||||
|
||||
/**
|
||||
* 定义一条曲线来决定粒子在其生命周期中 Y 轴方向上的大小变化
|
||||
* @zh 定义一条曲线来决定粒子在其生命周期中 Y 轴方向上的大小变化
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -54,7 +54,7 @@ export default class SizeOvertimeModule {
|
||||
public y = new CurveRange();
|
||||
|
||||
/**
|
||||
* 定义一条曲线来决定粒子在其生命周期中 Z 轴方向上的大小变化
|
||||
* @zh 定义一条曲线来决定粒子在其生命周期中 Z 轴方向上的大小变化
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
|
||||
@@ -48,7 +48,7 @@ export default class TextureAnimationModule {
|
||||
private _enable = false;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -68,7 +68,7 @@ export default class TextureAnimationModule {
|
||||
private _mode = Mode.Grid;
|
||||
|
||||
/**
|
||||
* 设定粒子贴图动画的类型(暂只支持 Grid 模式)
|
||||
* @zh 设定粒子贴图动画的类型(暂只支持 Grid 模式)[[Mode]]
|
||||
*/
|
||||
@property({
|
||||
type: Mode,
|
||||
@@ -86,7 +86,7 @@ export default class TextureAnimationModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* X 方向动画帧数
|
||||
* @zh X 方向动画帧数
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
@@ -94,7 +94,7 @@ export default class TextureAnimationModule {
|
||||
public numTilesX = 0;
|
||||
|
||||
/**
|
||||
* Y 方向动画帧数
|
||||
* @zh Y 方向动画帧数
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 3,
|
||||
@@ -102,7 +102,7 @@ export default class TextureAnimationModule {
|
||||
public numTilesY = 0;
|
||||
|
||||
/**
|
||||
* 动画播放方式
|
||||
* @zh 动画播放方式 [[Animation]]
|
||||
*/
|
||||
@property({
|
||||
type: Animation,
|
||||
@@ -111,7 +111,7 @@ export default class TextureAnimationModule {
|
||||
public animation = Animation.WholeSheet;
|
||||
|
||||
/**
|
||||
* 一个周期内动画播放的帧与时间变化曲线
|
||||
* @zh 一个周期内动画播放的帧与时间变化曲线
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -120,7 +120,7 @@ export default class TextureAnimationModule {
|
||||
public frameOverTime = new CurveRange();
|
||||
|
||||
/**
|
||||
* 从第几帧开始播放,时间为整个粒子系统的生命周期
|
||||
* @zh 从第几帧开始播放,时间为整个粒子系统的生命周期
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -129,7 +129,7 @@ export default class TextureAnimationModule {
|
||||
public startFrame = new CurveRange();
|
||||
|
||||
/**
|
||||
* 一个生命周期内播放循环的次数
|
||||
* @zh 一个生命周期内播放循环的次数
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 9,
|
||||
@@ -139,6 +139,9 @@ export default class TextureAnimationModule {
|
||||
@property
|
||||
private _flipU = 0;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
get flipU () {
|
||||
return this._flipU;
|
||||
}
|
||||
@@ -170,7 +173,7 @@ export default class TextureAnimationModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 随机从动画贴图中选择一行以生成动画
|
||||
* @zh 随机从动画贴图中选择一行以生成动画
|
||||
* 此选项仅在动画播放方式为 SingleRow 时生效
|
||||
*/
|
||||
@property({
|
||||
@@ -179,7 +182,7 @@ export default class TextureAnimationModule {
|
||||
public randomRow = false;
|
||||
|
||||
/**
|
||||
* 从动画贴图中选择特定行以生成动画
|
||||
* @zh 从动画贴图中选择特定行以生成动画
|
||||
* 此选项仅在动画播放方式为 SingleRow 时且禁用 randomRow 时可用
|
||||
*/
|
||||
@property({
|
||||
|
||||
@@ -15,7 +15,7 @@ const _temp_v3 = cc.v3();
|
||||
export default class VelocityOvertimeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -23,7 +23,7 @@ export default class VelocityOvertimeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* X 轴方向上的速度分量
|
||||
* @zh X 轴方向上的速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -33,7 +33,7 @@ export default class VelocityOvertimeModule {
|
||||
public x = new CurveRange();
|
||||
|
||||
/**
|
||||
* Y 轴方向上的速度分量
|
||||
* @zh Y 轴方向上的速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -43,7 +43,7 @@ export default class VelocityOvertimeModule {
|
||||
public y = new CurveRange();
|
||||
|
||||
/**
|
||||
* Z 轴方向上的速度分量
|
||||
* @zh Z 轴方向上的速度分量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -53,7 +53,7 @@ export default class VelocityOvertimeModule {
|
||||
public z = new CurveRange();
|
||||
|
||||
/**
|
||||
* 速度修正系数(只支持 CPU 粒子)
|
||||
* @zh 速度修正系数(只支持 CPU 粒子)
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -63,7 +63,7 @@ export default class VelocityOvertimeModule {
|
||||
public speedModifier = new CurveRange();
|
||||
|
||||
/**
|
||||
* 速度计算时采用的坐标系
|
||||
* @zh 速度计算时采用的坐标系[[Space]]
|
||||
*/
|
||||
@property({
|
||||
type: Space,
|
||||
|
||||
@@ -19,6 +19,9 @@ export class BillboardComponent extends Component {
|
||||
})
|
||||
private _texture = null;
|
||||
|
||||
/**
|
||||
* @zh Billboard纹理
|
||||
*/
|
||||
@property({
|
||||
type: Texture2D,
|
||||
})
|
||||
@@ -36,6 +39,9 @@ export class BillboardComponent extends Component {
|
||||
@property
|
||||
private _height = 0;
|
||||
|
||||
/**
|
||||
* @zh 高度
|
||||
*/
|
||||
@property
|
||||
get height () {
|
||||
return this._height;
|
||||
@@ -52,6 +58,9 @@ export class BillboardComponent extends Component {
|
||||
@property
|
||||
private _width = 0;
|
||||
|
||||
/**
|
||||
* @zh 宽度
|
||||
*/
|
||||
@property
|
||||
public get width () {
|
||||
return this._width;
|
||||
@@ -68,6 +77,9 @@ export class BillboardComponent extends Component {
|
||||
@property
|
||||
private _rotation = 0;
|
||||
|
||||
/**
|
||||
* @zh 角度
|
||||
*/
|
||||
@property
|
||||
public get rotation () {
|
||||
return Math.round(toDegree(this._rotation) * 100) / 100;
|
||||
|
||||
@@ -10,7 +10,7 @@ export default class Burst {
|
||||
private _time: number = 0;
|
||||
|
||||
/**
|
||||
* 粒子系统开始运行到触发此次 Brust 的时间
|
||||
* @zh 粒子系统开始运行到触发此次 Brust 的时间
|
||||
*/
|
||||
@property
|
||||
get time () {
|
||||
@@ -23,13 +23,13 @@ export default class Burst {
|
||||
}
|
||||
|
||||
/**
|
||||
* 发射粒子的最小数量
|
||||
* @zh 发射粒子的最小数量
|
||||
*/
|
||||
@property
|
||||
public minCount: number = 30;
|
||||
|
||||
/**
|
||||
* 发射粒子的最大数量
|
||||
* @zh 发射粒子的最大数量
|
||||
*/
|
||||
@property
|
||||
public maxCount: number = 30;
|
||||
@@ -38,7 +38,7 @@ export default class Burst {
|
||||
private _repeatCount: number = 1;
|
||||
|
||||
/**
|
||||
* Burst 的触发次数
|
||||
* @zh Burst 的触发次数
|
||||
*/
|
||||
@property
|
||||
get repeatCount () {
|
||||
@@ -51,13 +51,13 @@ export default class Burst {
|
||||
}
|
||||
|
||||
/**
|
||||
* 每次触发的间隔时间
|
||||
* @zh 每次触发的间隔时间
|
||||
*/
|
||||
@property
|
||||
public repeatInterval: number = 1;
|
||||
|
||||
/**
|
||||
* 发射的粒子的数量
|
||||
* @zh 发射的粒子的数量
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
|
||||
@@ -16,7 +16,7 @@ const _unitBoxExtent = vec3.create(0.5, 0.5, 0.5);
|
||||
export default class ShapeModule {
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
* @zh 是否启用
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -24,7 +24,7 @@ export default class ShapeModule {
|
||||
public enable = false;
|
||||
|
||||
/**
|
||||
* 粒子发射器类型
|
||||
* @zh 粒子发射器类型 [[ShapeType]]
|
||||
*/
|
||||
@property({
|
||||
type: ShapeType,
|
||||
@@ -33,7 +33,7 @@ export default class ShapeModule {
|
||||
public shapeType = ShapeType.Box;
|
||||
|
||||
/**
|
||||
* 粒子从发射器哪个部位发射
|
||||
* @zh 粒子从发射器哪个部位发射 [[EmitLocation]]
|
||||
*/
|
||||
@property({
|
||||
type: EmitLocation,
|
||||
@@ -45,7 +45,7 @@ export default class ShapeModule {
|
||||
private _position = new Vec3(0, 0, 0);
|
||||
|
||||
/**
|
||||
* 粒子发射器位置
|
||||
* @zh 粒子发射器位置
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 12,
|
||||
@@ -62,7 +62,7 @@ export default class ShapeModule {
|
||||
private _rotation = new Vec3(0, 0, 0);
|
||||
|
||||
/**
|
||||
* 粒子发射器旋转角度
|
||||
* @zh 粒子发射器旋转角度
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 13,
|
||||
@@ -79,7 +79,7 @@ export default class ShapeModule {
|
||||
private _scale = new Vec3(1, 1, 1);
|
||||
|
||||
/**
|
||||
* 粒子发射器缩放比例
|
||||
* @zh 粒子发射器缩放比例
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 14,
|
||||
@@ -93,7 +93,7 @@ export default class ShapeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据粒子的初始方向决定粒子的移动方向
|
||||
* @zh 根据粒子的初始方向决定粒子的移动方向
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 15,
|
||||
@@ -101,7 +101,7 @@ export default class ShapeModule {
|
||||
public alignToDirection = false;
|
||||
|
||||
/**
|
||||
* 粒子生成方向随机设定
|
||||
* @zh 粒子生成方向随机设定
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 16,
|
||||
@@ -109,7 +109,7 @@ export default class ShapeModule {
|
||||
public randomDirectionAmount = 0;
|
||||
|
||||
/**
|
||||
* 表示当前发射方向与当前位置到结点中心连线方向的插值
|
||||
* @zh 表示当前发射方向与当前位置到结点中心连线方向的插值
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 17,
|
||||
@@ -117,7 +117,7 @@ export default class ShapeModule {
|
||||
public sphericalDirectionAmount = 0;
|
||||
|
||||
/**
|
||||
* 粒子生成位置随机设定(设定此值为非 0 会使粒子生成位置超出生成器大小范围)
|
||||
* @zh 粒子生成位置随机设定(设定此值为非 0 会使粒子生成位置超出生成器大小范围)
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 18,
|
||||
@@ -125,7 +125,7 @@ export default class ShapeModule {
|
||||
public randomPositionAmount = 0;
|
||||
|
||||
/**
|
||||
* 粒子发射器半径
|
||||
* @zh 粒子发射器半径
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 3,
|
||||
@@ -133,7 +133,7 @@ export default class ShapeModule {
|
||||
public radius = 1;
|
||||
|
||||
/**
|
||||
* 粒子发射器发射位置(对 Box 类型的发射器无效)<bg>
|
||||
* @zh 粒子发射器发射位置(对 Box 类型的发射器无效)<bg>
|
||||
* 0 表示从表面发射
|
||||
* 1 表示从中心发射
|
||||
* 0 ~ 1 之间表示在中心到表面之间发射
|
||||
@@ -147,7 +147,7 @@ export default class ShapeModule {
|
||||
private _arc = toRadian(360);
|
||||
|
||||
/**
|
||||
* 粒子发射器在一个扇形范围内发射
|
||||
* @zh 粒子发射器在一个扇形范围内发射
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 6,
|
||||
@@ -161,7 +161,7 @@ export default class ShapeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 粒子在扇形范围内的发射方式
|
||||
* @zh 粒子在扇形范围内的发射方式 [[ArcMode]]
|
||||
*/
|
||||
@property({
|
||||
type: ArcMode,
|
||||
@@ -170,7 +170,7 @@ export default class ShapeModule {
|
||||
public arcMode = ArcMode.Random;
|
||||
|
||||
/**
|
||||
* 控制可能产生粒子的弧周围的离散间隔。
|
||||
* @zh 控制可能产生粒子的弧周围的离散间隔。
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -178,7 +178,7 @@ export default class ShapeModule {
|
||||
public arcSpread = 8;
|
||||
|
||||
/**
|
||||
* 粒子沿圆周发射的速度
|
||||
* @zh 粒子沿圆周发射的速度
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -190,7 +190,7 @@ export default class ShapeModule {
|
||||
private _angle = toRadian(25);
|
||||
|
||||
/**
|
||||
* 圆锥的轴与母线的夹角<bg>
|
||||
* @zh 圆锥的轴与母线的夹角<bg>
|
||||
* 决定圆锥发射器的开合程度
|
||||
*/
|
||||
@property({
|
||||
@@ -205,7 +205,7 @@ export default class ShapeModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* 圆锥顶部截面距离底部的轴长<bg>
|
||||
* @zh 圆锥顶部截面距离底部的轴长<bg>
|
||||
* 决定圆锥发射器的高度
|
||||
*/
|
||||
@property({
|
||||
@@ -214,7 +214,7 @@ export default class ShapeModule {
|
||||
public length = 0;
|
||||
|
||||
/**
|
||||
* 粒子发射器发射位置(针对 Box 类型的粒子发射器)
|
||||
* @zh 粒子发射器发射位置(针对 Box 类型的粒子发射器)
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 11,
|
||||
|
||||
@@ -21,6 +21,9 @@ export class LineComponent extends Component {
|
||||
})
|
||||
private _texture = null;
|
||||
|
||||
/**
|
||||
* @zh 显示的纹理
|
||||
*/
|
||||
@property({
|
||||
type: Texture2D,
|
||||
displayOrder: 0,
|
||||
@@ -41,6 +44,9 @@ export class LineComponent extends Component {
|
||||
@property
|
||||
private _worldSpace = false;
|
||||
|
||||
/**
|
||||
* @zh positions是否为世界空间坐标
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
})
|
||||
@@ -64,6 +70,9 @@ export class LineComponent extends Component {
|
||||
})
|
||||
private _positions = [];
|
||||
|
||||
/**
|
||||
* 每段折线的拐点坐标
|
||||
*/
|
||||
@property({
|
||||
type: [Vec3],
|
||||
displayOrder: 2,
|
||||
@@ -84,6 +93,9 @@ export class LineComponent extends Component {
|
||||
})
|
||||
private _width = new CurveRange();
|
||||
|
||||
/**
|
||||
* @zh 线段的宽度
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
displayOrder: 3,
|
||||
@@ -102,6 +114,9 @@ export class LineComponent extends Component {
|
||||
@property
|
||||
private _tile = cc.v2(1, 1);
|
||||
|
||||
/**
|
||||
* @zh 图块数
|
||||
*/
|
||||
@property({
|
||||
type: Vec2,
|
||||
displayOrder: 4,
|
||||
@@ -144,6 +159,9 @@ export class LineComponent extends Component {
|
||||
})
|
||||
private _color = new GradientRange();
|
||||
|
||||
/**
|
||||
* @zh 线段颜色
|
||||
*/
|
||||
@property({
|
||||
type: GradientRange,
|
||||
displayOrder: 6,
|
||||
@@ -159,6 +177,9 @@ export class LineComponent extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
private _model: LineModel | null = null;
|
||||
private _tile_offset: Vec4 = cc.v4();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const _world_mat = mat4.create();
|
||||
export class ParticleSystemComponent extends RenderableComponent {
|
||||
|
||||
/**
|
||||
* 粒子系统能生成的最大粒子数量
|
||||
* @zh 粒子系统能生成的最大粒子数量
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
@@ -50,7 +50,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* 粒子初始颜色
|
||||
* @zh 粒子初始颜色
|
||||
*/
|
||||
@property({
|
||||
type: GradientRange,
|
||||
@@ -59,7 +59,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startColor = new GradientRange();
|
||||
|
||||
/**
|
||||
* 粒子初始大小
|
||||
* @zh 粒子初始大小
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -68,7 +68,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startSize = new CurveRange();
|
||||
|
||||
/**
|
||||
* 粒子初始速度
|
||||
* @zh 粒子初始速度
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -78,7 +78,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startSpeed = new CurveRange();
|
||||
|
||||
/**
|
||||
* 粒子初始旋转角度
|
||||
* @zh 粒子初始旋转角度
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -89,7 +89,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startRotation = new CurveRange();
|
||||
|
||||
/**
|
||||
* 粒子系统开始运行后,延迟粒子发射的时间
|
||||
* @zh 粒子系统开始运行后,延迟粒子发射的时间
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -98,7 +98,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startDelay = new CurveRange();
|
||||
|
||||
/**
|
||||
* 粒子生命周期
|
||||
* @zh 粒子生命周期
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -107,7 +107,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public startLifetime = new CurveRange();
|
||||
|
||||
/**
|
||||
* 粒子系统运行时间
|
||||
* @zh 粒子系统运行时间
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 0,
|
||||
@@ -115,7 +115,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public duration = 5.0;
|
||||
|
||||
/**
|
||||
* 粒子系统是否循环播放
|
||||
* @zh 粒子系统是否循环播放
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
@@ -123,7 +123,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public loop = true;
|
||||
|
||||
/**
|
||||
* 选中之后,粒子系统会以已播放完一轮之后的状态开始播放(仅当循环播放启用时有效)
|
||||
* @zh 选中之后,粒子系统会以已播放完一轮之后的状态开始播放(仅当循环播放启用时有效)
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 3,
|
||||
@@ -140,10 +140,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择粒子系统所在的坐标系<br>
|
||||
* 世界坐标(不随其他物体位置改变而变换)<br>
|
||||
* 局部坐标(跟随父节点位置改变而移动)<br>
|
||||
* 自定坐标(跟随自定义节点的位置改变而移动)
|
||||
* @zh 选择粒子系统所在的坐标系[[Space]]<br>
|
||||
*/
|
||||
@property({
|
||||
type: Space,
|
||||
@@ -162,7 +159,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制整个粒子系统的更新速度
|
||||
* @zh 控制整个粒子系统的更新速度
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 5,
|
||||
@@ -170,7 +167,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public simulationSpeed = 1.0;
|
||||
|
||||
/**
|
||||
* 粒子系统加载后是否自动开始播放
|
||||
* @zh 粒子系统加载后是否自动开始播放
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
@@ -178,7 +175,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public playOnAwake = true;
|
||||
|
||||
/**
|
||||
* 粒子受重力影响的重力系数
|
||||
* @zh 粒子受重力影响的重力系数
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -189,7 +186,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
|
||||
// emission module
|
||||
/**
|
||||
* 每秒发射的粒子数
|
||||
* @zh 每秒发射的粒子数
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -198,7 +195,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public rateOverTime = new CurveRange();
|
||||
|
||||
/**
|
||||
* 每移动单位距离发射的粒子数
|
||||
* @zh 每移动单位距离发射的粒子数
|
||||
*/
|
||||
@property({
|
||||
type: CurveRange,
|
||||
@@ -207,7 +204,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public rateOverDistance = new CurveRange();
|
||||
|
||||
/**
|
||||
* 设定在指定时间发射指定数量的粒子的 Brust 的数量
|
||||
* @zh 设定在指定时间发射指定数量的粒子的 Brust 的数量
|
||||
*/
|
||||
@property({
|
||||
type: [Burst],
|
||||
@@ -232,7 +229,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
|
||||
// color over lifetime module
|
||||
/**
|
||||
* 颜色控制模块
|
||||
* @zh 颜色控制模块
|
||||
*/
|
||||
@property({
|
||||
type: ColorOverLifetimeModule,
|
||||
@@ -241,7 +238,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
|
||||
// shpae module
|
||||
/**
|
||||
* 粒子发射器模块
|
||||
* @zh 粒子发射器模块
|
||||
*/
|
||||
@property({
|
||||
type: ShapeModule,
|
||||
@@ -250,7 +247,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
|
||||
// size over lifetime module
|
||||
/**
|
||||
* 粒子大小模块
|
||||
* @zh 粒子大小模块
|
||||
*/
|
||||
@property({
|
||||
type: SizeOvertimeModule,
|
||||
@@ -258,7 +255,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public sizeOvertimeModule = new SizeOvertimeModule();
|
||||
|
||||
/**
|
||||
* 粒子速度模块
|
||||
* @zh 粒子速度模块
|
||||
*/
|
||||
@property({
|
||||
type: VelocityOvertimeModule,
|
||||
@@ -266,7 +263,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public velocityOvertimeModule = new VelocityOvertimeModule();
|
||||
|
||||
/**
|
||||
* 粒子加速度模块
|
||||
* @zh 粒子加速度模块
|
||||
*/
|
||||
@property({
|
||||
type: ForceOvertimeModule,
|
||||
@@ -274,7 +271,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public forceOvertimeModule = new ForceOvertimeModule();
|
||||
|
||||
/**
|
||||
* 粒子限制速度模块(只支持 CPU 粒子)
|
||||
* @zh 粒子限制速度模块(只支持 CPU 粒子)
|
||||
*/
|
||||
@property({
|
||||
type: LimitVelocityOvertimeModule,
|
||||
@@ -282,7 +279,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public limitVelocityOvertimeModule = new LimitVelocityOvertimeModule();
|
||||
|
||||
/**
|
||||
* 粒子旋转模块
|
||||
* @zh 粒子旋转模块
|
||||
*/
|
||||
@property({
|
||||
type: RotationOvertimeModule,
|
||||
@@ -290,7 +287,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public rotationOvertimeModule = new RotationOvertimeModule();
|
||||
|
||||
/**
|
||||
* 贴图动画模块
|
||||
* @zh 贴图动画模块
|
||||
*/
|
||||
@property({
|
||||
type: TextureAnimationModule,
|
||||
@@ -298,7 +295,7 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
public textureAnimationModule = new TextureAnimationModule();
|
||||
|
||||
/**
|
||||
* 粒子轨迹模块
|
||||
* @zh 粒子轨迹模块
|
||||
*/
|
||||
@property({
|
||||
type: TrailModule,
|
||||
@@ -311,6 +308,9 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
})
|
||||
public renderer: ParticleSystemRenderer = new ParticleSystemRenderer();
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
private _isPlaying: boolean;
|
||||
private _isPaused: boolean;
|
||||
private _isStopped: boolean;
|
||||
@@ -460,10 +460,16 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
this.trailModule.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 获取当前
|
||||
*/
|
||||
public getParticleCount () {
|
||||
return this.renderer!.getParticleCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
public setCustomData1 (x, y) {
|
||||
vec2.set(this._customData1, x, y);
|
||||
}
|
||||
@@ -639,6 +645,9 @@ export class ParticleSystemComponent extends RenderableComponent {
|
||||
this.bursts.splice(this.bursts.indexOf(idx), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
get isPlaying () {
|
||||
return this._isPlaying;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ const _vertex_attrs_mesh = [
|
||||
export default class ParticleSystemRenderer {
|
||||
|
||||
/**
|
||||
* 设定粒子生成模式
|
||||
* @zh 设定粒子生成模式
|
||||
*/
|
||||
@property({
|
||||
type: RenderMode,
|
||||
@@ -84,7 +84,7 @@ export default class ParticleSystemRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按速度大小进行拉伸
|
||||
* @zh 在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按速度大小进行拉伸
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 1,
|
||||
@@ -100,7 +100,7 @@ export default class ParticleSystemRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按粒子大小进行拉伸
|
||||
* @zh 在粒子生成方式为 StrecthedBillboard 时,对粒子在运动方向上按粒子大小进行拉伸
|
||||
*/
|
||||
@property({
|
||||
displayOrder: 2,
|
||||
@@ -137,7 +137,7 @@ export default class ParticleSystemRenderer {
|
||||
private _mesh: Mesh | null = null;
|
||||
|
||||
/**
|
||||
* 粒子模型
|
||||
* @zh 粒子发射的模型
|
||||
*/
|
||||
@property({
|
||||
type: Mesh,
|
||||
@@ -154,6 +154,9 @@ export default class ParticleSystemRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 粒子使用的材质
|
||||
*/
|
||||
@property({
|
||||
type: Material,
|
||||
displayOrder: 8,
|
||||
@@ -166,6 +169,9 @@ export default class ParticleSystemRenderer {
|
||||
this.particleSystem.setMaterial(val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 拖尾使用的材质
|
||||
*/
|
||||
@property({
|
||||
type: Material,
|
||||
displayOrder: 9,
|
||||
|
||||
Reference in New Issue
Block a user