override public void OnInspectorGUI() { serializedObject.Update(); //Instance of our RPGTalkLocalization class RPGTalkLocalization localization = (RPGTalkLocalization)target; EditorGUI.BeginChangeCheck(); EditorGUILayout.HelpBox("Put into the array below every language that you have. To create a new Language, simply go to your project, click with the right button, go to Create/Rpgtalk/Language ", MessageType.Info, true); EditorGUILayout.PropertyField(serializedObject.FindProperty("languages"), true); EditorGUILayout.Space(); if (EditorApplication.isPlaying) { EditorGUILayout.LabelField("Default Language: " + LanguageSettings.defaultLanguage); EditorGUILayout.LabelField("Actual Language: " + LanguageSettings.actualLanguage); } else { EditorGUILayout.LabelField("Debug only available on Play Mode."); } EditorGUILayout.HelpBox("You can change the actual language by script calling LanguageSettings.actualLanguage", MessageType.Info, true); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } }
void Awake() { if (singleton == null) { singleton = this; //This object often is the same in every scene, so we don't need to create it more than once. DontDestroyOnLoad(gameObject); } else if (singleton != this) { Destroy(gameObject); } }
void Awake() { if (singleton != null) { Destroy(gameObject); return; } singleton = this; //This object often is the same in every scene, so we don't need to create it more than once. DontDestroyOnLoad(gameObject); SetDefaultLanguage(); }