Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Item representation in Unity

$
0
0
Hi all, I´m currently working on a little 2D "explorer game" in Unity and do have some problems with the item database. First I created a simple XML Database in which I stored things like ItemValue, ItemDescription.....and also the Path to the specific prefab. Because I wanted to manage my Database only in one place, I started to build a Custom Editor and used Scriptable Objects to represent my desired Item Hierarchy. At this point I learned a lot about Unity´s crappy serialization system and how you have to do "big" workarounds to save your Database without any restriction like "No support for custom null classes, no support for polymorphism....) . I started to realize that I have to setup my own little "system" to get the job done but I can´t get my head around the whole thing. 1) Lets say I have the raw data representation of my Items (ItemID, ItemDescription, ItemValue e.g) saved in a .json or .yaml file, how do I map the "raw data" to the visual part of the item (in game)? Should I create the Items dynamically (e.g create some factorys for diffrent item types and build them in code)? Should I rewrite my "custom editor" to create acutal prefabs and save the path to my desired item like I did in the XML thing? Is there an best practice for this kind of problem in Unity? Kind regards,

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>