//フォントを変更
        void FontChange(bool autoSave)
        {
            Font arialFont = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;

            if (this.UiFont == arialFont)
            {
                return;
            }
            if (this.UiFont == null)
            {
                return;
            }

            //シーンをセーブ
            if (autoSave)
            {
                WrapperUnityVersion.SaveScene();
            }
            else
            {
                if (!WrapperUnityVersion.SaveCurrentSceneIfUserWantsTo())
                {
                    return;
                }
            }

            Debug.Log("Font Change Arial to " + this.UiFont.name);
            AssetDatabase.Refresh();
            ReferenceAssetChanger.FindAndChangeAll(arialFont, UiFont, this.newProjectDir);
        }
Example #2
0
        protected override void OnGUISub()
        {
            base.OnGUISub();
            projectDir = EditorGUILayout.ObjectField("Project Dir", projectDir, typeof(Object), false) as Object;
            from       = EditorGUILayout.ObjectField("From", from, typeof(Font), false) as Font;
            to         = EditorGUILayout.ObjectField("To", to, typeof(Font), false) as Font;

            bool isDisable = (from == null || to == null);

            EditorGUI.BeginDisabledGroup(isDisable);
            if (GUILayout.Button("Go!", GUILayout.Width(80f)))
            {
                Debug.Log(string.Format("Font Change {0} to {1} ", this.from.name, this.to.name));

                string dir = (projectDir == null) ? "" : AssetDatabase.GetAssetPath(projectDir);
                ReferenceAssetChanger.FindAndChangeAll(this.from, this.to, dir);
            }
            EditorGUI.EndDisabledGroup();
        }