Skip to content
View in the app

A better way to browse. Learn more.

moosecatSoft

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(Item) Managers - A Source of Pain in Life and in Code

Featured Replies

  The next journey that I'm working on at this moment is the inventory system. I believe I've worked out everything that we'll need going forward. The first thing is that I'll be using a system not unlike Ragnarok Online to track the different items. We will have two kinds of enums to relate to every item. The first is their SuperType, thing of this like food, crafting goods, equipment, etc. This is used for filtering and not much else. The second, and much more important, is the SubType. This is the precise item that we are tracking. An Apple, Rose, Leather Jacket, etc.

  Unity has an annoying quirk where it will not serialize a dictionary. But we really want to use a dictionary for the item tracking. This is because we can use that SubType as the "key" to look up our data, and the item's information will be the "value" from our dictionary. So what I've done is created a system that synchronizes a dictionary and a list. The list is used in editor only for visualizing the contents of the player's inventory while I work and the dictionary is used at runtime and in builds.

  With this now achieved we have our dictionary of our items. So each item is a Datum, and the dictionary object is our Database. Finally I have created some ScriptableObjects (which I call Artifacts) to store this data in a nearly tangible way. By that I mean I can trivially take this object and attach it to other objects in the project. In this way our inventory can have a pointer to the same information without needing to double the amount of data present.

  Now that we've created our asset, the asset collection, and the linking system, the next thing I will need to accomplish is actually incrementing your values. We will be doing this with a demonstration cube. Tomorrow I will be hooking that up and maybe we'll have a simple gif or two to show off the work happening.

  That update will also cover a bit of the concept of "pooling" in my projects.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.