C# Class Fungus.Draggable2D

Detects drag and drop interactions on a Game Object, and sends events to all Flowchart event handlers in the scene. The Game Object must have Collider2D & RigidBody components attached. The Collider2D must have the Is Trigger property set to true. The RigidBody would typically have the Is Kinematic property set to true, unless you want the object to move around using physics. Use in conjunction with the Drag Started, Drag Completed, Drag Cancelled, Drag Entered & Drag Exited event handlers.
Inheritance: UnityEngine.MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler
Mostra file Open project: snozbot/fungus Class Usage Examples

Protected Properties

Property Type Description
delta UnityEngine.Vector3
dragCompletedHandlers List
newPosition UnityEngine.Vector3
startingPosition UnityEngine.Vector3
updatePosition bool

Public Methods

Method Description
OnBeginDrag ( PointerEventData eventData ) : void
OnDrag ( PointerEventData eventData ) : void
OnEndDrag ( PointerEventData eventData ) : void
OnPointerEnter ( PointerEventData eventData ) : void
OnPointerExit ( PointerEventData eventData ) : void
RegisterHandler ( DragCompleted handler ) : void
UnregisterHandler ( DragCompleted handler ) : void

Protected Methods

Method Description
ChangeCursor ( Texture2D cursorTexture ) : void
DoBeginDrag ( ) : void
DoDrag ( ) : void
DoEndDrag ( ) : void
DoPointerEnter ( ) : void
DoPointerExit ( ) : void
LateUpdate ( ) : void
OnMouseDown ( ) : void
OnMouseDrag ( ) : void
OnMouseEnter ( ) : void
OnMouseExit ( ) : void
OnMouseUp ( ) : void
OnTriggerEnter2D ( Collider2D other ) : void
OnTriggerExit2D ( Collider2D other ) : void

Method Details

ChangeCursor() protected method

protected ChangeCursor ( Texture2D cursorTexture ) : void
cursorTexture UnityEngine.Texture2D
return void

DoBeginDrag() protected method

protected DoBeginDrag ( ) : void
return void

DoDrag() protected method

protected DoDrag ( ) : void
return void

DoEndDrag() protected method

protected DoEndDrag ( ) : void
return void

DoPointerEnter() protected method

protected DoPointerEnter ( ) : void
return void

DoPointerExit() protected method

protected DoPointerExit ( ) : void
return void

LateUpdate() protected method

protected LateUpdate ( ) : void
return void

OnBeginDrag() public method

public OnBeginDrag ( PointerEventData eventData ) : void
eventData UnityEngine.EventSystems.PointerEventData
return void

OnDrag() public method

public OnDrag ( PointerEventData eventData ) : void
eventData UnityEngine.EventSystems.PointerEventData
return void

OnEndDrag() public method

public OnEndDrag ( PointerEventData eventData ) : void
eventData UnityEngine.EventSystems.PointerEventData
return void

OnMouseDown() protected method

protected OnMouseDown ( ) : void
return void

OnMouseDrag() protected method

protected OnMouseDrag ( ) : void
return void

OnMouseEnter() protected method

protected OnMouseEnter ( ) : void
return void

OnMouseExit() protected method

protected OnMouseExit ( ) : void
return void

OnMouseUp() protected method

protected OnMouseUp ( ) : void
return void

OnPointerEnter() public method

public OnPointerEnter ( PointerEventData eventData ) : void
eventData UnityEngine.EventSystems.PointerEventData
return void

OnPointerExit() public method

public OnPointerExit ( PointerEventData eventData ) : void
eventData UnityEngine.EventSystems.PointerEventData
return void

OnTriggerEnter2D() protected method

protected OnTriggerEnter2D ( Collider2D other ) : void
other UnityEngine.Collider2D
return void

OnTriggerExit2D() protected method

protected OnTriggerExit2D ( Collider2D other ) : void
other UnityEngine.Collider2D
return void

RegisterHandler() public method

public RegisterHandler ( DragCompleted handler ) : void
handler DragCompleted
return void

UnregisterHandler() public method

public UnregisterHandler ( DragCompleted handler ) : void
handler DragCompleted
return void

Property Details

delta protected_oe property

protected Vector3,UnityEngine delta
return UnityEngine.Vector3

dragCompletedHandlers protected_oe property

protected List dragCompletedHandlers
return List

newPosition protected_oe property

protected Vector3,UnityEngine newPosition
return UnityEngine.Vector3

startingPosition protected_oe property

protected Vector3,UnityEngine startingPosition
return UnityEngine.Vector3

updatePosition protected_oe property

protected bool updatePosition
return bool