public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); DrawDefaultInspector(); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); using (new EditorGUI.DisabledScope(true)) EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script")); EditorGUILayout.PropertyField(this.settingsProperty); EditorGUI.indentLevel++; if (this.settingsProperty.objectReferenceValue == null) { this.editor = null; } if (this.editor == null && this.settingsProperty.objectReferenceValue != null) { Editor.CreateCachedEditor(this.settingsProperty.objectReferenceValue, null, ref this.editor); } if (this.editor != null) { this.editor.DrawDefaultInspector(); this.editor.serializedObject.ApplyModifiedProperties(); } EditorGUI.indentLevel--; if (!searchedInstallation) { kinectInstall = KinectEditorUtils.FindInstallation(); searchedInstallation = true; } if (kinectInstall == KinectInstall.Ignore) { EditorGUILayout.HelpBox("Unable to find Kinect 2.0 SDK installation.", MessageType.Warning); } else if (kinectInstall == KinectInstall.Missing) { EditorGUILayout.HelpBox("Kinect 2.0 SDK is not installed. Components that require the SDK can throw errors.", MessageType.Error); } serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); using (new EditorGUI.DisabledScope(true)) EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script")); ProjectorEditorUtils.BrainInHierarchy(this.me.transform, ref this.brain); ProjectorEditorUtils.BrainField(this.brain); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); using (new EditorGUI.DisabledScope(true)) EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script")); ProjectorEditorUtils.BrainInHierarchy(this.me.transform, ref this.brain); ProjectorEditorUtils.BrainField(this.brain); EditorGUILayout.PropertyField(this.configurationProperty); EditorGUI.indentLevel++; if (this.configurationProperty.objectReferenceValue == null) { this.editor = null; } if (this.editor == null && this.configurationProperty.objectReferenceValue != null) { Editor.CreateCachedEditor(this.configurationProperty.objectReferenceValue, null, ref this.editor); } if (this.editor != null) { this.editor.DrawDefaultInspector(); this.editor.serializedObject.ApplyModifiedProperties(); } EditorGUI.indentLevel--; EditorGUILayout.PropertyField(this.planeProperty); if (GUI.changed && this.me.Configuration != null) { this.me.ApplyModificationsToCamera(); } serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); DrawDefaultInspector(); if (GUI.changed) { if (this.me.TxtConfiguration != null && this.me.TxtConfiguration != this.textAsset) { Convert(); } this.textAsset = this.me.TxtConfiguration; } if (this.me.TxtConfiguration == textAsset && textAsset != null) { if (GUILayout.Button("Convert Again")) { Convert(); } } if (EditorApplication.timeSinceStartup < converted) { EditorGUILayout.HelpBox("Converted successfully!", MessageType.Info); } EditorGUILayout.HelpBox("This component is only required to convert old configuration files. Please remove it before building.", MessageType.Warning); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); using (new EditorGUI.DisabledScope(true)) EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script")); EditorGUILayout.PropertyField(this.settingsProperty); EditorGUI.indentLevel++; if (this.settingsProperty.objectReferenceValue == null) { this.editor = null; } if (this.editor == null && this.settingsProperty.objectReferenceValue != null) { Editor.CreateCachedEditor(this.settingsProperty.objectReferenceValue, null, ref this.editor); } if (this.editor != null) { this.editor.DrawDefaultInspector(); this.editor.serializedObject.ApplyModifiedProperties(); } EditorGUI.indentLevel--; PreviewChecks(); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }
public override void OnInspectorGUI() { EditorGUI.BeginChangeCheck(); serializedObject.Update(); EditorUtils.BrandField(); using (new EditorGUI.DisabledScope(true)) EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script")); EditorGUILayout.PropertyField(this.settingsProperty); EditorGUI.indentLevel++; if (this.settingsProperty.objectReferenceValue == null) { this.editor = null; } if (this.editor == null && this.settingsProperty.objectReferenceValue != null) { Editor.CreateCachedEditor(this.settingsProperty.objectReferenceValue, null, ref this.editor); } if (this.editor != null) { this.editor.DrawDefaultInspector(); this.editor.serializedObject.ApplyModifiedProperties(); } EditorGUI.indentLevel--; EditorGUILayout.PropertyField(this.overwriteLocalFilesProperty); EditorGUILayout.PropertyField(this.enableInEditorProperty); if (this.enableInEditorProperty.boolValue) { EditorGUILayout.HelpBox("Its recommended to disable this component in the editor to reduce loading time.", MessageType.Warning); } EditorGUILayout.LabelField("Add ScriptableObject you want to import and export and the GameObject that holds a reference to it. Awake will be called on all GameObjects after a successful import.", EditorStyles.wordWrappedMiniLabel); this.entriesList.DoLayoutList(); if (this.entriesList.index != -1) { SerializedProperty element = this.entriesList.serializedProperty.GetArrayElementAtIndex(this.entriesList.index); ScriptableObject scriptableObject = (ScriptableObject)element.FindPropertyRelative("scriptableObject").objectReferenceValue; EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); this.importAsset = (TextAsset)EditorGUILayout.ObjectField(this.importAsset, typeof(TextAsset), false); if (GUILayout.Button("Import")) { this.me.ImportManually(scriptableObject, Application.dataPath + "/" + AssetDatabase.GetAssetPath(this.importAsset)); ReserializeEntries(this.me); } if (GUILayout.Button("Open")) { EditorUtility.RevealInFinder(ImportExportHelper.ExistingPersistentPath(scriptableObject.name + ".json")); } EditorGUILayout.EndHorizontal(); } string tail = this.me.ReadLogTail(3); if (tail != null) { EditorGUILayout.LabelField(tail, EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Clear Log")) { this.me.ClearLogFile(); } EditorGUILayout.EndHorizontal(); } serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); }