mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
保存场景记录选中状态。
This commit is contained in:
parent
9889fbaeba
commit
049607d9fa
@ -338,6 +338,15 @@ ScenePanel.prototype.onLoadScene = function (obj) {
|
||||
|
||||
this.app.editor.camera.updateProjectionMatrix();
|
||||
|
||||
if (obj.options.selected) {
|
||||
var obj = this.app.editor.objectByUuid(obj.options.selected);
|
||||
if (obj) {
|
||||
this.app.editor.select(obj);
|
||||
} else {
|
||||
console.warn(`ScenePanel: 无法选中uuid为${obj.options.selected}的物体!`);
|
||||
}
|
||||
}
|
||||
|
||||
this.app.call('sceneLoaded', this);
|
||||
};
|
||||
|
||||
|
||||
@ -95,6 +95,12 @@ SceneMenu.prototype.saveScene = function () { // 保存场景
|
||||
SceneMenu.prototype.commitSave = function (sceneName) {
|
||||
var editor = this.app.editor;
|
||||
|
||||
// 记录选中物体,以便载入时还原场景选中
|
||||
var selected = this.app.editor.selected;
|
||||
if (selected) {
|
||||
this.app.options.selected = selected.uuid;
|
||||
}
|
||||
|
||||
var obj = (new Converter()).toJSON({
|
||||
options: this.app.options,
|
||||
camera: editor.camera,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user