diff --git a/Packages/nadena.dev.modular-avatar/Editor/AvatarProcessor.cs b/Packages/nadena.dev.modular-avatar/Editor/AvatarProcessor.cs index efba2b74..dc1761ba 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/AvatarProcessor.cs +++ b/Packages/nadena.dev.modular-avatar/Editor/AvatarProcessor.cs @@ -22,6 +22,7 @@ * SOFTWARE. */ +using System; using System.Runtime.CompilerServices; using UnityEditor; using UnityEngine; @@ -60,5 +61,14 @@ namespace nadena.dev.modular_avatar.core.editor { ndmf.AvatarProcessor.ProcessAvatar(avatarGameObject); } + + // ReSharper disable once InconsistentNaming + // ReSharper disable once MemberCanBeMadeStatic.Global + [Obsolete("This is only for compile time compatibility with legacy AAO")] + public int callbackOrder => throw new NotImplementedException(); + + [Obsolete("This is only for compile time compatibility with legacy AAO")] + // ReSharper disable once MemberCanBeMadeStatic.Global + public bool OnPreprocessAvatar(GameObject avatarGameObject) => throw new NotImplementedException(); } } \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs b/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs new file mode 100644 index 00000000..e87aee84 --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs @@ -0,0 +1,46 @@ +#if LEGACY_AVATAR_OPTIMIZER +using UnityEditor; + +namespace nadena.dev.modular_avatar.core.editor +{ + [InitializeOnLoad] + public class LegacyAvatarOptimizerWarning + { + static LegacyAvatarOptimizerWarning() + { + if (SessionState.GetBool("nadena.dev.legacy-aao-warning", false)) return; + SessionState.SetBool("nadena.dev.legacy-aao-warning", true); + EditorApplication.delayCall += DisplayWarning; + } + + private static void DisplayWarning() + { + var isJapanese = true; + + while (true) + { + string message, readInOtherLang; + if (isJapanese) + { + message = "1.4.x以前のAvatar Optimizerがインストールされているようです。\n" + + "現在お使いのModular Avatarでは、1.4.x以前のAvatar Optimizerと互換性がありません。\n" + + "Avatar Optimizerを1.5.0以降に更新してください!"; + readInOtherLang = "Read in English"; + } + else + { + message = "We found Avatar Optimizer 1.4.x or older is installed!\n" + + "This version of Modular Avatar is not compatible with Avatar Optimizer 1.4.x or older!\n" + + "Please upgrade Avatar Optimizer to 1.5.0 or later!"; + readInOtherLang = "日本語で読む"; + } + + if (EditorUtility.DisplayDialog("Modular Avatar", message, "OK", readInOtherLang)) + return; + + isJapanese = !isJapanese; + } + } + } +} +#endif diff --git a/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs.meta b/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs.meta new file mode 100644 index 00000000..85b0f31c --- /dev/null +++ b/Packages/nadena.dev.modular-avatar/Editor/LegacyAvatarOptimizerWarning.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6c944e4e971248d59198fa569a47569f +timeCreated: 1695800488 \ No newline at end of file diff --git a/Packages/nadena.dev.modular-avatar/Editor/nadena.dev.modular-avatar.core.editor.asmdef b/Packages/nadena.dev.modular-avatar/Editor/nadena.dev.modular-avatar.core.editor.asmdef index e81f1ca9..24bfa43c 100644 --- a/Packages/nadena.dev.modular-avatar/Editor/nadena.dev.modular-avatar.core.editor.asmdef +++ b/Packages/nadena.dev.modular-avatar/Editor/nadena.dev.modular-avatar.core.editor.asmdef @@ -29,6 +29,11 @@ "autoReferenced": false, "defineConstraints": [], "versionDefines": [ + { + "name": "com.anatawa12.avatar-optimizer", + "expression": "(,1.5.0-rc.8)", + "define": "LEGACY_AVATAR_OPTIMIZER" + } ], "noEngineReferences": false } \ No newline at end of file