其他分享
首页 > 其他分享> > ActiveEditorTracker

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;
  }
}

 

标签:GetInstanceID,ActiveEditorTracker,editors,activeEditors,sharedTracker,SetVisible
来源: https://www.cnblogs.com/stan-si/p/10580254.html