Useful Modules
ItemDragManager
This module is used to drag items around.
ItemDragManager.PlayDeleteAnimation(InventoryItem _source, Vector3 _pos, int _overrideNum = 0)
Plays the delete animation for an item icon, causing the icon to fall to the bottom of the screen.
ItemDragManager.StartDragging(ItemIcon _source, RectTransform _rect, int _overrideNum = 0)
Starts dragging an item. After the drag-and-drop action, the _source will be called by EndDrag().
CraftingProgress
This module is used to monitor if an InventoryData is executing a crafting job and to display a progress bar showing the crafting progress. To use the module, simply drag the Prefabs/Ui/CraftingProgress.prefab to your UI canvas and assign the InventoryData component of your NPC or crafting table to the Holder slot in the CraftingProgress component.
HoverInformation:
This module shows detailed information about an item.
HoverInformation.SetCompareHolder(InventoryData _holder)
Sets an InventoryData so that the hovering item's attributes can be compared with the equipment of this InventoryData.
HoverInformation.ShowHoverInfo(ItemIcon_source,Item_item, int _num, RectTransform _anchor, float _priceMultiplier)
Shows detailed information for the provided item icon. The information panel will align with the _anchor RectTransform.
HintManager:
This module displays short hint text in a small floating window, useful when the mouse hovers over buttons or icons. To use this module, simply add the HintText component to any UI element and fill in the hint text.
DynamicMsg:
This module displays popup messages and large flashy icons of items when players acquire new items.
DynamicMsg.PopMsg(string _text)
Displays a message with the provided text.
DynamicMsg.PopItem(Item _item, int _number = 1)
Shows a flashy big icon of an item.
NumberInput:
This module prompts the player to input numbers. For example, when a player tries to split an item stack, this module can be used to ask how many items they want to split.
NumberInput.GetNumber(int _startValue, int _maxiumValue, RectTransform _rect, NumberCallback _callback)
Displays a panel prompting the player to input a number. After the player confirms, the _callback is called with the resulting number.
StatsUi:
This module displays the total attributes of an Entity. Attach this script to a UI panel, assign the necessary UI elements, and call:
public void Init(string _entityUID);
to display the stats.
You can find an example prefab in: SoftKitty/InventoryEngine/Prefabs/Ui/PlayerStats.prefab
Example code:
GetComponent<StatsUi>().Init("player");