mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
矩形光帮助器设置。
This commit is contained in:
parent
430cbc0395
commit
1d06cd2c1f
@ -18,12 +18,14 @@ RectAreaLightHelpers.prototype.start = function () {
|
||||
this.app.on(`objectAdded.${this.id}`, this.onObjectAdded.bind(this));
|
||||
this.app.on(`objectRemoved.${this.id}`, this.onObjectRemoved.bind(this));
|
||||
this.app.on(`objectChanged.${this.id}`, this.onObjectChanged.bind(this));
|
||||
this.app.on(`storageChanged.${this.id}`, this.onStorageChanged.bind(this));
|
||||
};
|
||||
|
||||
RectAreaLightHelpers.prototype.stop = function () {
|
||||
this.app.on(`objectAdded.${this.id}`, null);
|
||||
this.app.on(`objectRemoved.${this.id}`, null);
|
||||
this.app.on(`objectChanged.${this.id}`, null);
|
||||
this.app.on(`storageChanged.${this.id}`, null);
|
||||
};
|
||||
|
||||
RectAreaLightHelpers.prototype.onObjectAdded = function (object) {
|
||||
@ -33,6 +35,8 @@ RectAreaLightHelpers.prototype.onObjectAdded = function (object) {
|
||||
|
||||
var helper = new VolumeRectAreaLightHelper(object, 0xffffff);
|
||||
|
||||
helper.visible = this.app.storage.get('showRectAreaLight');
|
||||
|
||||
this.helpers.push(helper);
|
||||
|
||||
this.app.editor.sceneHelpers.add(helper);
|
||||
@ -74,4 +78,14 @@ RectAreaLightHelpers.prototype.onObjectChanged = function (object) {
|
||||
this.helpers[index].update();
|
||||
};
|
||||
|
||||
RectAreaLightHelpers.prototype.onStorageChanged = function (key, value) {
|
||||
if (key !== 'showRectAreaLight') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.helpers.forEach(n => {
|
||||
n.visible = value;
|
||||
});
|
||||
};
|
||||
|
||||
export default RectAreaLightHelpers;
|
||||
Loading…
x
Reference in New Issue
Block a user