Please enable JavaScript.
Coggle requires JavaScript to display documents.
Survive Inventory, Canvas, Inventory, Item Prefab, Inventory Display -…
Survive Inventory
Consumables
Restorative
Health
Energy
Medical
Hydration
Buffs
Damage
Health
Energy
Tools
Weapons
Knife
Spear
Bow ?
Accessories
Fishing Pool
Knife
Hatchet
Matches
Lighter
Shovel
Canvas
Main Menu
Open by default
On Play Click > Go to play mode
Play Mode
Player Inventory
Inventory
methods
add item
remove item
get item
properties
size
list<GameObject> items
also a child object
Item Prefab
Item
slug
name
description
prefab
icon
stackable
quantity
max stack
Inventory Display
Slots
SlotItem
Item Prefab
img_icon (ui)
txt_quantity (ui)
DRAG AND DROP METHODS
OnBeginDrag
capture parent incase fail to drop.
turn off raycasts
OnDrag
set position to mouse position
OnEndDrag
reset raycasts
Inventory (reference to inventory)
display
Inventory (reference to inventory) => pass to slot item
ON DROP METHOD
if dropped item item prefab <item> slug == this slot item slug
droppedItem inventory remove item
update visuals for slot item
this Inventory add item (dropped item)
droppedItem = item that was dropped (slotitem)
else send dropped item back to parent