diff --git a/cocos/3d/framework/particle/animator/curve-range.js b/cocos/3d/framework/particle/animator/curve-range.js index 3320823e81..501e516025 100644 --- a/cocos/3d/framework/particle/animator/curve-range.js +++ b/cocos/3d/framework/particle/animator/curve-range.js @@ -14,7 +14,9 @@ const Mode = Enum({ @ccclass('cc.CurveRange') export default class CurveRange { - @property + @property({ + type: Mode + }) mode = Mode.Constant; @property({ diff --git a/cocos/3d/framework/particle/animator/gradient-range.js b/cocos/3d/framework/particle/animator/gradient-range.js index 65fb3906a8..d716ba4d82 100644 --- a/cocos/3d/framework/particle/animator/gradient-range.js +++ b/cocos/3d/framework/particle/animator/gradient-range.js @@ -24,7 +24,9 @@ const Mode = Enum({ @ccclass('cc.GradientRange') export default class GradientRange { - @property + @property({ + type: Mode + }) mode = Mode.Color; @property diff --git a/cocos/3d/framework/particle/particle-system-component.js b/cocos/3d/framework/particle/particle-system-component.js index 39e32fc75a..4e9168dc92 100644 --- a/cocos/3d/framework/particle/particle-system-component.js +++ b/cocos/3d/framework/particle/particle-system-component.js @@ -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(); } } diff --git a/cocos/renderer/models/particle-batch-model.ts b/cocos/renderer/models/particle-batch-model.ts index 89c6fface4..689c56b2ef 100644 --- a/cocos/renderer/models/particle-batch-model.ts +++ b/cocos/renderer/models/particle-batch-model.ts @@ -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!); }