public static void CreateSpellGraph(string WantedName) { CS_SpellGraph curGraph = ScriptableObject.CreateInstance <CS_SpellGraph>(); if (curGraph != null) { curGraph.GraphName = WantedName; curGraph.InitGraph(); AssetDatabase.CreateAsset(curGraph, "Assets/CS_RPG-data/Database/" + WantedName + ".asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); CS_SpellEditorWindow curWindows = EditorWindow.GetWindow <CS_SpellEditorWindow>(); if (curWindows != null) { curWindows.currentGraph = curGraph; } } else { EditorUtility.DisplayDialog("Dialog Message", "Unable to create new graph, please see your friendly programmer!", "OK"); } }
public static void InitEditorWindow() { curWindow = GetWindow <CS_SpellEditorWindow>(); curWindow.titleContent.text = "Spell Editor"; CreateView(); }
public static void UnloadGraph() { CS_SpellEditorWindow curWindows = EditorWindow.GetWindow <CS_SpellEditorWindow>(); if (curWindows != null) { curWindows.currentGraph = null; } }
static void CreateView() { if (curWindow != null) { curWindow.propertyView = new CS_SpellPropertyView(); curWindow.workView = new CS_SpellWorkView(); } else { curWindow = GetWindow <CS_SpellEditorWindow>(); } }
public static void LoadGraph() { CS_SpellGraph curGraph = null; string grapPath = EditorUtility.OpenFilePanel("Load Graph", Application.dataPath + "/CS_RPG-Data/Database/", ""); int appPathLen = Application.dataPath.Length; string finalPath = grapPath.Substring(appPathLen - 6); curGraph = (CS_SpellGraph)AssetDatabase.LoadAssetAtPath(finalPath, typeof(CS_SpellGraph)); if (curGraph != null) { CS_SpellEditorWindow curWindows = EditorWindow.GetWindow <CS_SpellEditorWindow>(); if (curWindows != null) { curWindows.currentGraph = curGraph; } } else { EditorUtility.DisplayDialog("Dialog Message", "Unable to load selected graph!", "ok"); } }
public static void InitSpellEditor() { CS_SpellEditorWindow.InitEditorWindow(); }