ElmarJ / GeoJsonCityBuilder

Unity Package to recreate a 3D-city from a specially crafted geojson file.
MIT License
22 stars 2 forks source link

Persist GeoJSON properties into Unity objects #17

Closed ElmarJ closed 2 years ago

ElmarJ commented 2 years ago

Make all data that is present in GeoJSON-properties, available from the Unity component in editor and at runtime.

ElmarJ commented 2 years ago

This could be achieved by simply storing the string-contents of the complete properties field as a text field, and using JsonUtility.FromJson(json); to load as an object. Most elegant design would be to create a Generic version of the component, allowing you to provide a custom data-class to feed to properties into. Not sure how well unity works with generic classes though... A generic function to load the data might also be enough. See https://docs.unity3d.com/Manual/JSONSerialization.html and https://geojson.org/

ElmarJ commented 2 years ago

Depends on new geojson-parser https://github.com/ElmarJ/GeoJsonCityBuilder/issues/5