Пример #1
0
 private static void OnContextMenu(MenuCommand command)
 {
     if (command.context is Component component)
     {
         UVWindow.GetWindow().Inspect(component.gameObject);
     }
 }
Пример #2
0
 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;
         });
     }
 }
Пример #3
0
 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);
         }
     }
 }