ActiveEditorTracker
原文参考链接:
https://blog.csdn.net/zryxh1/article/details/80246904
ActiveEditorTracker.sharedTracker.activeEditors
ActiveEditorTracker.sharedTracker.SetVisible(i, 0); //0是折叠, 1是展开
比如我想做的功能是折叠选中的GameObject的子节点, 代码如下:
var editors = ActiveEditorTracker.sharedTracker.activeEditors;
for(int i = 0; i < editors.Length; ++i)
{
if(editors[i].GetInstanceID() == Selection.activeGameObject.GetInstanceID())
{
ActiveEditorTracker.sharedTracker.SetVisible(i, 0);
break;
}
}
蓝闪的博客
http://www.cnblogs.com/stan-si/