コード例 #1
0
ファイル: ActionWindow.cs プロジェクト: alexkonusa/gam250
    void OnGUI()
    {
        if (GameObject.Find("IRCManager") != null)
        {
            if (irc == null)
            {
                irc = GameObject.Find("IRCManager").GetComponent <IRC> ();
            }

            EditorGUILayout.LabelField("[User Commands]");

            EditorGUILayout.BeginVertical("box");
            foreach (string s in irc.actions)
            {
                EditorGUILayout.LabelField(s);
            }

            EditorGUILayout.EndVertical();

            newAction = EditorGUILayout.TextField("Action", newAction);

            if (GUILayout.Button("ADD ACTION"))
            {
                if (newAction != string.Empty)
                {
                    irc.AddAction(newAction);
                    newAction = string.Empty;
                }
            }

            if (GUILayout.Button("REMOVE ACTION"))
            {
                if (newAction != string.Empty)
                {
                    irc.actions.Remove(newAction);
                    newAction = string.Empty;
                }
            }
        }
    }