Exemplo n.º 1
0
    public static void InitEditorWindow()
    {
        curWindow = GetWindow <CS_CharacterEditorWindow>();
        curWindow.titleContent.text = "Dialog Editor";

        CreateView();
    }
Exemplo n.º 2
0
    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");
        }
    }
Exemplo n.º 3
0
    public static void UnloadGraph()
    {
        CS_CharacterEditorWindow curWindows = EditorWindow.GetWindow <CS_CharacterEditorWindow>();

        if (curWindows != null)
        {
            curWindows.currentGraph = null;
        }
    }
Exemplo n.º 4
0
 static void CreateView()
 {
     if (curWindow != null)
     {
         curWindow.propertyView = new CS_CharacterPropertyView();
         curWindow.workView     = new CS_CharacterWorkView();
     }
     else
     {
         curWindow = GetWindow <CS_CharacterEditorWindow>();
     }
 }
Exemplo n.º 5
0
    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");
        }
    }
Exemplo n.º 6
0
 public static void InitCharacterEditor()
 {
     CS_CharacterEditorWindow.InitEditorWindow();
 }