Timeline for How to structure a complex inventory system in Unity?
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 22, 2024 at 18:30 | comment | added | Gerry Schmitz | It's an iterative process. That fact you're thinking of these things is progress. Sometimes, turn the thing around: instead of "Add Item", "object.AddMeToWhatever". Extend the object to localize available behaviour. (obj.RememberSlot; obj.FindSlot) | |
| Jul 19, 2024 at 1:46 | comment | added | Kevin | Why would the item need to keep track of the inventory slot? It sounds like something is wrong with the structure of your code there. The inventory slot should keep track of the item, but the item shouldn't know or care what inventory slot it's in. | |
| Jul 18, 2024 at 19:11 | answer | added | Vladimir | timeline score: 0 | |
| Jul 18, 2024 at 12:08 | comment | added | Engineer |
So you ideally want to set the whole thing up as one InventoryManager gateway class, through which all inventory transactions are made. Start by planning it out the way you'd like it to be, and post that pseudocode here, then we can tell you if it's possible in Unity, and/or whether it makes sense. Otherwise we are just taking shots in the dark.
|
|
| Jul 18, 2024 at 11:22 | history | edited | DMGregory♦ |
edited tags
|
|
| Jul 18, 2024 at 10:34 | history | asked | Pascal Claes | CC BY-SA 4.0 |