using UnityEngine;
using UnityEngine.EventSystems;
namespace UIWidgets {
///
/// ResizableHeaderDragCell.
///
public class ResizableHeaderDragCell : DragSupport {
///
/// The position.
///
public int Position = -1;
///
/// ResizableHeader.
///
public ResizableHeader ResizableHeader;
///
/// Determines whether this instance can be dragged.
///
/// true if this instance can be dragged; otherwise, false.
/// Current event data.
public override bool CanDrag(PointerEventData eventData)
{
return !ResizableHeader.InActiveRegion && ResizableHeader.AllowReorder;
}
///
/// Set Data, which will be passed to Drop component.
///
/// Current event data.
protected override void InitDrag(PointerEventData eventData)
{
ResizableHeader.ProcessCellReorder = true;
Data = this;
}
///
/// Called when drop completed.
///
/// true if Drop component received data; otherwise, false.
public override void Dropped(bool success)
{
ResizableHeader.ProcessCellReorder = false;
base.Dropped(success);
}
}
}