Unity's SerializeField for Flax, is there one?

I know, unity uses [SerializedField] to show up private variables in editor inspector. Something like this:

[SerializeField]
float speed = 1.0f;

Is there anything like this in Flax game engine? (Very similar declaration I found is [Serialize]. But it won’t show up the variable in flax editor)
I need things like this for securing my game from hacking related attacks. If there’s one like that, Please reply :pray: :pray: :pray:

Yes, you need to also include the ShowInEditor attribute, like this:

[Serialize, ShowInEditor]
float speed = 1.0f;

A variable will also appear in the Properties window if it’s declared public. You can hide it using HideInEditor.

2 Likes

Uh, I have just found out it here - Attributes | Flax Documentation
By the way, thanks for your reply Spectrix!!!
I found Flax is very similar to Unity + Easier…!

1 Like

There are also docs about scripts data serialization rules: Scripts serialization | Flax Documentation

1 Like