public override void OnInspectorGUI() { GUILayout.Label(Styles.sketchUpLabel, EditorStyles.boldLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_GenerateBackFace, Styles.generateBackFaceLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_MergeCoplanarFaces, Styles.mergeCoplanarFaces, new GUILayoutOption[0]); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(EditorGUIUtility.labelWidth) }; GUILayout.Label(Styles.fileUnitLabel, options); GUILayout.Label("1", new GUILayoutOption[0]); GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.MaxWidth(100f) }; EditorGUILayout.Popup(this.m_FileUnit, Styles.measurementOptions, GUIContent.Temp(""), optionArray2); this.lengthToUnit = ConvertGlobalScaleToUnit((EFileUnit)this.m_FileUnit.intValue, this.m_GlobalScale.floatValue); GUILayout.Label("=", new GUILayoutOption[0]); this.lengthToUnit = EditorGUILayout.FloatField(this.lengthToUnit, new GUILayoutOption[0]); this.m_GlobalScale.floatValue = CovertUnitToGlobalScale((EFileUnit)this.m_FileUnit.intValue, this.lengthToUnit); EditorGUILayout.EndHorizontal(); using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.FloatField(Styles.longitudeLabel, this.m_Longitude.floatValue, new GUILayoutOption[0]); EditorGUILayout.FloatField(Styles.latitudeLabel, this.m_Latitude.floatValue, new GUILayoutOption[0]); EditorGUILayout.FloatField(Styles.northCorrectionLabel, this.m_NorthCorrection.floatValue, new GUILayoutOption[0]); } EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(Styles.selectNodeButton, new GUILayoutOption[0])) { SketchUpImportDlg.Launch(this.m_Target.GetNodes(), this); GUIUtility.ExitGUI(); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); base.OnInspectorGUI(); }
public override void OnInspectorGUI() { GUILayout.Label(Styles.sketchUpLabel, EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_GenerateBackFace, Styles.generateBackFaceLabel); EditorGUILayout.PropertyField(m_MergeCoplanarFaces, Styles.mergeCoplanarFaces); EditorGUILayout.BeginHorizontal(); GUILayout.Label(Styles.fileUnitLabel, GUILayout.MinWidth(EditorGUIUtility.labelWidth)); GUILayout.Label("1"); EditorGUILayout.Popup(m_FileUnit, Styles.measurementOptions, GUIContent.Temp(""), GUILayout.MaxWidth(100)); lengthToUnit = ConvertGlobalScaleToUnit((EFileUnit)m_FileUnit.intValue, m_GlobalScale.floatValue); GUILayout.Label("="); lengthToUnit = EditorGUILayout.FloatField(lengthToUnit); m_GlobalScale.floatValue = CovertUnitToGlobalScale((EFileUnit)m_FileUnit.intValue, lengthToUnit); EditorGUILayout.EndHorizontal(); using (new EditorGUI.DisabledScope(true)) { EditorGUILayout.FloatField(Styles.longitudeLabel, m_Longitude.floatValue); EditorGUILayout.FloatField(Styles.latitudeLabel, m_Latitude.floatValue); EditorGUILayout.FloatField(Styles.northCorrectionLabel, m_NorthCorrection.floatValue); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(Styles.selectNodeButton)) { SketchUpNodeInfo[] nodes = m_Target.GetNodes(); SketchUpImportDlg.Launch(nodes, this); GUIUtility.ExitGUI(); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); EditorGUILayout.PropertyField(m_ImportCameras, ModelImporterModelEditor.Styles.ImportCameras); MeshesGUI(); GUILayout.Label(ModelImporterModelEditor.Styles.Geometry, EditorStyles.boldLabel); using (var horizontal = new EditorGUILayout.HorizontalScope()) { using (var prop = new EditorGUI.PropertyScope(horizontal.rect, ModelImporterModelEditor.Styles.IndexFormatLabel, m_IndexFormat)) { EditorGUI.BeginChangeCheck(); var newValue = (int)(ModelImporterIndexFormat)EditorGUILayout.EnumPopup(prop.content, (ModelImporterIndexFormat)m_IndexFormat.intValue); if (EditorGUI.EndChangeCheck()) { m_IndexFormat.intValue = newValue; } } } UvsGUI(); }
public override void OnInspectorGUI() { GUILayout.Label(SketchUpImporterModelEditor.Styles.sketchUpLabel, EditorStyles.boldLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_GenerateBackFace, SketchUpImporterModelEditor.Styles.generateBackFaceLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_MergeCoplanarFaces, SketchUpImporterModelEditor.Styles.mergeCoplanarFaces, new GUILayoutOption[0]); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(SketchUpImporterModelEditor.Styles.fileUnitLabel, new GUILayoutOption[] { GUILayout.MinWidth(EditorGUIUtility.labelWidth) }); GUILayout.Label("1", new GUILayoutOption[0]); EditorGUILayout.Popup(this.m_FileUnit, SketchUpImporterModelEditor.Styles.measurementOptions, GUIContent.Temp(string.Empty), new GUILayoutOption[] { GUILayout.MaxWidth(100f) }); this.lengthToUnit = SketchUpImporterModelEditor.ConvertGlobalScaleToUnit((SketchUpImporterModelEditor.EFileUnit) this.m_FileUnit.intValue, this.m_GlobalScale.floatValue); GUILayout.Label("=", new GUILayoutOption[0]); this.lengthToUnit = EditorGUILayout.FloatField(this.lengthToUnit, new GUILayoutOption[0]); this.m_GlobalScale.floatValue = SketchUpImporterModelEditor.CovertUnitToGlobalScale((SketchUpImporterModelEditor.EFileUnit) this.m_FileUnit.intValue, this.lengthToUnit); EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(true); EditorGUILayout.FloatField(SketchUpImporterModelEditor.Styles.longitudeLabel, this.m_Longitude.floatValue, new GUILayoutOption[0]); EditorGUILayout.FloatField(SketchUpImporterModelEditor.Styles.latitudeLabel, this.m_Latitude.floatValue, new GUILayoutOption[0]); EditorGUILayout.FloatField(SketchUpImporterModelEditor.Styles.northCorrectionLabel, this.m_NorthCorrection.floatValue, new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(SketchUpImporterModelEditor.Styles.selectNodeButton, new GUILayoutOption[0])) { SketchUpNodeInfo[] nodes = this.m_Target.GetNodes(); SketchUpImportDlg.Launch(nodes, this); GUIUtility.ExitGUI(); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); base.OnInspectorGUI(); }