@@ -92,16 +92,15 @@ public override void OnInspectorGUI() {
92
92
"Integrations Path:" ,
93
93
"Relative path for saving 3D application integrations." ) , GUILayout . Width ( LabelWidth - 3 ) ) ;
94
94
95
- var IntegrationsPathLabel = ExportSettings . GetRelativeSavePath ( ) ;
96
- if ( IntegrationsPathLabel == "." ) { IntegrationsPathLabel = "(Assets root)" ; }
95
+ var IntegrationsPathLabel = ExportSettings . GetIntegrationSavePath ( ) ;
97
96
EditorGUILayout . SelectableLabel ( IntegrationsPathLabel ,
98
97
EditorStyles . textField ,
99
98
GUILayout . MinWidth ( SelectableLabelMinWidth ) ,
100
99
GUILayout . Height ( EditorGUIUtility . singleLineHeight ) ) ;
101
100
102
- if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new location for saving model prefabs " ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
101
+ if ( GUILayout . Button ( new GUIContent ( "..." , "Browse to a new location for saving 3D application integrations " ) , EditorStyles . miniButton , GUILayout . Width ( BrowseButtonWidth ) ) )
103
102
{
104
- string initialPath = ExportSettings . GetAbsoluteSavePath ( ) ;
103
+ string initialPath = ExportSettings . GetIntegrationSavePath ( ) ;
105
104
106
105
// if the directory doesn't exist, set it to the default save path
107
106
// so we don't open somewhere unexpected
@@ -111,26 +110,18 @@ public override void OnInspectorGUI() {
111
110
}
112
111
113
112
string fullPath = EditorUtility . OpenFolderPanel (
114
- "Select Model Prefabs Path" , initialPath , null
113
+ "Select Integrations Path" , initialPath , null
115
114
) ;
116
115
117
116
// Unless the user canceled, make sure they chose something in the Assets folder.
118
117
if ( ! string . IsNullOrEmpty ( fullPath ) )
119
118
{
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 ) ;
119
+ ExportSettings . SetIntegrationSavePath ( fullPath ) ;
128
120
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
- }
121
+ // Make sure focus is removed from the selectable label
122
+ // otherwise it won't update
123
+ GUIUtility . hotControl = 0 ;
124
+ GUIUtility . keyboardControl = 0 ;
134
125
}
135
126
}
136
127
@@ -296,6 +287,8 @@ public static string kDefaultAdskRoot {
296
287
public bool centerObjects ;
297
288
public bool launchAfterInstallation ;
298
289
290
+ public string IntegrationSavePath ;
291
+
299
292
public int selectedDCCApp = 0 ;
300
293
301
294
/// <summary>
@@ -324,6 +317,7 @@ protected override void LoadDefaults()
324
317
centerObjects = true ;
325
318
launchAfterInstallation = true ;
326
319
convertToModelSavePath = kDefaultSavePath ;
320
+ IntegrationSavePath = Directory . GetCurrentDirectory ( ) . ToString ( ) ;
327
321
dccOptionPaths = null ;
328
322
dccOptionNames = null ;
329
323
}
@@ -736,6 +730,16 @@ public static void SetRelativeSavePath(string newPath) {
736
730
instance . convertToModelSavePath = NormalizePath ( newPath , isRelative : true ) ;
737
731
}
738
732
733
+ public static string GetIntegrationSavePath ( )
734
+ {
735
+ return instance . IntegrationSavePath ;
736
+ }
737
+
738
+ public static void SetIntegrationSavePath ( string newPath )
739
+ {
740
+ instance . IntegrationSavePath = newPath ;
741
+ }
742
+
739
743
/// <summary>
740
744
/// Convert an absolute path into a relative path like what you would
741
745
/// get from GetRelativeSavePath.
0 commit comments