|
|
|
|
|
|
using System.Collections; |
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Experimental.UIElements; |
|
|
|
|
|
|
|
|
|
|
Vector2 m_LocalMosueOffset; |
|
|
|
Rect m_PreviousParentRect; |
|
|
|
|
|
|
|
public Action OnDragFinished; |
|
|
|
|
|
|
|
public WindowDraggable(bool resizeWithParentwindow = false) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
void OnMouseUp(MouseUpEvent evt) |
|
|
|
{ |
|
|
|
bool emitDragFinishedEvent = m_Active; |
|
|
|
|
|
|
|
m_Active = false; |
|
|
|
|
|
|
|
if (target.HasMouseCapture()) |
|
|
|
|
|
|
evt.StopPropagation(); |
|
|
|
|
|
|
|
RefreshDocking(); |
|
|
|
|
|
|
|
if (emitDragFinishedEvent && OnDragFinished != null) |
|
|
|
{ |
|
|
|
OnDragFinished(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void RefreshDocking() |
|
|
|