mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
light, camera, view fix (#4164)
This commit is contained in:
committed by
Weiliang Wang
parent
33e9825f92
commit
2ef9110adb
@@ -53,6 +53,13 @@ export class DirectionalLightComponent extends LightComponent {
|
||||
if (this._light) { this._light.illuminance = this._illuminance; }
|
||||
}
|
||||
|
||||
public onLoad () {
|
||||
if (!this._enabled) {
|
||||
if (!this.node.scene) { return; }
|
||||
this._getRenderScene().mainLight.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected _createLight (scene?: RenderScene) {
|
||||
if (!this.node.scene) { return; }
|
||||
if (!scene) { scene = this._getRenderScene(); }
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ export class Root {
|
||||
}
|
||||
|
||||
for (const view of this._views) {
|
||||
if (view.isEnable && view.window === this._mainWindow) {
|
||||
if (view.isEnable && view.window === this._curWindow) {
|
||||
this._pipeline!.render(view);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,7 @@ export class Camera {
|
||||
|
||||
set enabled (val) {
|
||||
this._enabled = val;
|
||||
this._view.enable(val);
|
||||
}
|
||||
|
||||
get enabled () {
|
||||
|
||||
Reference in New Issue
Block a user