From b72b661feb34426700302a5562ea2080e88d3531 Mon Sep 17 00:00:00 2001 From: zheng han Date: Thu, 5 Dec 2019 10:37:51 +0800 Subject: [PATCH] add getter setter to skybox (#5778) --- cocos/core/scene-graph/scene-globals.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cocos/core/scene-graph/scene-globals.ts b/cocos/core/scene-graph/scene-globals.ts index 51d4146299..147f86f985 100644 --- a/cocos/core/scene-graph/scene-globals.ts +++ b/cocos/core/scene-graph/scene-globals.ts @@ -267,11 +267,20 @@ cc.PlanarShadowInfo = PlanarShadowInfo; export class SceneGlobals { @property({ type: AmbientInfo }) public ambient = new AmbientInfo(); - @property({ type: SkyboxInfo }) - public skybox = new SkyboxInfo(); + @property + private _skybox = new SkyboxInfo(); @property({ type: PlanarShadowInfo }) public planarShadows = new PlanarShadowInfo(); + @property({ type: SkyboxInfo }) + get skybox() { + return this._skybox; + } + + set skybox(value) { + this._skybox = value; + } + set renderScene (rs: RenderScene) { this.ambient.renderScene = rs; this.skybox.renderScene = rs;