NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIDragDropItem Class Reference

UIDragDropItem is a base script for your own Drag & Drop operations. More...

Inheritance diagram for UIDragDropItem:
ExampleDragDropItem

Public Types

enum  Restriction { Restriction.None, Restriction.Horizontal, Restriction.Vertical, Restriction.PressAndHold }
 

Public Attributes

Restriction restriction = Restriction.None
 What kind of restriction is applied to the drag & drop logic before dragging is made possible. More...
 
bool cloneOnDrag = false
 Whether a copy of the item will be dragged instead of the item itself. More...
 
float pressAndHoldDelay = 1f
 How long the user has to press on an item before the drag action activates. More...
 

Protected Member Functions

virtual void Start ()
 Cache the transform. More...
 
virtual void OnDragDropStart ()
 Perform any logic related to starting the drag & drop operation. More...
 
virtual void OnDragDropMove (Vector3 delta)
 Adjust the dragged object's position. More...
 
virtual void OnDragDropRelease (GameObject surface)
 Drop the item onto the specified object. More...
 
IEnumerator EnableDragScrollView ()
 Re-enable the drag scroll view script at the end of the frame. Reason: http://www.tasharen.com/forum/index.php?topic=10203.0 More...
 

Protected Attributes

Transform mTrans
 
Transform mParent
 
Collider mCollider
 
Collider2D mCollider2D
 
UIButton mButton
 
UIRoot mRoot
 
UIGrid mGrid
 
UITable mTable
 
int mTouchID = int.MinValue
 
float mPressTime = 0f
 
UIDragScrollView mDragScrollView = null
 

Detailed Description

UIDragDropItem is a base script for your own Drag & Drop operations.

Member Enumeration Documentation

Enumerator
None 
Horizontal 
Vertical 
PressAndHold 

Member Function Documentation

IEnumerator UIDragDropItem.EnableDragScrollView ( )
protected

Re-enable the drag scroll view script at the end of the frame. Reason: http://www.tasharen.com/forum/index.php?topic=10203.0

virtual void UIDragDropItem.OnDragDropMove ( Vector3  delta)
protectedvirtual

Adjust the dragged object's position.

virtual void UIDragDropItem.OnDragDropRelease ( GameObject  surface)
protectedvirtual

Drop the item onto the specified object.

Reimplemented in ExampleDragDropItem.

virtual void UIDragDropItem.OnDragDropStart ( )
protectedvirtual

Perform any logic related to starting the drag & drop operation.

virtual void UIDragDropItem.Start ( )
protectedvirtual

Cache the transform.

Member Data Documentation

bool UIDragDropItem.cloneOnDrag = false

Whether a copy of the item will be dragged instead of the item itself.

UIButton UIDragDropItem.mButton
protected
Collider UIDragDropItem.mCollider
protected
Collider2D UIDragDropItem.mCollider2D
protected
UIDragScrollView UIDragDropItem.mDragScrollView = null
protected
UIGrid UIDragDropItem.mGrid
protected
Transform UIDragDropItem.mParent
protected
float UIDragDropItem.mPressTime = 0f
protected
UIRoot UIDragDropItem.mRoot
protected
UITable UIDragDropItem.mTable
protected
int UIDragDropItem.mTouchID = int.MinValue
protected
Transform UIDragDropItem.mTrans
protected
float UIDragDropItem.pressAndHoldDelay = 1f

How long the user has to press on an item before the drag action activates.

Restriction UIDragDropItem.restriction = Restriction.None

What kind of restriction is applied to the drag & drop logic before dragging is made possible.


The documentation for this class was generated from the following file: