public CallTreeNode(MonoBehaviour target, CallTreeNodeType type, string name = "")
 {
     Name     = string.IsNullOrEmpty(name) ? target.GetType().Name : name;
     Target   = target;
     Type     = type;
     Children = new List <CallTreeNode>();
 }
            Texture2D GetIcon(MonoBehaviour bhv, CallTreeNodeType type)
            {
                if (bhv != null && type != CallTreeNodeType.Callable)
                {
                    var texture = EditorGUIUtility.ObjectContent(bhv, bhv.GetType()).image;
                    if (texture != null)
                    {
                        return(texture as Texture2D);
                    }
                }

                switch (type)
                {
                default:
                case CallTreeNodeType.Callable:
                    return(Styles.Callable);

                case CallTreeNodeType.Action:
                    return(Styles.Action);

                case CallTreeNodeType.Logic:
                    return(Styles.Logic);

                case CallTreeNodeType.Event:
                    return(Styles.Event);

                case CallTreeNodeType.Message:
                    return(Styles.Message);

                case CallTreeNodeType.State:
                    return(Styles.State);

                case CallTreeNodeType.Factory:
                    return(Styles.Factory);

                case CallTreeNodeType.StateMachine:
                    return(Styles.StateMachine);
                }
            }