using System;
using UnityEngine.EventSystems;
namespace UnityEngine.UI.Extensions
{
///
/// Includes a few fixes of my own, mainly to tidy up duplicates, remove unneeded stuff and testing. (nothing major, all the crew above did the hard work!)
///
[RequireComponent(typeof(RectTransform))]
[AddComponentMenu("UI/Extensions/UI Window Base")]
public class UIWindowBase : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{
RectTransform m_transform = null;
private bool _isDragging = false;
public static bool ResetCoords = false;
private Vector3 m_originalCoods = Vector3.zero;
private Canvas m_canvas;
private RectTransform m_canvasRectTransform;
public int KeepWindowInCanvas = 5; // # of pixels of the window that must stay inside the canvas view.
// Use this for initialization
void Start()
{
m_transform = GetComponent();
m_originalCoods = m_transform.position;
m_canvas = GetComponentInParent