dojoengine / dojo.unity

Seamless integrate onchain game logic and state into your Unity game
https://book.dojoengine.org/client/sdk/unity
MIT License
27 stars 15 forks source link

WorldManager Configuration Improvement #21

Closed cristianFleita closed 9 months ago

cristianFleita commented 9 months ago

WorldManager Configuration Improvement

Issue

The worldManager prefab currently embeds configuration data directly. This makes it less flexible and readable, limiting the ability to switch configurations easily.

Solution

Introduced a Scriptable Object ('WorldManagerData') to store configuration data for the worldManager. This enhances flexibility and readability by allowing the creation of different Scriptable Objects for diverse scenarios. For instance, it's now possible to create separate ScriptableObjects for offline and online configurations, making deployment configurations more versatile.

image

Scriptable object fields

The ScriptableObject WorldManagerData mirrors all the fields present in the worldManager prefab.

image

Creating an instance of the ScriptableObject is straightforward:

  1. Navigate to Create in the Unity Editor.
  2. Select ScriptableObjects.
  3. Choose WorldManagerData from the options.

image