Пример #1
0
 private void HandleCreate()
 {
     if (!base.MouseOnTopOfInspector() && !base.eventSystem.current.alt)
     {
         EditorGUI.BeginChangeCheck();
         Rect rect = SpriteEditorHandles.RectCreator((float)base.textureActualWidth, (float)base.textureActualHeight, SpriteFrameModuleBase.styles.createRect);
         if (EditorGUI.EndChangeCheck() && rect.width > 0f && rect.height > 0f)
         {
             this.CreateSprite(rect);
             GUIUtility.keyboardControl = 0;
         }
     }
 }
Пример #2
0
 private void HandleCreate()
 {
     if (!MouseOnTopOfInspector() && !eventSystem.current.alt)
     {
         // Create new rects via dragging in empty space
         EditorGUI.BeginChangeCheck();
         Rect newRect = SpriteEditorHandles.RectCreator(textureActualWidth, textureActualHeight, styles.createRect);
         if (EditorGUI.EndChangeCheck() && newRect.width > 0f && newRect.height > 0f)
         {
             CreateSprite(newRect);
             GUIUtility.keyboardControl = 0;
         }
     }
 }