using System;
using UnityEngine;

public class PhotoWindowDragMove : UIDragDropItem
{
	public void Awake()
	{
		this.uiCamera = GameObject.Find("UI Root/Camera").GetComponent<Camera>();
		this.uiPanel = base.GetComponent<UIPanel>();
	}

	protected override void Update()
	{
		base.Update();
		if (this.mDragging && !NInput.GetMouseButton(0))
		{
			base.StopDragging(null);
		}
		if (0 < this.updateDraw)
		{
			this.updateDraw--;
			if (this.uiPanel != null && this.updateDraw % 2 == 0)
			{
				this.uiPanel.SetDirty();
			}
		}
	}

	protected override void StartDragging()
	{
		if (UICamera.currentKey != KeyCode.Mouse0)
		{
			return;
		}
		base.StartDragging();
	}

	protected override void OnDragDropMove(Vector2 delta)
	{
		base.OnDragDropMove(delta);
	}

	protected override void OnDragDropStart()
	{
		base.OnDragDropStart();
		this.updateDraw = 1;
	}

	protected override void OnDragDropRelease(GameObject surface)
	{
		base.OnDragDropRelease(surface);
		this.updateDraw = 6;
	}

	protected override Transform TaregetTrans
	{
		get
		{
			return this.WindowTransform;
		}
	}

	public Transform WindowTransform;

	private UIPanel uiPanel;

	private int updateDraw;

	private Camera uiCamera;
}
