!1808 修复:灯光面板配置保存错误问题

pull/1809/head
林三 3 years ago committed by ChenX
parent 42505d243c
commit 40a0325e6a

@ -295,7 +295,21 @@ export class LightStore implements IConfigStore
export class PointLightStore implements IConfigStore
{
@observable configName = "默认";
@observable m_Option: PointLightOption = { ...DefaultPointLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultPointLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
SaveConfig()
{
let lightStore = LightStore.GetInstance();
@ -314,23 +328,6 @@ export class PointLightStore implements IConfigStore
newConfig.option = toJS(this.m_Option);
return newConfig;
};
//板数据
m_Option: PointLightOption = { ...DefaultPointLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultPointLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
async UpdateOption(cof: IConfigOption<PointLightOption>)
{
Object.assign(this.m_Option, cof.option);
@ -362,15 +359,6 @@ export class PointLightStore implements IConfigStore
app.Viewer.UpdateRender();
}
}
private static _SingleInstance: PointLightStore;
static GetInstance(): PointLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new PointLightStore;
return this._SingleInstance;
}
private updatePointLight(pointLight: PointLight, cof: IConfigOption<PointLightOption>)
{
EntityUpdateWrap(pointLight, () =>
@ -386,12 +374,34 @@ export class PointLightStore implements IConfigStore
pointLight.CaseShadow = cof.option.CaseShadow;
});
}
private static _SingleInstance: PointLightStore;
static GetInstance(): PointLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new PointLightStore;
return this._SingleInstance;
}
}
export class SpotLightStore implements IConfigStore
{
@observable configName = "默认";
@observable m_Option: SpotLightOption = { ...DefaultSpotLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultSpotLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
SaveConfig()
{
let lightStore = LightStore.GetInstance();
@ -413,22 +423,6 @@ export class SpotLightStore implements IConfigStore
newConfig.option = toJS(this.m_Option);
return newConfig;
};
m_Option: SpotLightOption = { ...DefaultSpotLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultSpotLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
async UpdateOption(cof: IConfigOption<SpotLightOption>)
{
Object.assign(this.m_Option, cof.option);
@ -463,15 +457,6 @@ export class SpotLightStore implements IConfigStore
app.Viewer.UpdateRender();
}
}
private static _SingleInstance: SpotLightStore;
static GetInstance(): SpotLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new SpotLightStore;
return this._SingleInstance;
}
private updateSpotLight(spotLight: SpotLight, cof: IConfigOption<SpotLightOption>)
{
EntityUpdateWrap(spotLight, () =>
@ -491,12 +476,34 @@ export class SpotLightStore implements IConfigStore
spotLight.ShowHelper = cof.option.ShowHelper;
});
}
private static _SingleInstance: SpotLightStore;
static GetInstance(): SpotLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new SpotLightStore;
return this._SingleInstance;
}
}
export class RectAreaLightStore implements IConfigStore
{
@observable configName = "默认";
@observable m_Option: RectAreaLightOption = { ...DefaultRectAreaLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultRectAreaLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
SaveConfig()
{
let lightStore = LightStore.GetInstance();
@ -517,22 +524,6 @@ export class RectAreaLightStore implements IConfigStore
newConfig.option = toJS(this.m_Option);
return newConfig;
};
m_Option: RectAreaLightOption = { ...DefaultRectAreaLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultRectAreaLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
async UpdateOption(cof: IConfigOption<RectAreaLightOption>)
{
Object.assign(this.m_Option, cof.option);
@ -565,14 +556,6 @@ export class RectAreaLightStore implements IConfigStore
app.Viewer.UpdateRender();
}
}
private static _SingleInstance: RectAreaLightStore;
static GetInstance(): RectAreaLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new RectAreaLightStore;
return this._SingleInstance;
}
private updateRectAreaLight(rectAreaLight: RectAreaLight, cof: IConfigOption<RectAreaLightOption>)
{
EntityUpdateWrap(rectAreaLight, () =>
@ -591,12 +574,33 @@ export class RectAreaLightStore implements IConfigStore
rectAreaLight.ShowHelper = cof.option.ShowHelper;
});
}
private static _SingleInstance: RectAreaLightStore;
static GetInstance(): RectAreaLightStore
{
if (this._SingleInstance) return this._SingleInstance;
this._SingleInstance = new RectAreaLightStore;
return this._SingleInstance;
}
}
export class RightPlaneLightStore implements IConfigStore
{
@observable configName = "默认";
@observable m_Option: RightPlaneLightOption = { ...DefaultRightPlaneLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultRightPlaneLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
SaveConfig()
{
let lightStore = LightStore.GetInstance();
@ -620,22 +624,6 @@ export class RightPlaneLightStore implements IConfigStore
newConfig.option = toJS(this.m_Option);
return newConfig;
};
m_Option: RightPlaneLightOption = { ...DefaultRightPlaneLightOption };
@observable configsNames: string[] = [];
InitOption()
{
Object.assign(this.m_Option, DefaultRightPlaneLightOption);
}
InitConfigs()
{
let config: IConfigOption = {};
config.option = toJS(this.m_Option);
let configs: { [key: string]: IConfigOption; } = {};
configs["默认"] = config;
return configs;
}
async UpdateOption(cof: IConfigOption<RightPlaneLightOption>)
{
Object.assign(this.m_Option, cof.option);

Loading…
Cancel
Save