using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

// Token: 0x0200008E RID: 142
public class KeyDrop : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
{
	// Token: 0x06000DFE RID: 3582 RVA: 0x001077FA File Offset: 0x001059FA
	private void Awake()
	{
		this.GetComponents();
	}

	// Token: 0x06000DFF RID: 3583 RVA: 0x00107802 File Offset: 0x00105A02
	public void GetComponents()
	{
		if (!this.img)
		{
			this.img = base.gameObject.GetComponent<Image>();
			this.btn = base.gameObject.GetComponent<Button>();
		}
	}

	// Token: 0x06000E00 RID: 3584 RVA: 0x00107833 File Offset: 0x00105A33
	public void StartDrag()
	{
		this.GetComponents();
		this.img.raycastTarget = true;
		this.btn.interactable = true;
	}

	// Token: 0x06000E01 RID: 3585 RVA: 0x00107853 File Offset: 0x00105A53
	public void EndDrag()
	{
		this.GetComponents();
		this.img.raycastTarget = false;
		this.btn.interactable = false;
	}

	// Token: 0x06000E02 RID: 3586 RVA: 0x00107874 File Offset: 0x00105A74
	public void OnPointerEnter(PointerEventData eventData)
	{
		if (!this.keyControl.KeyOn(this))
		{
			this.keyControl.canDrop = true;
			this.keyControl.hoverBox = this;
			if (this.keyControl.hoverObj)
			{
				this.keyControl.hoverObj.SetSize(this);
			}
		}
	}

	// Token: 0x06000E03 RID: 3587 RVA: 0x001078CA File Offset: 0x00105ACA
	public void OnPointerExit(PointerEventData eventData)
	{
		this.keyControl.canDrop = false;
		this.keyControl.hoverBox = null;
	}

	// Token: 0x06000E04 RID: 3588 RVA: 0x001078E4 File Offset: 0x00105AE4
	public void OnPointerUp(PointerEventData eventData)
	{
	}

	// Token: 0x06000E05 RID: 3589 RVA: 0x001078E6 File Offset: 0x00105AE6
	public void OnPointerDown(PointerEventData eventData)
	{
	}

	// Token: 0x0400167D RID: 5757
	public KeyControl keyControl;

	// Token: 0x0400167E RID: 5758
	public string key;

	// Token: 0x0400167F RID: 5759
	public KeyCode keyCode;

	// Token: 0x04001680 RID: 5760
	public Image img;

	// Token: 0x04001681 RID: 5761
	public Button btn;
}
