浏览代码

Finishing Touch / Better Refresh handling

/main
Thomas ICHÉ 5 年前
当前提交
8648ea02
共有 2 个文件被更改,包括 33 次插入2 次删除
  1. 31
      Editor/CallTree/CallTreeWindow.cs
  2. 4
      Editor/PropertyDrawers/CallablePropertyDrawer.cs

31
Editor/CallTree/CallTreeWindow.cs


[MenuItem("Window/Gameplay Ingredients/Callable Tree Explorer", priority = MenuItems.kWindowMenuPriority)]
static void OpenWindow()
{
GetWindow<CallTreeWindow>();
s_Instance = GetWindow<CallTreeWindow>();
}
public static bool visible = false;
static CallTreeWindow s_Instance;
private void OnDisable()
{
visible = false;
s_Instance = null;
}
private void OnEnable()

titleContent = new GUIContent("Callable Tree Explorer");
ReloadCallHierarchy();
EditorSceneManager.sceneOpened += Reload;
EditorSceneSetup.onSetupLoaded += ReloadSetup;
visible = true;
}
void ReloadSetup(EditorSceneSetup setup)
{
ReloadCallHierarchy();
}
public static void Refresh()
{
s_Instance.ReloadCallHierarchy();
s_Instance.Repaint();
}
private void OnGUI()

if (list.Count > 0)
nodeRoots.Add(name, new List<CallTreeNode>());
else
return;
if (item.gameObject.scene == null || !item.gameObject.scene.isLoaded)
continue;
var stack = new Stack<object>();
if(typeof(T) == typeof(StateMachine))

public void SetFilter(GameObject filter = null)
{
m_filter = filter;
this.Reload();
Reload();
}
protected override TreeViewItem BuildRoot()

4
Editor/PropertyDrawers/CallablePropertyDrawer.cs


{
property.objectReferenceValue = setNextObjectValue;
setNextObjectValue = null;
if(CallTreeWindow.visible)
{
CallTreeWindow.Refresh();
}
}
if(property.objectReferenceValue == null)

正在加载...
取消
保存