Beispiel #1
0
    void ContextCallBack(object obj)
    {
        switch (obj.ToString())
        {
        case "0":
            SpellPopupWindow.InitSpellPopup();
            break;

        case "1":
            CS_SpellUtils.LoadGraph();
            break;

        case "2":
            CS_SpellUtils.UnloadGraph();
            break;

        case "3":
            CS_SpellUtils.CreateSpell(currentGraph, mousePos);
            CS_SpellUtils.ReplaceSpell(currentGraph);
            break;

        case "5":
            CS_SpellUtils.DeleteSpell(deleteNoteID, currentGraph);
            CS_SpellUtils.ReplaceSpell(currentGraph);
            break;

        default:
            break;
        }
    }
Beispiel #2
0
    private void OnGUI()
    {
        GUILayout.Space(20);
        GUILayout.BeginHorizontal();
        GUILayout.Space(20);

        GUILayout.BeginVertical();

        EditorGUILayout.LabelField("Create New Spell Database", EditorStyles.boldLabel);

        wantedName = EditorGUILayout.TextField("Enter Name: ", wantedName);

        GUILayout.Space(10);

        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Create Spell Database", GUILayout.Height(40f)))
        {
            if (!String.IsNullOrEmpty(wantedName) && wantedName != "Enter a name...")
            {
                CS_SpellUtils.CreateSpellGraph(wantedName);
                currentPopupWindow.Close();
            }
            else
            {
                EditorUtility.DisplayDialog("Dialog Message: ", "Please enter a valid graph name!", "OK");
            }
        }

        if (GUILayout.Button("Cancel", GUILayout.Height(40f)))
        {
            currentPopupWindow.Close();
        }

        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        GUILayout.Space(20);
        GUILayout.EndHorizontal();
        GUILayout.Space(20);
    }