unity3d-jp / StreamingImageSequence

A package for playing sequential image sequences in Unity Timeline
Other
283 stars 39 forks source link

A scripted object has a different serialization layout when loading #410

Open broseidon91 opened 2 years ago

broseidon91 commented 2 years ago

When building for Android, I get these runtime errors

The referenced script (Unknown) on this Behaviour is missing! 01-12 15:38:38.207 16650 16788 W Unity : The referenced script on this Behaviour (Game Object '') is missing! 01-12 15:38:38.207 16650 16788 E Unity : A scripted object (probably Unity.StreamingImageSequence.StreamingImageSequencePlayableAsset?) has a different serialization layout when loading. (Read 68 bytes but expected 1168 bytes) 01-12 15:38:38.207 16650 16788 E Unity : Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts? 01-12 15:38:38.207 16650 16788 W Unity : The referenced script (Unknown) on this Behaviour is missing! 01-12 15:38:38.207 16650 16788 W Unity : The referenced script on this Behaviour (Game Object '') is missing! 01-12 15:38:38.207 16650 16788 E Unity : A scripted object (probably Unity.StreamingImageSequence.StreamingImageSequenceTrack?) has a different serialization layout when loading. (Read 64 bytes but expected 2832 bytes) 01-12 15:38:38.207 16650 16788 E Unity : Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts? 01-12 15:38:38.326 16650 16788 W Unity : The referenced script (Unity.StreamingImageSequence.StreamingImageSequenceRenderer) on this Behaviour is missing! 01-12 15:38:38.328 16650 16788 W Unity : The referenced script on this Behaviour (Game Object 'Image') is missing! 01-12 15:38:38.328 16650 16788 E Unity : A scripted object (probably Unity.StreamingImageSequence.StreamingImageSequenceRenderer?) has a different serialization layout when loading. (Read 32 bytes but expected 52 bytes) 01-12 15:38:38.328 16650 16788 E Unity : Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

I was able to reproduce this in a new project using Unity 2020.3.23f1 and SreamingImageSequence 0.14.2-preview

  1. Create a new project (2020.3.23f1)
  2. Add StreamingImageSequence package to the project (v0.14.2-preview) via git
  3. Add your PNG sequence into a new folder in the project (notably, not in streaming assets)
  4. Create a canvas object in your scene. Create a child gameobject of that canvas and add an Image component
  5. On the canvas, add a PlayableDirector component
  6. Open the Timeline window and select the Canvas. When prompted to create an asset, do so.
  7. Drag your PNG sequence folder into the timeline (or create a Streaming Image Sequence track)
  8. Drag the gameobject with the image component into the track's Streaming Image Sequence Renderer reference. It will add the component and attach the reference.
  9. Make sure your build settings indicate Android
  10. Build to device
  11. Open terminal and type adb logcat -s Unity and witness the errors
  12. the sequence will not play
sindharta commented 2 years ago

Thank you for the report.

Just to let you know though, playing non-StreamingAssets images in runtime is not supported yet.