Example #1
0
    public void RenderSpeech()
    {
        GUI.Label(GetColumnRect(), MyLinkedGameObject.name + " Speech");
        //MyDialogueLine.SpeechDialogue = GUI.TextField (new Rect (0f, ++PositionY * TextHeight, MyRect.width - MarginX, TextHeight), MyDialogueLine.SpeechDialogue);

        //Reverse list with + and -
        ListBegin = ++PositionY;
        //GUI.Label (GetListBeginRect(0), "Player Speech");
        // Add Function Button
        if (GUI.Button(GetListBeginRect(1), "+"))
        {
            MyDialogueLine.AddSpeechLine();
        }
        // Remove Function Button
        if (GUI.Button(GetListBeginRect(2), "-"))
        {
            MyDialogueLine.SpeechLines.RemoveAt(MyDialogueLine.SpeechLines.Count - 1);
        }
        // and list itself
        for (int i = 0; i < MyDialogueLine.SpeechLines.Count; i++)
        {
            GUI.TextField(GetColumnRect(), MyDialogueLine.SpeechLines [i].GetLabelText());
            //MyDialogueLine.SpeechLines [i] = GUI.TextField (GetColumnRect(), MyDialogueLine.SpeechLines [i].GetLabelText());
        }
        EditorGUILayout.Space();
    }