This commit is contained in:
jerrywwl
2019-01-23 15:18:36 +08:00
4 changed files with 10 additions and 6 deletions
@@ -14,7 +14,9 @@ const Mode = Enum({
@ccclass('cc.CurveRange')
export default class CurveRange {
@property
@property({
type: Mode
})
mode = Mode.Constant;
@property({
@@ -24,7 +24,9 @@ const Mode = Enum({
@ccclass('cc.GradientRange')
export default class GradientRange {
@property
@property({
type: Mode
})
mode = Mode.Color;
@property
@@ -104,7 +104,7 @@ export default class ParticleSystemComponent extends Component {
simulationSpeed = 1.0;
@property
playOnAwake = false;
playOnAwake = true;
@property({
type: CurveRange
@@ -215,7 +215,7 @@ export default class ParticleSystemComponent extends Component {
}
onEnable() {
if (this._playOnAwake) {
if (this.playOnAwake) {
this.play();
}
}
@@ -61,7 +61,7 @@ export default class ParticleBatchModel extends Model {
this._vertAttrs = attrs;
this._vertSize = 0;
for (const a of this._vertAttrs) {
this._vertSize += GFXFormatInfos[a.format].size * GFXFormatInfos[a.format].count;
this._vertSize += GFXFormatInfos[a.format].size;
}
// rebuid
this._vBuffer = this._createSubMeshData();
@@ -128,7 +128,7 @@ export default class ParticleBatchModel extends Model {
}
public disableStretchedBillboard () {
if (this._vertAttrs!.find((attr) => attr.name === GFXAttributeName.ATTR_COLOR) !== undefined) {
if (this._vertAttrs!.find((attr) => attr.name === GFXAttributeName.ATTR_COLOR1) !== undefined) {
this._vertAttrs!.pop();
this.setVertexAttributes(this._vertAttrs!);
}