I define game objects in JSON format (like in the second image) and save them in to object prefabs folder, editor automatically detects and displays them, and I can then spawn them anywhere on the scene.
At runtime, the prefab file is loaded and the actual entity is constructed with all the required components (ECS).
JSON file is only used in development. For distribution, I am planning to add a Gradle task to convert prefabs from JSON format to binary object format using Java built-in serialization so players canโt mess up with them easily!
0 comments