private void DrawDragAndDrop(SpAtlas atlas) { var dropRect = SpHelper.Reserve(48.0f); // Open drag and drop window? if (GUI.Button(dropRect, "Add Textures\n(Drag And Drop)") == true) { var drop = SpDrop_Window.Open(); drop.CurrentAtlas = atlas; drop.Repaint(); } SpHelper.DrawDragAndDropZone(dropRect); SpHelper.HandleDradAndDrop(atlas, dropRect); }
public void OnGUI() { var dropRect = SpHelper.Reserve(position.height - 2.0f); if (CurrentAtlas != null) { if (GUI.Button(dropRect, "Add To " + CurrentAtlas.name + "\n(Drag And Drop)") == true) { Selection.activeObject = CurrentAtlas; } SpHelper.DrawDragAndDropZone(dropRect); SpHelper.HandleDradAndDrop(CurrentAtlas, dropRect); } else { EditorGUI.BeginDisabledGroup(true); { GUI.Button(dropRect, "No Atlas Selected"); } EditorGUI.EndDisabledGroup(); } }