Esempio n. 1
0
        public override void OnBodyGUI()
        {
            BranchNodeBase  node  = target as BranchNodeBase;
            DialogNodeGraph graph = node.graph as DialogNodeGraph;

            NodeEditorGUILayout.PortField(new GUIContent("Last Dialog"), target.GetInputPort("LastDialog"), GUILayout.MinWidth(0));

            if (node.Branchs.Count == 0)
            {
                GUILayout.BeginHorizontal();
                NodeEditorGUILayout.PortField(new GUIContent("Next Dialog"), target.GetOutputPort("NextDialog"), GUILayout.MinWidth(0));
                GUILayout.EndHorizontal();
            }

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("DialogueName"), new GUIContent("Dialogue Name"));
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("canReturn"), new GUIContent("Can Return"));

            GUILayout.Space(5);

            NodeEditorGUILayout.DynamicPortList("Branchs", typeof(DialogBaseNode), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        }
Esempio n. 2
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         if (null == curNode)
         {
             return;
         }
         if (curNode is BranchNodeBase)
         {
             BranchNodeBase branchNode = curNode as BranchNodeBase;
             branchNode.ReadNode();
             curNode = branchNode.GetNextDialog(0);
         }
         else
         {
             curNode.ReadNode();
             curNode = curNode.GetNextDialog();
         }
     }
 }