Skip to content

Commit

Permalink
fix: script gc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cptbtptpbcptdtptp committed Aug 30, 2023
1 parent 1bff026 commit 72778e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/Script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class Script extends Component {
_handlingInValid(): void {
const componentsManager = this.scene._componentsManager;
const { prototype } = Script;
if (!this._started) {
if (this._onStartIndex !== -1) {
componentsManager.removeOnStartScript(this);
}
if (this.onUpdate !== prototype.onUpdate) {
Expand Down

0 comments on commit 72778e3

Please sign in to comment.