コード例 #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            LocalizationInitializer.Startup();

            Target = target as LocalizationService;

            if (Application.isPlaying)
            {
                return;
            }

            EditorGUILayout.LabelField("Default Language");
            var di  = Array.IndexOf(Target.Languages, Target.DefaultLanguage);
            var di2 = EditorGUILayout.Popup(di, Target.Languages.Select(o => o.Name).ToArray());

            if (di != di2)
            {
                Target.DefaultLanguage = Target.Languages[di2];
                EditorUtility.SetDirty(target);
            }

            EditorGUILayout.LabelField("Cached Language");
            EditorGUILayout.LabelField(Target.Language.Name, EditorStyles.boldLabel);

            GUILayout.Space(16);

            if (GUILayout.Button("Reset Cached Language"))
            {
                Target.Language = Target.DefaultLanguage;
                EditorUtility.SetDirty(target);
            }

            if (GUILayout.Button("Reset Language List"))
            {
                Target.Languages = LanguageInfo.All;
                EditorUtility.SetDirty(target);
            }
        }
コード例 #2
0
 public static void ShowWindow()
 {
     LocalizationInitializer.Startup();
     Selection.activeObject = LocalizationService.Instance;
     EditorGUIUtility.PingObject(LocalizationService.Instance);
 }