mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
修复点击眼睛图标时,整个场景树折叠bug。
This commit is contained in:
parent
4cf2a57bbc
commit
80eec6c514
@ -42,6 +42,7 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en
|
||||
28. 新建三维园区。
|
||||
29. 工具栏改为横向,并进行分类。
|
||||
30. 禁用鼠标放到物体上高亮。
|
||||
31. 修复点击眼睛图标时,整个场景树折叠bug。
|
||||
|
||||
## v0.3.6更新
|
||||
|
||||
|
||||
@ -114,9 +114,36 @@ class HierarchyPanel extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
let data = this.state.data;
|
||||
let selected = object.uuid;
|
||||
|
||||
this.setState({
|
||||
selected
|
||||
}, () => {
|
||||
this.updateUI();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据场景变化,更新场景树状图
|
||||
*/
|
||||
updateUI() {
|
||||
const scene = app.editor.scene;
|
||||
const camera = app.editor.camera;
|
||||
|
||||
let data = [{
|
||||
value: camera.uuid,
|
||||
text: camera.name,
|
||||
cls: 'Camera',
|
||||
expanded: false,
|
||||
checked: this.checked[camera.uuid] || false,
|
||||
draggable: false,
|
||||
children: []
|
||||
}];
|
||||
|
||||
this._parseData(scene, data);
|
||||
|
||||
const selected = this.state.selected;
|
||||
|
||||
this.expandData(selected, data);
|
||||
|
||||
this.setState({
|
||||
@ -134,6 +161,7 @@ class HierarchyPanel extends React.Component {
|
||||
}
|
||||
if (this.expandData(uuid, item.children)) {
|
||||
// 找到了,父节点也要展开
|
||||
this.expanded[item.uuid] = true;
|
||||
item.expanded = true;
|
||||
return true;
|
||||
}
|
||||
@ -141,28 +169,6 @@ class HierarchyPanel extends React.Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据场景变化,更新场景树状图
|
||||
*/
|
||||
updateUI() {
|
||||
const scene = app.editor.scene;
|
||||
const camera = app.editor.camera;
|
||||
|
||||
let list = [{
|
||||
value: camera.uuid,
|
||||
text: camera.name,
|
||||
cls: 'Camera',
|
||||
expanded: false,
|
||||
checked: this.checked[camera.uuid] || false,
|
||||
draggable: false,
|
||||
children: []
|
||||
}];
|
||||
|
||||
this._parseData(scene, list);
|
||||
|
||||
this.setState({ data: list });
|
||||
}
|
||||
|
||||
_parseData(obj, list) {
|
||||
const scene = app.editor.scene;
|
||||
const camera = app.editor.camera;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user