浏览代码

More Friendly Names for Callable Items in list

/main
Thomas ICHÉ 5 年前
当前提交
70dee13a
共有 1 个文件被更改,包括 37 次插入2 次删除
  1. 39
      Editor/CallTree/CallTreeWindow.cs

39
Editor/CallTree/CallTreeWindow.cs


// Add Callables from this Callable[] array
foreach (var call in value)
{
node.Children.Add(GetNode(call, stack));
node.Children.Add(GetCallableNode(call, stack));
}
}
}

{
return new CallTreeNode(bhv, GetType(bhv), $"RECURSED : {bhv.gameObject.name} ({bhv.GetType().Name})");
}
}
CallTreeNode GetCallableNode(Callable c, Stack<object> stack)
{
if (!stack.Contains(c))
{
stack.Push(c);
var rootNode = new CallTreeNode(c, GetType(c), $"{c.Name} ({c.gameObject.name} : {c.GetType().Name})");
var type = c.GetType();
foreach (var field in type.GetFields())
{
// Find Fields that are Callable[]
if (field.FieldType.IsAssignableFrom(typeof(Callable[])))
{
var node = new CallTreeNode(c, CallTreeNodeType.Callable, field.Name);
var value = (Callable[])field.GetValue(c);
if (value != null && value.Length > 0)
{
rootNode.Children.Add(node);
// Add Callables from this Callable[] array
foreach (var call in value)
{
node.Children.Add(GetCallableNode(call, stack));
}
}
}
}
return rootNode;
}
else
{
return new CallTreeNode(c, GetType(c), $"RECURSED : {c.Name} ({c.gameObject.name} : {c.GetType().Name})");
}
}
CallTreeNode GetMessageNode(SendMessageAction msg, Stack<object> stack)

return true;
else
{
if (this.Target.gameObject == go && string.IsNullOrEmpty(filter)? true: this.Name.Contains(filter))
if (this.Target.gameObject == go && (string.IsNullOrEmpty(filter)? true: this.Name.Contains(filter)))
return true;
bool value = false;

public string stringFilter { get { return m_StringFilter; } set { m_StringFilter = value; this.Reload(); } }
[SerializeField]
[SerializeField]
string m_StringFilter = "";
public bool AutoFilter { get; private set; }

正在加载...
取消
保存