Its purpose is to store the data, not to hold temporary variables. This asset can be read and modified in the game from the code level, although it’s not recommended to modify the ScriptableObject on the runtime from the code level. ScriptableObjects System allows you to store data in Unity Engine as an asset in the folder. There are 4 main scripts in the project we are going to use, and they are explained in the further sections. Warning : When serializing to json, take care over what fields you put in the data scriptable object class. The data objects are indexed and can be easily exported to json from scriptable objects. This is a great way to hold data as it’s simple and robust, especially with multiplayer games. I personally have been using it in systems like holding items or skills data for my RPG game. This solution can be used for many different cases. All items are stored in the collection and are easily accessible through a user-defined key. The other important aspect of this solution is the way in which we interact with the data later on. The best part of this solution is – it does not require additional plugins. This is also an automated way for developers to work with designers, thanks to the runtime data reading process along with looping through a resources folder. There are a lot of ways of dealing with this problem, but the way we want to tackle this today is the most friendly from a Unity design perspective. There is a high probability that you wanted to create a database and make it editable with ease for either a developer or a designer. Oftentimes, we ask ourselves the question, how do we want to store data in Unity?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |