@@ -32,7 +32,7 @@ namespace FbxExporters
32
32
public const string FBX_PREFAB_FILE = "/UnityFbxPrefab.dll" ;
33
33
#endif
34
34
35
- const string MenuItemName = "GameObject/Update from Fbx " ;
35
+ const string MenuItemName = "GameObject/Update from FBX " ;
36
36
37
37
public static string FindFbxPrefabAssetPath ( )
38
38
{
@@ -184,12 +184,6 @@ static void OnContextItem(MenuCommand command)
184
184
}
185
185
}
186
186
187
- if ( selection == null || selection . Length == 0 )
188
- {
189
- ModelExporter . DisplayNoSelectionDialog ( ) ;
190
- return ;
191
- }
192
-
193
187
foreach ( GameObject selectedObject in selection )
194
188
{
195
189
UpdateLinkedPrefab ( selectedObject ) ;
@@ -203,11 +197,25 @@ static void OnContextItem(MenuCommand command)
203
197
public static bool OnValidateMenuItem ( )
204
198
{
205
199
GameObject [ ] selection = Selection . GetFiltered < GameObject > ( SelectionMode . Editable | SelectionMode . TopLevel ) ;
200
+
201
+ if ( selection == null || selection . Length == 0 )
202
+ {
203
+ UnityEditor . EditorUtility . DisplayDialog (
204
+ string . Format ( "{0} Warning" , ModelExporter . PACKAGE_UI_NAME ) ,
205
+ "No GameObjects selected for update." ,
206
+ "Ok" ) ;
207
+ return false ;
208
+ }
209
+
206
210
foreach ( GameObject selectedObject in selection )
207
211
{
208
212
GameObject prefab = UnityEditor . PrefabUtility . GetPrefabParent ( selectedObject ) as GameObject ;
209
213
if ( ! prefab )
210
214
{
215
+ UnityEditor . EditorUtility . DisplayDialog (
216
+ string . Format ( "{0} Warning" , ModelExporter . PACKAGE_UI_NAME ) ,
217
+ "These GameObjects aren't prefab." ,
218
+ "Ok" ) ;
211
219
return false ;
212
220
}
213
221
if ( prefab . GetComponentInChildren < FbxPrefab > ( ) )
0 commit comments