Hello,
I have a script that goes through a GameObject’s hierarchy, catches its transformation and those from its children during a certain amount of frames, and creates an AnimationClip. This clip is then added to an Animation Component of the GameObject.
When the Editor is in Play mode, I can see that my clip is correctly created and that all my AnimationCurves are filled with keys. But when I stop the Editor, there is no more tracks of the clip and the Animation Component is empty.
I tried different things, without success :
-set my class as [Serializable]
-create a public attribute of type Animation and flag it with [SerializedField]
-add an Animation Component manually before running my script
I googled and looked into the forums, and it appears that there are some plugins that allow for serialization but they do to much things for me. Basically, I just want to do something like MyGameObject.Serialize or MyGameObject.SerializeComponents, so that after running my script, I get my Animation and its clip for the next run.
Thanks for your help.