internal virtual void OnEnable() { this.m_ActiveEditorIndex = EditorPrefs.GetInt(this.GetType().Name + "ActiveEditorIndex", 0); if (!((UnityEngine.Object) this.m_ActiveEditor == (UnityEngine.Object) null)) return; this.m_ActiveEditor = Editor.CreateEditor(this.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; }
internal void ApplyAndImport() { this.Apply(); this.m_MightHaveModified = false; AssetImporterInspector.ImportAssets(this.GetAssetPaths()); this.ResetValues(); }
public virtual void OnDisable() { AssetImporter target = this.target as AssetImporter; if (Unsupported.IsDestroyScriptableObject((ScriptableObject)this) && this.m_MightHaveModified && ((Object)target != (Object)null && !InternalEditorUtility.ignoreInspectorChanges) && (this.HasModified() && !this.AssetWasUpdated())) { string message = "Unapplied import settings for '" + target.assetPath + "'"; if (this.targets.Length > 1) { message = "Unapplied import settings for '" + (object)this.targets.Length + "' files"; } if (EditorUtility.DisplayDialog("Unapplied import settings", message, "Apply", "Revert")) { this.Apply(); this.m_MightHaveModified = false; AssetImporterInspector.ImportAssets(this.GetAssetPaths()); } } if (this.m_SerializedObject == null || !this.m_SerializedObject.hasModifiedProperties) { return; } this.m_SerializedObject.Cache(this.GetInstanceID()); this.m_SerializedObject = (SerializedObject)null; }
internal virtual void OnEnable() { this.m_ActiveEditorIndex = EditorPrefs.GetInt(base.GetType().Name + "ActiveEditorIndex", 0); if (this.m_ActiveEditor == null) { this.m_ActiveEditor = Editor.CreateEditor(base.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; } }
private void OnDestroy() { AssetImporterInspector activeEditor = this.activeEditor; if (!((UnityEngine.Object) activeEditor != (UnityEngine.Object) null)) return; this.m_ActiveEditor = (AssetImporterInspector) null; UnityEngine.Object.DestroyImmediate((UnityEngine.Object) activeEditor); }
private void OnDestroy() { AssetImporterInspector activeEditor = this.activeEditor; if (activeEditor != null) { this.m_ActiveEditor = null; Object.DestroyImmediate(activeEditor); } }
internal virtual void OnEnable() { this.m_ActiveEditorIndex = EditorPrefs.GetInt(this.GetType().Name + "ActiveEditorIndex", 0); if (!((UnityEngine.Object) this.m_ActiveEditor == (UnityEngine.Object)null)) { return; } this.m_ActiveEditor = Editor.CreateEditor(this.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; }
private void OnDestroy() { AssetImporterInspector activeEditor = this.activeEditor; if (activeEditor != null) { this.m_ActiveEditor = null; UnityEngine.Object.DestroyImmediate(activeEditor); } }
private void OnDestroy() { AssetImporterInspector activeEditor = this.activeEditor; if (!((UnityEngine.Object)activeEditor != (UnityEngine.Object)null)) { return; } this.m_ActiveEditor = (AssetImporterInspector)null; UnityEngine.Object.DestroyImmediate((UnityEngine.Object)activeEditor); }
public override void OnInspectorGUI() { EditorGUI.BeginDisabledGroup(false); GUI.enabled = true; GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); EditorGUI.BeginChangeCheck(); this.m_ActiveEditorIndex = GUILayout.Toolbar(this.m_ActiveEditorIndex, this.m_SubEditorNames); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetInt(this.GetType().Name + "ActiveEditorIndex", this.m_ActiveEditorIndex); AssetImporterInspector activeEditor = this.activeEditor; this.m_ActiveEditor = (AssetImporterInspector) null; UnityEngine.Object.DestroyImmediate((UnityEngine.Object) activeEditor); this.m_ActiveEditor = Editor.CreateEditor(this.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; this.m_ActiveEditor.assetEditor = this.assetEditor; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUI.EndDisabledGroup(); this.activeEditor.OnInspectorGUI(); }
public override void OnInspectorGUI() { EditorGUI.BeginDisabledGroup(false); GUI.enabled = true; GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); EditorGUI.BeginChangeCheck(); this.m_ActiveEditorIndex = GUILayout.Toolbar(this.m_ActiveEditorIndex, this.m_SubEditorNames, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetInt(base.GetType().Name + "ActiveEditorIndex", this.m_ActiveEditorIndex); AssetImporterInspector activeEditor = this.activeEditor; this.m_ActiveEditor = null; UnityEngine.Object.DestroyImmediate(activeEditor); this.m_ActiveEditor = Editor.CreateEditor(base.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; this.m_ActiveEditor.assetEditor = this.assetEditor; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUI.EndDisabledGroup(); this.activeEditor.OnInspectorGUI(); }
public override void OnInspectorGUI() { using (new EditorGUI.DisabledScope(false)) { GUI.enabled = true; GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); EditorGUI.BeginChangeCheck(); this.m_ActiveEditorIndex = GUILayout.Toolbar(this.m_ActiveEditorIndex, this.m_SubEditorNames, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetInt(base.GetType().Name + "ActiveEditorIndex", this.m_ActiveEditorIndex); AssetImporterInspector activeEditor = this.activeEditor; this.m_ActiveEditor = null; Object.DestroyImmediate(activeEditor); this.m_ActiveEditor = Editor.CreateEditor(base.targets, this.m_SubEditorTypes[this.m_ActiveEditorIndex]) as AssetImporterInspector; this.m_ActiveEditor.assetEditor = this.assetEditor; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } this.activeEditor.OnInspectorGUI(); }