diff --git a/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs b/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs index 30245b7..ac61329 100644 --- a/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs +++ b/Runtime/Scripts/VA_AnimationLibraryComponentAuthoring.cs @@ -12,6 +12,9 @@ namespace TAO.VertexAnimation public class VA_AnimationLibraryConversionSystem : GameObjectConversionSystem { + // Static because of multi scene setup. + public static BlobAssetReference animLibAssetRef; + protected override void OnUpdate() { Entities.ForEach((VA_AnimationLibraryComponentAuthoring animationLib) => @@ -34,7 +37,9 @@ namespace TAO.VertexAnimation } // Construct blob asset reference. - BlobAssetReference animLibAssetRef = blobBuilder.CreateBlobAssetReference(Allocator.Persistent); + //BlobAssetReference animLibAssetRef = blobBuilder.CreateBlobAssetReference(Allocator.Persistent); + // Static because of multi scene setup. + animLibAssetRef = blobBuilder.CreateBlobAssetReference(Allocator.Persistent); // Add it to the asset store. BlobAssetStore.TryAdd(new Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), animLibAssetRef); diff --git a/Runtime/Scripts/VA_AnimatorComponentAuthoring.cs b/Runtime/Scripts/VA_AnimatorComponentAuthoring.cs index b06a596..24ce3e9 100644 --- a/Runtime/Scripts/VA_AnimatorComponentAuthoring.cs +++ b/Runtime/Scripts/VA_AnimatorComponentAuthoring.cs @@ -26,7 +26,9 @@ namespace TAO.VertexAnimation { protected override void OnUpdate() { - BlobAssetStore.TryGet(new Unity.Entities.Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), out BlobAssetReference animLib); + //BlobAssetStore.TryGet(new Unity.Entities.Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), out BlobAssetReference animLib); + // Static because of multi scene setup. + BlobAssetReference animLib = VA_AnimationLibraryConversionSystem.animLibAssetRef; Entities.ForEach((VA_AnimatorComponentAuthoring animator) => {