public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            drawSpeech = EditorGUILayout.Foldout(drawSpeech, new GUIContent("Speech Dialogues"));
            if (drawSpeech)
            {
                DrawSpeech();
            }

            drawOptions = EditorGUILayout.Foldout(drawOptions, new GUIContent("Option Dialogues"));
            if (drawOptions)
            {
                DrawOptions();
            }

            if (GUILayout.Button("Open in Node Editor"))
            {
                NodeEditor window = EditorWindow.GetWindow <NodeEditor>();
                window.SetDialogue(t);
            }
        }
Exemple #2
0
        public NodeBase(Type _type, NodeEditor window)
        {
            m_Type = _type;

            if (_type == Type.Start)
            {
                Vector2 midpoint = new Vector2(window.position.size.x / 2, window.position.size.y / 2);
                m_Rect       = new Rect((int)(midpoint.x - 64), (int)(midpoint.y - 32), 128, 64);
                m_WindowName = "Start Node";
                outputPositions.Add(Vector2.zero);
            }

            if (_type == Type.Speech)
            {
                Vector2 midpoint = new Vector2(window.position.size.x / 2, window.position.size.y / 2);
                m_Rect       = new Rect((int)(midpoint.x + 128), (int)(midpoint.y + 64), 196, 256);
                m_WindowName = "Speech Node";
                outputPositions.Add(Vector2.zero);
            }

            if (_type == Type.Option)
            {
                Vector2 midpoint = new Vector2(window.position.size.x / 2, window.position.size.y / 2);
                m_Rect       = new Rect((int)(midpoint.x + 128), (int)(midpoint.y + 64), 196, 256);
                m_WindowName = "Options Node";
                outputPositions.Add(Vector2.zero);
            }

            if (_type == Type.End)
            {
                Vector2 midpoint = new Vector2(window.position.size.x / 2, window.position.size.y / 2);
                m_Rect       = new Rect((int)(midpoint.x - 64), (int)(midpoint.y - 32), 128, 64);
                m_WindowName = "End Node";
                outputPositions.Add(Vector2.zero);
            }
        }