Skip to content

Commit 21e5d10

Browse files
author
Benoit Hudson
committed
UNI-21917 - fix 'convert to model' in GameObject menu
Doesn't seem like you can have an option show up only in the context menu for a gameobject without also showing up in the gameobject menu. So I just made the gameobject menu option work exactly like the assets menu option does.
1 parent bff0fdd commit 21e5d10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ public static bool OnValidateMenuItem ()
5454
static void OnContextItem (MenuCommand command)
5555
{
5656
if (command == null || command.context == null) {
57-
Debug.LogError ("Error: No GameObject selected");
57+
// We were actually invoked from the top GameObject menu,
58+
// not the context menu, so treat it as such.
59+
OnMenuItem();
5860
return;
5961
}
62+
6063
GameObject selected = command.context as GameObject;
6164
if (selected == null) {
6265
Debug.LogError (string.Format("Error: {0} is not a GameObject and cannot be converted", command.context.name));

0 commit comments

Comments
 (0)