using UnityEditor; //在编辑菜单中增加功能-APP语言版本切换 public class MenuChangeAppLanguage { static void RefreshMenuChecked() { Menu.SetChecked("APP语言版本切换/中文", CommonConfig.AppLanguage == 0); Menu.SetChecked("APP语言版本切换/英文", CommonConfig.AppLanguage == 1); } [MenuItem("APP语言版本切换/中文")] static void ToCN() { PlayerSettings.productName = CommonConfig.AppNames[0]; #if UNITY_IOS PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.xmjssvr.BowArrow"); #endif #if UNITY_ANDROID PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.xmjssvr.BowArrow.mi"); #endif } [MenuItem("APP语言版本切换/中文", true)] static bool ToCN_Check() { RefreshMenuChecked(); return true; } [MenuItem("APP语言版本切换/英文")] static void ToEN() { PlayerSettings.productName = CommonConfig.AppNames[1]; #if UNITY_IOS PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.xmjssvr.BowArrowEn"); #endif #if UNITY_ANDROID PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.xmjssvr.BowArrowEn"); #endif } [MenuItem("APP语言版本切换/英文", true)] static bool ToEN_Check() { RefreshMenuChecked(); return true; } }