There are Booleans (Tickboxes), String fields (Description for instance), Integers (HP Restore for example), Enumerables (Consume Text) and even Icons… And that’s not all it can do. ![]() ![]() For instance, in the below screenshot, you can see the general information that’s required to make an item in the game. The jist of it is fairly simple: You set what variables all ScriptableObjects of that type will have. Below is an example of data within one of the items in the game, using the power of a ScriptableObject. You can also create context menus such as the one in the screenshot above. With Unity, you can do this within the platform by using ScriptableObjects instead. You’d then need to create some way to interpret that data. You could create a list of objects within XML, perhaps have properties such as name, weight, gold value etc. A lot of developers will use formats such as XML or JSON to create a lot of objects in an easily digestable (and alterable) format. Saving time is important in development anything you can do that reduces the amount of code, or reduces the need for repetition is a blessing. But this is a quick brief discussion about the ScriptableObjects data container as well as why you’d use it. ![]() Naturally, I’ve been following guides, specifically ones from a YouTuber called Brackeys, who I would highly recommend checking out, if Unity is of interest to you. Last week I spoke briefly about implementing my inventory system, but to pull that together, I had to create some way to create items quickly. Since starting development of this little Adventure/RPG, I’ve had to take full advantage of the ScriptableObjects data container.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |