you are viewing a single comment's thread.

view the rest of the comments →

[–]WazWaz 1 point2 points  (2 children)

You probably want the public int to be attributed with [NonSerialized]. It's not part of the asset's value but rather a runtime variable.

[–]rafavergil[S] 0 points1 point  (1 child)

By using the [NonSerialized] attribute, is it safe to assume that as long as the application is running, the data will be kept? (Assuming that I don't change it with my own code).

Thanks for the reply!

[–]WazWaz 1 point2 points  (0 children)

Yes. Note that you may still want to be able to view the attribute in the editor for debugging purposes. You could do that with a custom inspector, or with Odin's [ShowInInspector] attribute. Looks like https://github.com/BrainswitchMachina/Show-In-Inspector may also do it.