开发:清理代码

pull/1723/head
ChenX 3 years ago
parent cb1f591b67
commit f922d7f62f

@ -114,7 +114,7 @@ export class Light extends Entity
{ {
en.intensity = this.WebIntensity; en.intensity = this.WebIntensity;
en.color = this._LightColor; en.color = this._LightColor;
en.visible = this.OpenLight; en.visible = this._OpenLight;
} }
get Intensity() get Intensity()
{ {

@ -276,14 +276,13 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}>
{ {
userConfig.oneKeyOpenLight = !userConfig.oneKeyOpenLight; userConfig.oneKeyOpenLight = !userConfig.oneKeyOpenLight;
Light.DefaultOpenLight = userConfig.oneKeyOpenLight; Light.DefaultOpenLight = userConfig.oneKeyOpenLight;
CommandWrap(() => //这里没有操作数据对象 所以不需要命令包裹
{
for (let light of app.Database.Lights.Entitys) for (let light of app.Database.Lights.Entitys)
{ {
if (light instanceof SpotLight || light instanceof RectAreaLight || light instanceof PointLight) if (light instanceof SpotLight || light instanceof RectAreaLight || light instanceof PointLight)
(light as Light).OpenLight = userConfig.oneKeyOpenLight; (light as Light).OpenLight = userConfig.oneKeyOpenLight;
} }
}, userConfig.oneKeyOpenLight ? "一键开灯" : "一键关灯"); app.Editor.UpdateScreen();
e.currentTarget.blur(); e.currentTarget.blur();
return; return;
} }

Loading…
Cancel
Save