private static void OnContextMenu(MenuCommand command) { if (command.context is Component component) { UVWindow.GetWindow().Inspect(component.gameObject); } }
private static void OnPropertyContextMenu(GenericMenu menu, SerializedProperty property) { if (HasValidMeshReference(property, out Mesh mesh)) { menu.AddItem(new GUIContent("Inspect in UV Window"), false, () => { UVWindow.GetWindow().Mesh = mesh; }); } }
private static void OnPropertyContextMenu(GenericMenu menu, SerializedProperty property) { if (HasValidMeshReference(property)) { var content = new GUIContent(commandName); var component = property.serializedObject.targetObject as Component; if (component != null) { menu.AddItem(content, false, () => { UVWindow.GetWindow().Inspect(component.gameObject); }); } else { menu.AddDisabledItem(content); } } }