Exemplo n.º 1
0
        void DrawNodeWindowName()
        {
            NodeNameAttribute attr     = BTHelper.GetAttribute <NodeNameAttribute>(this.GetType());
            string            nodeName = attr == null?string.Format("<b>{0}</b>", Name) : attr.Name;

            GUILayout.Label(nodeName, BTStyle.STYLE_CENTERLABEL);
        }
Exemplo n.º 2
0
        private void DrawSelectNodeInfo()
        {
            if (mTree.FocusedGraph == null)
            {
                mInspectorRect.height = 0;
                GUILayout.BeginArea(Rect.zero);
                GUILayout.EndArea();
                return;
            }
            mInspectorRect.width = 320;
            mInspectorRect.x     = 10;
            mInspectorRect.y     = 50;
            GUISkin lastSkin = GUI.skin;

            GUI.Box(mInspectorRect, "", BTStyle.BVT_WindowShadow);

            NodeNameAttribute nameAttr = BTHelper.GetAttribute <NodeNameAttribute>(FocuseType);

            GUILayout.BeginArea(mInspectorRect, nameAttr != null ? nameAttr.Name : FocuseType.Name, new GUIStyle(BTStyle.BVT_Panel));
            GUILayout.Space(5);
            GUI.skin = null;

            if (BTSettings.ShowNodeInfo)
            {
                GUI.backgroundColor = new Color(0.8f, 0.8f, 1);
                NodeDescAttribute descAttr = BTHelper.GetAttribute <NodeDescAttribute>(FocuseType);
                EditorGUILayout.HelpBox(descAttr != null ? descAttr.Desc : string.Empty, MessageType.None, true);
                GUI.backgroundColor = Color.white;
                mTree.FocusedGraph.DrawNodeInspectorGUI();
            }

            GUILayout.Box("", GUILayout.Height(5), GUILayout.Width(mInspectorRect.width - 1));
            GUI.skin = lastSkin;
            if (Event.current.type == EventType.Repaint)
            {
                mInspectorRect.height = GUILayoutUtility.GetLastRect().yMax + 5;
            }
            GUILayout.EndArea();
        }