Drop Container
Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
A place to drop your drag items. You can use this component to define drop rules restricting the types of Drop Items that can be accepted by this container.
The intended use is that you place this on a Unity Engine UI object e.g. a RectTransform that acts as a slot or drop point for whatever your drag items are.
Drop Containers and Drag Items can specify "types" on them. These types are simply Scriptable Objects that work much like tags. Depending on the Mask Mode you choose to apply you can cause a Drop Container to accept or reject specific items.
For example you can insure that a user cant equip a helmet to its feet but that both boots and helmits can be in bag slots. Working examples of complex situations such as inventory to equipment slots, speel book to action bar and more are shown in the example scenes.
bool
HasItem
true if the container is occupied
Item
the item contained if any
recieveMode
What should this container do when an item is dropped and accepted e.g. Take or Clone
bool
mustBeEmpty
Will this container reject incoming items if its already occupied
maskMode
What filtering rules should be used if any
List<ScriptableObject>
filterTypes
The mask values to be used e.g. items will be tested to see if they contain required types or do not contain excluded types, etc.