Esempio n. 1
0
        private static void CreateNodeStyles()
        {
            // 下面的参数都可以自行查阅网上unity 自带样式名称(string to GUIStyle)。
            if (m_compositeStyle == null)
            {
                m_compositeStyle = new BTGraphNodeStyle("flow node 1", "flow node 1 on",
                                                        "flow node 6", "flow node 6 on",
                                                        "flow node 4", "flow node 4 on",
                                                        "flow node 3", "flow node 3 on");
            }

            if (m_decoratorStyle == null)
            {
                m_decoratorStyle = new BTGraphNodeStyle("flow node 1", "flow node 1 on",
                                                        "flow node 6", "flow node 6 on",
                                                        "flow node 4", "flow node 4 on",
                                                        "flow node 3", "flow node 3 on");
            }

            if (m_actionStyle == null)
            {
                m_actionStyle = new BTGraphNodeStyle("flow node 0", "flow node 0 on",
                                                     "flow node 6", "flow node 6 on",
                                                     "flow node 4", "flow node 4 on",
                                                     "flow node 3", "flow node 3 on");
            }

            if (m_nodeGroupStyle == null)
            {
                m_nodeGroupStyle = new BTGraphNodeStyle("flow node hex 1", "flow node hex 1 on",
                                                        "flow node hex 6", "flow node hex 6 on",
                                                        "flow node hex 4", "flow node hex 4 on",
                                                        "flow node hex 3", "flow node hex 3 on");
            }
        }
Esempio n. 2
0
        private void DrawSelf()
        {
            string              label     = string.IsNullOrEmpty(m_node.Name) ? m_node.Title : m_node.Name;
            BTGraphNodeStyle    nodeStyle = BTEditorStyle.GetNodeStyle(m_node);
            Vector2             nodeSize  = BTEditorStyle.GetNodeSize(m_node);
            Rect                position  = new Rect(NodePositon + BTEditorCanvas.Current.Position, nodeSize);
            BehaviourNodeStatus status    = BTEditorCanvas.Current.IsDebuging ? m_node.Status : BehaviourNodeStatus.None;

            EditorGUI.LabelField(position, label, nodeStyle.GetStyle(status, m_isSelected));

            if (m_node.Breakpoint != Breakpoint.None)
            {
                Rect imgPosition;
                if (m_node is NodeGroup)
                {
                    imgPosition = new Rect(position.x + 2, position.y + 2, 12, 12);
                }
                else
                {
                    imgPosition = new Rect(position.x - 14, position.y + 2, 12, 12);
                }

                GUI.DrawTexture(imgPosition, BTEditorStyle.Breakpoint);
            }
        }
Esempio n. 3
0
        private static void CreateNodeStyles()
        {
            if (m_compositeStyle == null)
            {
                m_compositeStyle = new BTGraphNodeStyle("flow node 1", "flow node 1 on",
                                                        "flow node 6", "flow node 6 on",
                                                        "flow node 4", "flow node 4 on",
                                                        "flow node 3", "flow node 3 on");
            }

            if (m_decoratorStyle == null)
            {
                m_decoratorStyle = new BTGraphNodeStyle("flow node 1", "flow node 1 on",
                                                        "flow node 6", "flow node 6 on",
                                                        "flow node 4", "flow node 4 on",
                                                        "flow node 3", "flow node 3 on");
            }

            if (m_actionStyle == null)
            {
                m_actionStyle = new BTGraphNodeStyle("flow node 0", "flow node 0 on",
                                                     "flow node 6", "flow node 6 on",
                                                     "flow node 4", "flow node 4 on",
                                                     "flow node 3", "flow node 3 on");
            }

            if (m_nodeGroupStyle == null)
            {
                m_nodeGroupStyle = new BTGraphNodeStyle("flow node hex 1", "flow node hex 1 on",
                                                        "flow node hex 6", "flow node hex 6 on",
                                                        "flow node hex 4", "flow node hex 4 on",
                                                        "flow node hex 3", "flow node hex 3 on");
            }
        }