@@ -87,6 +87,55 @@ public override void OnInspectorGUI() {
87
87
}
88
88
GUILayout . EndHorizontal ( ) ;
89
89
90
+ GUILayout . BeginHorizontal ( ) ;
91
+ GUILayout . Label ( new GUIContent (
92
+ "Integrations Path:" ,
93
+ "Relative path for saving 3D application integrations." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
94
+
95
+ var IntegrationsPathLabel = ExportSettings . GetRelativeSavePath ( ) ;
96
+ if ( IntegrationsPathLabel == "." ) { IntegrationsPathLabel = "(Assets root)" ; }
97
+ EditorGUILayout . SelectableLabel ( IntegrationsPathLabel ,
98
+ EditorStyles . textField ,
99
+ GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
100
+ GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
101
+
102
+ if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new location for saving model prefabs" ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
103
+ {
104
+ string initialPath = ExportSettings . GetAbsoluteSavePath ( ) ;
105
+
106
+ // if the directory doesn't exist, set it to the default save path
107
+ // so we don't open somewhere unexpected
108
+ if ( ! System . IO . Directory . Exists ( initialPath ) )
109
+ {
110
+ initialPath = Application . dataPath ;
111
+ }
112
+
113
+ string fullPath = EditorUtility . OpenFolderPanel (
114
+ "Select Model Prefabs Path" , initialPath , null
115
+ ) ;
116
+
117
+ // Unless the user canceled, make sure they chose something in the Assets folder.
118
+ if ( ! string . IsNullOrEmpty ( fullPath ) )
119
+ {
120
+ var relativePath = ExportSettings . ConvertToAssetRelativePath ( fullPath ) ;
121
+ if ( string . IsNullOrEmpty ( relativePath ) )
122
+ {
123
+ Debug . LogWarning ( "Please select a location in the Assets folder" ) ;
124
+ }
125
+ else
126
+ {
127
+ ExportSettings . SetRelativeSavePath ( relativePath ) ;
128
+
129
+ // Make sure focus is removed from the selectable label
130
+ // otherwise it won't update
131
+ GUIUtility . hotControl = 0 ;
132
+ GUIUtility . keyboardControl = 0 ;
133
+ }
134
+ }
135
+ }
136
+
137
+ GUILayout . EndHorizontal ( ) ;
138
+
90
139
EditorGUILayout . Space ( ) ;
91
140
92
141
GUILayout . BeginHorizontal ( ) ;
0 commit comments