选择可显示项
本来想做启闭的懒得做了
This commit is contained in:
@@ -125,24 +125,33 @@ namespace Ichni.Editor
|
||||
EditorManager.instance.uiManager.inspector.SetInspector(connectedGameElement);
|
||||
EditorManager.instance.timeline.SetTimeLine(connectedGameElement);
|
||||
}
|
||||
|
||||
private IEnumerator ienumerator = null;
|
||||
public void ExpandOrFold()
|
||||
{
|
||||
ExpandOrFold(false);
|
||||
}
|
||||
public void ExpandOrFold(bool forceAllExPand = false)
|
||||
{
|
||||
this.childTabList.RemoveAll(s => s == null);
|
||||
isExpanded = !isExpanded;
|
||||
ExpandAnim();
|
||||
if (isExpanded)
|
||||
{
|
||||
connectedGameElement.ScanAndAddEnableTypes();
|
||||
List<GameElement> FixedList = !forceAllExPand ? connectedGameElement.GetChildrenByTypes() : connectedGameElement.childElementList;
|
||||
|
||||
// float startTime = Time.realtimeSinceStartup;
|
||||
// connectedGameElement.childElementList.Sort();//TODO: 后续可以让玩家手动快速排序
|
||||
// Debug.Log("排序耗时 " + (Time.realtimeSinceStartup - startTime).ToString());
|
||||
StartCoroutine(ExpandOverTime());
|
||||
Debug.Log(FixedList.Count);
|
||||
ienumerator = ExpandOverTime(FixedList);
|
||||
StartCoroutine(ienumerator);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//expandButton.transform.Rotate(new Vector3(0, 0, 180));
|
||||
|
||||
StopCoroutine(ienumerator);
|
||||
ienumerator = null;
|
||||
for (int i = childTabList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
childTabList[i].SetExpansion(isExpanded);
|
||||
@@ -171,11 +180,11 @@ namespace Ichni.Editor
|
||||
{
|
||||
expandButton.transform.DORotate(new Vector3(0, 0, !isExpanded ? 0f : 180f), 0.2f);
|
||||
}
|
||||
private IEnumerator ExpandOverTime()//帧率过低的时候等一下再实例化
|
||||
private IEnumerator ExpandOverTime(List<GameElement> FixedList)//帧率过低的时候等一下再实例化
|
||||
{
|
||||
|
||||
float startTime = Time.realtimeSinceStartup;
|
||||
for (var index = 0; index < connectedGameElement.childElementList.Count; index++)
|
||||
for (var index = 0; index < FixedList.Count; index++)
|
||||
{
|
||||
int hasYield = 0;
|
||||
while (Time.realtimeSinceStartup - startTime > 1f / EditorManager.instance.editorSettings.frameRate * 3f && hasYield <= 2)
|
||||
@@ -183,8 +192,9 @@ namespace Ichni.Editor
|
||||
yield return null;
|
||||
hasYield += 1;
|
||||
}
|
||||
var childElement = connectedGameElement.childElementList[index];
|
||||
var childElement = FixedList[index];
|
||||
EditorManager.instance.uiManager.hierarchy.GenerateTab(childElement, connectedGameElement);
|
||||
print($"生成子Tab:{childElement.elementName},索引:{index},总数:{FixedList.Count}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user