Esempio n. 1
0
        private void DrawEventPanel()
        {
            EditorGUI.indentLevel++;
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField("Add New Event To [ " + groupNames[selectedGroupIndex] + " ] Group:");
            if (tempEventDef == null)
            {
                tempEventDef = new GameEventDef();
            }
            tempEventDef.id   = EditorGUILayout.IntField("ID:", tempEventDef.id);
            tempEventDef.name = EditorGUILayout.TextField("TypeID:", tempEventDef.name);
            EditorGUILayout.LabelField("Description:");
            tempEventDef.description = EditorGUILayout.TextArea(tempEventDef.description);
            EditorGUI.indentLevel--;
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            GUI.backgroundColor = Color.green;
            if (GUILayout.Button("New Event", (GUIStyle)"minibuttonleft", GUILayout.MinWidth(80)))
            {
                this.NewEventDef();
            }
            GUI.backgroundColor = new Color(0, 0.9f, 1);
            if (GUILayout.Button("Add Event", (GUIStyle)"minibuttonmid", GUILayout.MinWidth(80)))
            {
                currGroup.events.Add(tempEventDef);
                this.NewEventDef();
            }
            GUI.backgroundColor = Color.red;
            if (GUILayout.Button("Clear Events", (GUIStyle)"minibuttonright", GUILayout.MinWidth(80)))
            {
                if (EditorUtility.DisplayDialog("清空", "确定清空当前事件组?", "确定", "取消"))
                {
                    currGroup.events.Clear();
                    this.NewEventDef();
                }
            }
            GUI.backgroundColor = oldColor;

            GUILayout.EndHorizontal();
        }
Esempio n. 2
0
 private void NewEventDef()
 {
     tempEventDef      = new GameEventDef();
     tempEventDef.id   = this.config.groups[selectedGroupIndex].GetNextID();
     tempEventDef.name = this.config.groups[selectedGroupIndex].name + "_";
 }