public void draw()
    {
        if (closeStyle == null)
        {
            closeStyle                   = new GUIStyle(GUI.skin.button);
            closeStyle.padding           = new RectOffset(0, 0, 0, 0);
            closeStyle.margin            = new RectOffset(0, 5, 2, 0);
            closeStyle.normal.textColor  = Color.red;
            closeStyle.focused.textColor = Color.red;
            closeStyle.active.textColor  = Color.red;
            closeStyle.hover.textColor   = Color.red;
        }

        GUIStyle style = new GUIStyle();

        style.padding = new RectOffset(5, 5, 5, 5);

        EditorGUILayout.BeginVertical();

        EditorGUILayout.HelpBox(TC.get("ConversationEditor.AtLeastOne"), MessageType.None);
        bool infoShown = false;

        if (myNode.getLineCount() > 0)
        {
            bool isScrolling = false;

            if (myNode.getLineCount() > 10)
            {
                scroll      = EditorGUILayout.BeginScrollView(scroll, GUILayout.MinWidth(360), GUILayout.Height(190));
                isScrolling = true;
            }

            for (int i = 0; i < myNode.getLineCount(); i++)
            {
                EditorGUILayout.BeginHorizontal();

                bool showInfo = false;

                EditorGUIUtility.labelWidth = GUI.skin.label.CalcSize(new GUIContent(TC.get("ConversationEditor.Option") + " " + i + ": ")).x;
                myNode.getLine(i).setText(EditorGUILayout.TextField(TC.get("ConversationEditor.Option") + " " + i + ": ", myNode.getLine(i).getText(), GUILayout.Width(200)));

                tmpTex = (myNode.getLine(i).getConditions().getConditionsList().Count > 0
                    ? conditionsTex
                    : noConditionsTex);

                if (GUILayout.Button(tmpTex, noBackgroundSkin.button, GUILayout.Width(15), GUILayout.Height(15)))
                {
                    ConditionEditorWindow window = (ConditionEditorWindow)ScriptableObject.CreateInstance(typeof(ConditionEditorWindow));
                    window.Init(myNode.getLine(i).getConditions());
                }

                if (GUILayout.Button(linkTex, noBackgroundSkin.button, GUILayout.Width(15), GUILayout.Height(15)))
                {
                    parent.startSetChild(this.myNode, i);
                }


                if (GUILayout.Button("X", closeStyle, GUILayout.Width(15), GUILayout.Height(15)))
                {
                    myNode.removeLine(i);
                    myNode.removeChild(i);
                }
                ;
                EditorGUILayout.EndHorizontal();
            }
            if (isScrolling)
            {
                EditorGUILayout.EndScrollView();
            }
        }

        EditorGUILayout.BeginHorizontal();
        GUIContent bttext = new GUIContent(TC.get("ConversationEditor.AddOptionChild"));
        Rect       btrect = GUILayoutUtility.GetRect(bttext, style);

        if (GUI.Button(btrect, bttext))
        {
            myNode.addLine(new ConversationLine("Player", ""));
            parent.addChild(this.myNode, new DialogueConversationNode());
        }
        ;

        tmpTex = (myNode.getEffects().getEffects().Count > 0
            ? effectTex
            : noEffectTex);
        if (GUILayout.Button(tmpTex, noBackgroundSkin.button, GUILayout.Width(24), GUILayout.Height(24)))
        {
            EffectEditorWindow window = (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
            window.Init(myNode.getEffects());
        }
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndVertical();
    }
    public void draw()
    {
        if (closeStyle == null)
        {
            closeStyle                   = new GUIStyle(GUI.skin.button);
            closeStyle.padding           = new RectOffset(0, 0, 0, 0);
            closeStyle.margin            = new RectOffset(0, 5, 2, 0);
            closeStyle.normal.textColor  = Color.red;
            closeStyle.focused.textColor = Color.red;
            closeStyle.active.textColor  = Color.red;
            closeStyle.hover.textColor   = Color.red;
        }

        if (buttonstyle == null)
        {
            buttonstyle         = new GUIStyle();
            buttonstyle.padding = new RectOffset(5, 5, 5, 5);
        }

        GUIStyle style = new GUIStyle();

        style.padding = new RectOffset(5, 5, 5, 5);

        EditorGUILayout.BeginVertical();

        EditorGUILayout.HelpBox(TC.get("ConversationEditor.AtLeastOne"), MessageType.None);
        bool infoShown = false;

        if (myNode.getLineCount() > 0)
        {
            bool isScrolling = false;

            if (myNode.getLineCount() > 10)
            {
                scroll      = EditorGUILayout.BeginScrollView(scroll, GUILayout.MinWidth(360), GUILayout.Height(190));
                isScrolling = true;
            }

            for (int i = 0; i < myNode.getLineCount(); i++)
            {
                EditorGUILayout.BeginHorizontal();
                //myNode.getLine(i).IsEntityFragment = EditorGUILayout.Toggle("Is entity: ", frg.IsEntityFragment);

                bool showInfo = false;
                EditorGUIUtility.labelWidth = GUI.skin.label.CalcSize(new GUIContent(TC.get("ConversationEditor.Speaker"))).x;
                myNode.getLine(i).setName(npc[EditorGUILayout.Popup(TC.get("ConversationEditor.Speaker"), npc.IndexOf(myNode.getLine(i).getName()), npc.ToArray())]);

                EditorGUIUtility.labelWidth = GUI.skin.label.CalcSize(new GUIContent(TC.get("ConversationEditor.Line"))).x;
                myNode.getLine(i).setText(EditorGUILayout.TextField(TC.get("ConversationEditor.Line"), myNode.getLine(i).getText(), GUILayout.Width(200)));

                tmpTex = (myNode.getLine(i).getConditions().getConditionsList().Count > 0
                    ? conditionsTex
                    : noConditionsTex);

                if (GUILayout.Button(tmpTex, noBackgroundSkin.button, GUILayout.Width(15), GUILayout.Height(15)))
                {
                    ConditionEditorWindow window = (ConditionEditorWindow)ScriptableObject.CreateInstance(typeof(ConditionEditorWindow));
                    window.Init(myNode.getLine(i).getConditions());
                }

                if (GUILayout.Button("X", closeStyle, GUILayout.Width(15), GUILayout.Height(15)))
                {
                    myNode.removeLine(i);
                }
                ;
                EditorGUILayout.EndHorizontal();
            }
            if (isScrolling)
            {
                EditorGUILayout.EndScrollView();
            }
        }


        GUIContent bttext = new GUIContent(TC.get("ConversationLine.DefaultText"));
        Rect       btrect = GUILayoutUtility.GetRect(bttext, style);

        if (GUI.Button(btrect, bttext))
        {
            myNode.addLine(new ConversationLine(TC.get("ConversationLine.PlayerName"), ""));
        }
        ;


        EditorGUILayout.HelpBox(TC.get("ConversationEditor.NodeOption"), MessageType.None);

        EditorGUILayout.BeginHorizontal();
        GUI.enabled = (myNode.getChildCount() == 0) || myNode.getType() == ConversationNodeViewEnum.OPTION;
        bttext      = new GUIContent(TC.get("ConversationEditor.CreateChild"));
        btrect      = GUILayoutUtility.GetRect(bttext, buttonstyle);
        if (GUI.Button(btrect, bttext))
        {
            parent.addChild(myNode, new DialogueConversationNode());
        }
        GUI.enabled = true;

        bttext = new GUIContent(TC.get("ConversationEditor.SetChild"));
        btrect = GUILayoutUtility.GetRect(bttext, buttonstyle);
        if (GUI.Button(btrect, bttext))
        {
            parent.startSetChild(this.myNode, 0);
        }

        tmpTex = (myNode.getEffects().getEffects().Count > 0
            ? effectTex
            : noEffectTex);
        if (GUILayout.Button(tmpTex, noBackgroundSkin.button, GUILayout.Width(24), GUILayout.Height(24)))
        {
            EffectEditorWindow window = (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
            window.Init(myNode.getEffects());
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.EndVertical();
    }