コード例 #1
0
    public static void ShowWindow(string path)
    {
        m_currentPath = path;
        FontEditorWindow window = (FontEditorWindow)EditorWindow.GetWindow(typeof(FontEditorWindow));

        window.name = "FontEditorWindow";
        window.Show(false);
        m_textureList = new List <string>();
        DirectoryInfo dir      = new DirectoryInfo(path);
        string        fileName = dir.Name;

        FileInfo[] files  = dir.GetFiles();
        int        length = files.Length;

        m_fontPath = m_currentPath + "/" + fileName + ".fontsettings";
        m_font     = (Font)AssetDatabase.LoadAssetAtPath(m_fontPath, typeof(Font));

        string pngName = fileName + ".png";

        for (int i = 0; i < length; i++)
        {
            if (files[i].Extension == ".png" && files[i].Name != pngName)
            {
                string tPath = m_currentPath + "/" + files[i].Name;
                m_textureList.Add(tPath);
            }
        }

        m_charList = new List <int>();
        length     = m_font.characterInfo.Length;
        for (int i = 0; i < length; i++)
        {
            m_charList.Add(m_font.characterInfo[i].index);
        }
    }
コード例 #2
0
 public static void OpenFontEditorWindow()
 {
     FontEditorWindow.ShowSelf();
 }