8000 GitHub - kinifi/DragAndDropSprites: drag and drop sprites
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

kinifi/DragAndDropSprites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DragAndDropSprites

drag and drop sprite framework for Unity in 2D using Sprites

DragAndDropManager

Controls what objects can be dropped on. This will always have a single instance and will destroy other instances if they exist.

Properties Include:

  • GameObject[] m_PlacedObjects - An array of GameObjects we can drop onto.
  • bool isDragging - Are we currently dragging and object?
  • bool enableSnapping - Snap Objects when dropped to the middle
  • Transform m_PreviousPosition - The Position we started dragging the Object

Methods:

  • Init() - Called when the instance has been created
  • public bool isPlaced(GameObject setDownGameObject) - Used for objects that can be dragged to check if they can be dropped
    • Controls callbacks

Callbacks (Not Required):

  • OnPlaced(GameObject theObjectBeingPlacedOn) - called on the object that is being dragged after its been dropped
  • OnPlaced(GameObject theObjectThatIsDroppingOnSelf) - called when the object has something dropped on it

About

drag and drop sprites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0