public override void OnInspectorGUI() { //DrawDefaultInspector (); script.Update(); EditorGUI.BeginChangeCheck(); this.languageControl.polyglot = AssetDatabase.LoadAssetAtPath <PolyglotSave>(languageControl.GetSaveLocalPath()); languageControl.selectedLanguage = EditorGUILayout.Popup("Selected Languages: ", languageControl.selectedLanguage, languageControl.polyglot.languages.ToArray()); EditorGUILayout.PropertyField(LanguageChanged); if (EditorGUI.EndChangeCheck()) { script.ApplyModifiedProperties(); } }
public void OnEnable() { languageControl = (LanguageControl)target; script = new SerializedObject(target); if (languageControl.polyglot == null) { this.languageControl.polyglot = AssetDatabase.LoadAssetAtPath <PolyglotSave>(languageControl.GetSaveLocalPath()); } LanguageChanged = script.FindProperty("LanguageChanged"); }