DragObj2D

DragObj Public Function, you can inherent override the function or simply call it.

chevron-rightPublic Variablehashtag
  • string mainCanvasName

  • bool isReturnPosition - Open to return to original position when end drag

  • bool isSwapObj - Open to enable swap obj slot

  • bool dropAsFirstSibling

  • Component m_ObjInfoComponent

- Override Function -

chevron-rightOnBeginDrag()hashtag

The function call when the object on begin drag.

Parameter:

  • PointerEventData eventData - pass by the pointer event.

chevron-rightOnDrag()hashtag

The function call when the object on drag.

Parameter:

  • PointerEventData eventData - pass by the pointer event.

chevron-rightOnEndDrag()hashtag

The function call when the object on end drag.

Parameter:

  • PointerEventData eventData - pass by the pointer event.

- Public Function -

chevron-rightInitialize()hashtag

Initialize the DragObj Info by script.

Parameter:

  • Component component - data structure need to stored by dragobj.

  • string canvasName - main canvas name

chevron-rightSetDropParent()hashtag

Change the drag object parent to given transform.

Parameter:

  • Transform transform - transform of the drop parent.

chevron-rightSetRectPosition()hashtag

Change the drag object position to given Vector2 position.

Parameter:

  • Vector2 position - x-y position that want the drag object to be.

chevron-rightSetInitialPosition()hashtag

Set the drag object position to its own initial position.

Last updated