Skip to content

Commit 1e0242e

Browse files
committed
Fixed dialog popup for when objects are not selected
1 parent 9b1d638 commit 1e0242e

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,6 +2486,7 @@ public static void DisplayNoSelectionDialog()
24862486
"No GameObjects selected for export.",
24872487
"Ok");
24882488
}
2489+
24892490
//
24902491
// export mesh info from Unity
24912492
//

Assets/FbxExporters/Editor/FbxPrefabAutoUpdater.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace FbxExporters
3232
public const string FBX_PREFAB_FILE = "/UnityFbxPrefab.dll";
3333
#endif
3434

35-
const string MenuItemName = "GameObject/Update from Fbx";
35+
const string MenuItemName = "GameObject/Update from FBX";
3636

3737
public static string FindFbxPrefabAssetPath()
3838
{
@@ -184,12 +184,6 @@ static void OnContextItem(MenuCommand command)
184184
}
185185
}
186186

187-
if (selection == null || selection.Length == 0)
188-
{
189-
ModelExporter.DisplayNoSelectionDialog();
190-
return;
191-
}
192-
193187
foreach (GameObject selectedObject in selection)
194188
{
195189
UpdateLinkedPrefab(selectedObject);
@@ -203,11 +197,25 @@ static void OnContextItem(MenuCommand command)
203197
public static bool OnValidateMenuItem()
204198
{
205199
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+
206210
foreach (GameObject selectedObject in selection)
207211
{
208212
GameObject prefab = UnityEditor.PrefabUtility.GetPrefabParent(selectedObject) as GameObject;
209213
if (!prefab)
210214
{
215+
UnityEditor.EditorUtility.DisplayDialog(
216+
string.Format("{0} Warning", ModelExporter.PACKAGE_UI_NAME),
217+
"These GameObjects aren't prefab.",
218+
"Ok");
211219
return false;
212220
}
213221
if (prefab.GetComponentInChildren<FbxPrefab>())

0 commit comments

Comments
 (0)