public static void InitEditorWindow() { curWindow = GetWindow <CS_CharacterEditorWindow>(); curWindow.titleContent.text = "Dialog Editor"; CreateView(); }
public static void CreateCharacterGraph(string WantedName) { CS_CharacterGraph curGraph = ScriptableObject.CreateInstance <CS_CharacterGraph>(); if (curGraph != null) { curGraph.GraphName = WantedName; curGraph.InitGraph(); AssetDatabase.CreateAsset(curGraph, "Assets/CS_RPG-data/Database/" + WantedName + ".asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); CS_CharacterEditorWindow curWindows = EditorWindow.GetWindow <CS_CharacterEditorWindow>(); 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 UnloadGraph() { CS_CharacterEditorWindow curWindows = EditorWindow.GetWindow <CS_CharacterEditorWindow>(); if (curWindows != null) { curWindows.currentGraph = null; } }
static void CreateView() { if (curWindow != null) { curWindow.propertyView = new CS_CharacterPropertyView(); curWindow.workView = new CS_CharacterWorkView(); } else { curWindow = GetWindow <CS_CharacterEditorWindow>(); } }
public static void LoadGraph() { CS_CharacterGraph 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_CharacterGraph)AssetDatabase.LoadAssetAtPath(finalPath, typeof(CS_CharacterGraph)); if (curGraph != null) { CS_CharacterEditorWindow curWindows = EditorWindow.GetWindow <CS_CharacterEditorWindow>(); if (curWindows != null) { curWindows.currentGraph = curGraph; } } else { EditorUtility.DisplayDialog("Dialog Message", "Unable to load selected graph!", "ok"); } }
public static void InitCharacterEditor() { CS_CharacterEditorWindow.InitEditorWindow(); }