Skip to content

Commit a703bc5

Browse files
author
Benoit Hudson
committed
Review comments: better comment, and no need for a try/catch.
1 parent 88ad62c commit a703bc5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ public static class ConvertToModel
2020
{
2121
const string MenuItemName1 = "GameObject/Convert To Prefab";
2222

23-
// Add a menu item called "Export Model..." to a GameObject's context menu.
24-
// OnContextItem gets called once per selected object
25-
// (if the parent and child are selected, then OnContextItem will only be called on the parent)
23+
/// <summary>
24+
/// OnContextItem is called either:
25+
/// * when the user selects the menu item via the top menu (with a null MenuCommand), or
26+
/// * when the user selects the menu item via the context menu (in which case there's a context)
27+
///
28+
/// OnContextItem gets called once per selected object (if the
29+
/// parent and child are selected, then OnContextItem will only be
30+
/// called on the parent)
31+
/// </summary>
2632
[MenuItem (MenuItemName1, false, 30)]
2733
static void OnContextItem (MenuCommand command)
2834
{
@@ -44,11 +50,7 @@ static void OnContextItem (MenuCommand command)
4450
return;
4551
}
4652

47-
try {
48-
Selection.objects = CreateInstantiatedModelPrefab (selection);
49-
} catch (System.Exception xcp) {
50-
Debug.LogException (xcp);
51-
}
53+
Selection.objects = CreateInstantiatedModelPrefab (selection);
5254
}
5355

5456
/// <summary>

0 commit comments

Comments
 (0)