All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Add central management hub for inventory assets
- Add item gallery with quick multi item operations
- Add quick lookup / search of items from the editor window
- Add dependencies to my UI Toolkit lib for faster Editor edition
Complete revamp of the Inventory System.
-
Separation of Configuration and Runtime Data:
- Introduced
RuntimeInventory
class, which handles all runtime inventory operations separately from the configuration data (InventorySO
). InventorySO
now serves purely as a configuration object, defining the structure and properties of an inventory without holding runtime data.RuntimeInventory
manages the actual inventory state during gameplay, including items, slots, and runtime behaviors.
- Introduced
-
Flexible Save/Load System:
- Updated the save/load system to work with
RuntimeInventory
, ensuring that only runtime data is serialized and deserialized. - Introduced
InventorySaveSystemSO
class, allowing developers to implement custom save/load mechanisms or use the provided default JSON save system. - Implemented
DefaultInventorySaveSystem
, which saves runtime inventory data as JSON files in theApplication.persistentDataPath
.
- Updated the save/load system to work with
-
Dynamic Slot Management:
- Added methods to
RuntimeInventory
for dynamic slot management, allowing slots to be added, removed, or unlocked during gameplay.
- Added methods to
-
Item Slot Enhancements:
- Implemented item stacking within
InventorySlot
, providing flexible item management.
- Implemented item stacking within
-
Event-Driven Architecture:
- Integrated event-driven behaviors into
RuntimeInventory
, triggering custom actions likeUse
,Equip
, andDrop
via events inItemSO
.
- Integrated event-driven behaviors into
-
Runtime Viewing Tools:
- Added a runtime inventory analyzer window that can be displayed when the game is running with the click of a button on the inspector of the InventoryManager
-
Weight System as an Optional Extension:
- Added a
Weight
property toItemSO
and aUseWeight
toggle toInventorySO
to manage inventory weight limits. - Implemented the
OnWeightLimitReached
event to notify when the inventory’s weight limit is exceeded.
- Added a
-
Size System as an Optional Extension:
- Introduced a slot limit system using
SlotUnlockStateSO
to progressively unlock slots during gameplay. - The first
SlotUnlockStateSO
defines the initial number of unlocked slots, replacing the previous_baseSlots
approach.
- Introduced a slot limit system using
-
Use Same Items in Multiple Slots Optional Extension:
- If toggled, this system will allow the same item to live in multiple slots, making it possible to have multiple stacks of the same item if it reaches its max stack size.
-
Refactored Inventory Management:
- Updated
InventoryManager
to manageRuntimeInventory
instead of directly interacting withInventorySO
, improving clarity and extending functionality. UIInventoryTab
and related UI classes now interact withRuntimeInventory
to dynamically update UI based on runtime data.
- Updated
-
Enhanced Item and Tab Customization:
- Replaced
ItemActionType
andItemTabType
enums withItemActionTypeSO
andInventoryTabConfig
ScriptableObjects, providing greater flexibility and extensibility for item actions and inventory tabs.
- Replaced
-
Refactored Access Modifiers:
- Updated private properties across the package to be protected, facilitating easier extensions and modifications by developers.
- Event Handling Improvements:
- Ensured that events such as
OnAdd
,OnRemove
, etc., inRuntimeInventory
are triggered consistently and reliably.
- Ensured that events such as
- Old ItemStack System:
- Deprecated the old
ItemStack
class in favor of the newInventorySlot
system, which offers improved modularity and easier management of items within inventories.
- Deprecated the old
- Legacy ItemStack System:
- Removed reliance on the
ItemStack
class and related methods, streamlining the inventory system. - Eliminated the need for enums (
ItemActionType
,ItemTabType
), ensuring that new item actions and tabs can be added via ScriptableObjects without modifying core code.
- Removed reliance on the
- Updated README:
- Expanded the README file to include detailed instructions on setting up and using the inventory system, with sections covering item creation, slot management, script communication, and saving/loading.
- Added Mermaid diagrams to the README to illustrate class communication and relationships within the system.
- Modified
InventoryManager
to acceptvirtual
methods, making it easier to extend.
- Moved package to a Unity project for faster iterations.
- Fixed missing meta file error.
- Fixed samples not being available on installation.