Overriding the sprites in a Animation clip

by Uri Popov   Last Updated October 10, 2019 19:13 PM

Right now we are in the process of adding seasonal content to our game. I would like to know of a way to override animation clips. Specifically I want to change the sprites being show at each key-frame. Looking from the text of a animation clip I found the following :

 m_PPtrCurves:
  - curve:
    - time: 0
      value: {fileID: 21300000, guid: 1fa82f3b0bb4e1f49ab9a9ffd4e891b1, type: 3}
    - time: 0.6
      value: {fileID: 21300000, guid: ae9111d826eb24442b21523b30b748bd, type: 3}
    - time: 0.6666667
      value: {fileID: 21300000, guid: 88840e4f59c4a6040922d9b6eed3dec3, type: 3}
    - time: 1.2333333
      value: {fileID: 21300000, guid: 88840e4f59c4a6040922d9b6eed3dec3, type: 3}
    - time: 2.0001667
      value: {fileID: 21300000, guid: ae9111d826eb24442b21523b30b748bd, type: 3}
    - time: 2.05
      value: {fileID: 21300000, guid: 1fa82f3b0bb4e1f49ab9a9ffd4e891b1, type: 3}
    - time: 3.1166666
      value: {fileID: 21300000, guid: 502fc97a961e4424ea008c0e546c83ef, type: 3}
    - time: 3.45
      value: {fileID: 21300000, guid: 1fa82f3b0bb4e1f49ab9a9ffd4e891b1, type: 3}
    attribute: m_Sprite 

This corresponds to the key frames and amount of sprites in the animation clip but I have no idea from where to get the data for the new sprites. I'm guessing the guid is a hashed path to the png files. can someone explain where to find this data so I can write myself a neat little parser to do the job?

Tags : unity animation


Answers 1


https://forum.unity.com/threads/animationclip-problems.218106/#post-1669347

this helpt me a little

you cant get serialized Propertys and use the FindPropertyRelative function to find the data that you want to modify. Like m_PPtrCurves and in there attribute and curve.

InsertArrayElementAtIndex combined with ApplyModifiedProperties can make new array elements

Janek
Janek
October 10, 2019 19:07 PM

Related Questions


Updated April 15, 2019 06:13 AM

Updated February 16, 2018 23:13 PM

Updated March 17, 2016 08:05 AM

Updated August 27, 2018 17:13 PM