Problem is not reproducible or outdated
Animation doesn't pickup what script changed to another object
I've got script that helps me to hide and reveal sprites on a character, that is attached to a Bone2D object (I'm using skeletal animation and in some cases I want to change how limb looks) but whatever script does, animation record mode doesn't pick up. How should I enforce that change check on each of the affected objects?
The script [ExecuteInEditMode] have list of states (each has sprites and other object references, to show or set transform properties). Whenever I check bool setState on one of those states, it just runs through last selected one and in Update() hides all relative objects of last state, and reveals all of current one.
Seems like this community isn't going to help me.
But solution was so simple. I should make these changes reproducible in animation. Like have some serializable values on this script that will be picked up by animation keys and apply changes whenever animation will change them.
Too bad that full properties are not supported anyway. Would be so easy to mark backing variable and property for serialization (so that serialization engine knew, that to set initial values it can do through backing variables and to apply changes it should use the property itself). But we will need to do that through Update() and code will not run instantly and we need to deal with it.