Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.4.1 Enable model after playing instead of onEnable #9991

Merged
merged 2 commits into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions cocos/particle/particle-system.ts
Expand Up @@ -858,6 +858,13 @@ export class ParticleSystem extends RenderableComponent {
if (this._trailModule) {
this._trailModule.play();
}

if (this.processor) {
const model = this.processor.getModel();
if (model) {
model.enabled = this.enabledInHierarchy;
}
}
}

/**
Expand Down
1 change: 0 additions & 1 deletion cocos/particle/renderer/particle-system-renderer-base.ts
Expand Up @@ -86,7 +86,6 @@ export abstract class ParticleSystemRendererBase implements IParticleSystemRende
const model = this._model;
if (model) {
model.node = model.transform = this._particleSystem.node;
model.enabled = this._particleSystem.enabledInHierarchy;
}
}

Expand Down