某些优化
This commit is contained in:
@@ -32,6 +32,8 @@ namespace Ichni.Editor
|
||||
return tab;
|
||||
}
|
||||
|
||||
public ScrollRect scrollRect;
|
||||
public Vector2 vector2;
|
||||
public void FindTab(GameElement targetElement, bool findparent = false)
|
||||
{
|
||||
if (findparent && targetElement.connectedTab != null)
|
||||
@@ -47,8 +49,18 @@ namespace Ichni.Editor
|
||||
FindTab(targetElement.parentElement, true);
|
||||
targetElement.connectedTab.tabButton.onClick.Invoke();
|
||||
}
|
||||
|
||||
|
||||
GameElement gameElement = targetElement;
|
||||
HierarchyTab tab = targetElement.connectedTab;
|
||||
while (tab is null)
|
||||
{
|
||||
gameElement = gameElement.parentElement;
|
||||
if (gameElement is null) return;
|
||||
tab = gameElement.connectedTab;
|
||||
}
|
||||
float Tablocalpos = (-tab.transform.localPosition.y) - (tabContainer.sizeDelta.y / 4f);
|
||||
float pct = Tablocalpos / tabContainer.sizeDelta.y;
|
||||
scrollRect.verticalNormalizedPosition = 1f - pct;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user