com.unity.cinemachine icon indicating copy to clipboard operation
com.unity.cinemachine copied to clipboard

`SaveDuringPlay` script does not work outside of the package

Open AugustDG opened this issue 3 years ago • 3 comments

The SaveDuringPlay script documentation notes that we can

To use this class, drop this script into your project, and add the [SaveDuringPlay] attribute to your class.

However, the class does not inherit from Attribute so it cannot be added as an attribute.

AugustDG avatar May 25 '22 16:05 AugustDG

I am facing the same issue, have you been able to find a fix?

omangbaheti avatar Jan 31 '23 07:01 omangbaheti

If you have Cinemachine already in your project, then you don't need to do anything, you can just add the [SaveDuringPlay] attribute directly to your class. You'll need to specify using Cinemachine at the top, but that's all it takes.

glabute avatar Jan 31 '23 10:01 glabute

Hey so i tried a bunch of things. SaveDuringPlay only works for public variables. I was trying to make it work for SerializeField private variables

omangbaheti avatar Jan 31 '23 19:01 omangbaheti