Esempio n. 1
0
        private void EntryNode(NodeValue nodeValue)
        {
            if (nodeValue.NodeType == (int)NODE_TYPE.CONDITION ||
                nodeValue.NodeType == (int)NODE_TYPE.ACTION ||
                nodeValue.NodeType == (int)NODE_TYPE.SUB_TREE
                )
            {
                return;
            }

            if (nodeValue.parentSubTreeNodeId < 0)
            {
                bool oldValue = nodeValue.isRootNode;
                nodeValue.isRootNode = EditorGUILayout.Toggle(new GUIContent("根节点"), nodeValue.isRootNode /*, GUILayout.Width(50)*/);
                if (nodeValue.isRootNode && oldValue != nodeValue.isRootNode)
                {
                    if (null != BehaviorManager.behaviorChangeRootNode)
                    {
                        BehaviorManager.behaviorChangeRootNode(nodeValue.id);
                    }
                }
            }
            else
            {
                bool oldValue = nodeValue.subTreeEntry;
                nodeValue.subTreeEntry = EditorGUILayout.Toggle(new GUIContent("子树入口节点"), nodeValue.subTreeEntry /*, GUILayout.Width(50)*/);
                if (nodeValue.subTreeEntry && oldValue != nodeValue.subTreeEntry)
                {
                    if (null != BehaviorManager.behaviorChangeSubTreeEntryNode)
                    {
                        BehaviorManager.behaviorChangeSubTreeEntryNode(nodeValue.parentSubTreeNodeId, nodeValue.id);
                    }
                }
            }
        }