Skip to content

Commit

Permalink
fix: Fix the error caused by removing the Sky Box. (#344)
Browse files Browse the repository at this point in the history
Fix the error caused by removing the Sky Box.
  • Loading branch information
hellmor committed Dec 6, 2023
1 parent 2bd1994 commit b02c85a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/renderer/MeshRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { PassType } from '../../gfx/renderJob/passRenderer/state/RendererType';
import { MorphTargetData } from '../anim/morphAnim/MorphTargetData';
import { RenderNode } from './RenderNode';
import { EditorInspector, RegisterComponent } from '../../util/SerializeDecoration';
import { Color, Material, mergeFunctions } from '../..';
import { mergeFunctions } from '../../util/Global';
import { Material } from '../../materials/Material';

/**
* The mesh renderer component is a component used to render the mesh
Expand Down
2 changes: 2 additions & 0 deletions src/components/renderer/RenderNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ export class RenderNode extends ComponentBase {
}

public onDisable(): void {
this._enable = false;
EntityCollect.instance.removeRenderNode(this.transform.scene3D, this);
super.onDisable?.();
}

public selfCloneMaterials(key: string): this {
Expand Down
1 change: 1 addition & 0 deletions src/components/renderer/SkyRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class SkyRenderer extends MeshRenderer {
this._inRenderer = false;
EntityCollect.instance.sky = null;
}
super.onDisable();
}

public renderPass2(view: View3D, passType: PassType, rendererPassState: RendererPassState, clusterLightingBuffer: ClusterLightingBuffer, encoder: GPURenderPassEncoder, useBundle: boolean = false) {
Expand Down

0 comments on commit b02c85a

Please sign in to comment.