• Unity
  • About serialization

Related Discussions
...

What's PPRO?

Sorry, this was a serial question for all my assets.... PPRO is Platformer PRO.
I did mean spine-unity :$

I'm not sure what you would serialize about it. Animation names are just strings, I guess?
You'd still need to do the minimum amount of work to use information from easy save on the skeletons.

I think i'd use the whole gamebject serialization, so if the spine informations are not custom types there sould not be any trouble.

The serializable fields on SkeletonAnimation would be:

SkeletonDataAsset skeletonDataAsset;
string initialSkinName;
string animationName;
bool loop;
float timeScale;
bool initialFlipX, initialFlipY;

// all the flags and settings under "Advanced..."
// ...

What wouldn't be serialized are everything in the internal Skeleton and AnimationState since they live in the pure C# side (they aren't serializble UnityEngine.Objects)

Meaning the specific active animations at the their specific playback time, and the skeleton's specific pose, wouldn't be serialized.
It's not to say they can't be serialized since those can be stored as a crapton of floats and strings.
It's just that whole-GameObject serialization, I assume, wouldn't pick them up.

I can workaround it, i believe it's not strictly necessary in my case to save the exact animation state.
What does SkeletonDataAsset contain? Is it about the internal datas you mentioned?

SkeletonDataAsset just holds references to the atlas and the json text, and stores mix durations.
All stateless data.

Today I tried the serialilzation asset on my character, but I get this error:

UnassignedReferenceException: The variable controller of SkeletonDataAsset has not been assigned.
You probably need to assign the controller variable of the SkeletonDataAsset script in the inspector.

even if you can see on the right in the inspector that SkeletonDataAsset is assigned actually.
Any idea?

What's throwing that exception?
It being null shouldn't be a problem since that's an optional field. Nothing in SkeletonAnimation uses it.

TheEasy Save guy replied this,when I asked the same

The error shows that the controller variable of the SkeletonDataAsset is not assigned, but I don’t see anywhere in your screenshot where this variable is assigned in the inspector.

The error is actually thrown by Unity when we try to access the variable, rather than by Easy Save, so if Unity say it’s not assigned then it’s definitely not assigned.

Ok. But it doesn't need to be assigned. Can't it just be saved as null without throwing errors?

Spine-Unity doesn't require it to be not null.

Separately, are you passing the SkeletonDataAsset itself through EasySave? It's already a stateless serialized asset. There's no need to save it.