即时生成和删除tab(不会做动态刷新 基本上hierarchy的性能就到这了,之后还是做点辅助工具防止1000+的栏展开吧 (重要)bug测试不完全,需要再加改进
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Ichni.Editor
|
|
{
|
|
public class Hierarchy : StaticWindow
|
|
{
|
|
public GameObject Nouse;
|
|
public GameObject hierarchyTabPrefab;
|
|
public RectTransform tabContainer;
|
|
public List<HierarchyTab> tabList;
|
|
//public int ID=0;
|
|
|
|
|
|
public HierarchyTab GenerateTab(GameElement targetElement, GameElement parentElement,int reuse=-1)
|
|
{
|
|
HierarchyTab tab =Instantiate(hierarchyTabPrefab, tabContainer).GetComponent<HierarchyTab>();;
|
|
//if(parentElement.connectedTab!=null)tab.transform.SetSiblingIndex(parentElement.connectedTab.transform.GetSiblingIndex());
|
|
tab.SetTab(targetElement, parentElement);
|
|
|
|
tab.hierarchy=this;
|
|
|
|
return tab;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
} |