mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
Merge pull request #105 from zxg0622/rndComp
fix particle rendering bug
This commit is contained in:
@@ -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!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user