Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

IDropHandler

Namespace: UnityEngine.EventSystems

/

Description

Interface to implement if you wish to receive OnDrop callbacks.

using UnityEngine;
using UnityEngine.EventSystems;

public class DropMe : MonoBehaviour, IDropHandler
{
	public void OnDrop(PointerEventData data)
	{
		if (data.pointerDrag != null)
		{
			Debug.Log ("Dropped object was: "  + data.pointerDrag);
		}
	}
}

Functions

OnDrop Called by a BaseInputModule on a target that can accept a drop.