spatialos / gdk-for-unity

SpatialOS GDK for Unity
https://gdk.improbable.io/spatialos-gdk-unity
MIT License
355 stars 77 forks source link

BlittableBool is not Serializable #935

Closed david-rzepa closed 5 years ago

david-rzepa commented 5 years ago

We are accepting issues and we want your feedback.


Description

BlittableBool is not serializable. This means I cannot serialize any generated code data in a prefab for ease of configuring templates using the editor.

Expected behaviour

Doing something like

[SerializeField]
BlittableBool Foo;

Should appear in the editor and be editable.

Current behaviour

The field does not appear in the editor.

Possible solution

Adding [Serializable] attribute and making the value field public and non-readonly allows the type to be serialized.

Steps to reproduce

public class CouplingPointsSnapshot : MonoBehaviour {
        [SerializeField]
        private BlittableBool Foo;
    }

Or any type that uses BlittableBool

Environment

Generically serialize component snapshots in MonoBehaviours so I can use prefabs as entity templates.

n/a

GDK v0.2.1, Unity 2018.3.11f1

jessicafalk commented 5 years ago

Thanks for raising this issue! We are tracking it internally as UTY-2024

jamiebrynes7 commented 5 years ago

As it turns out, the Entities preview.33 upgrade in #963 means that bool is now blittable and the there is no longer a requirement for BlittableBool.

We are removing it in #965 and all code generated schema types will use the standard bool type!

jamiebrynes7 commented 5 years ago

v0.2.3 has been released which contains the change mentioned above!

https://github.com/spatialos/gdk-for-unity/releases/tag/0.2.3