mirror of
				https://github.com/maxartz15/VertexAnimation.git
				synced 2025-11-04 02:15:59 +01:00 
			
		
		
		
	Static Store
Static store for multi scene setup.
This commit is contained in:
		@@ -12,6 +12,9 @@ namespace TAO.VertexAnimation
 | 
			
		||||
	
 | 
			
		||||
	public class VA_AnimationLibraryConversionSystem : GameObjectConversionSystem
 | 
			
		||||
	{
 | 
			
		||||
		// Static because of multi scene setup.
 | 
			
		||||
		public static BlobAssetReference<VA_AnimationLibraryData> animLibAssetRef;
 | 
			
		||||
 | 
			
		||||
		protected override void OnUpdate()
 | 
			
		||||
		{
 | 
			
		||||
			Entities.ForEach((VA_AnimationLibraryComponentAuthoring animationLib) =>
 | 
			
		||||
@@ -34,7 +37,9 @@ namespace TAO.VertexAnimation
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					// Construct blob asset reference.
 | 
			
		||||
					BlobAssetReference<VA_AnimationLibraryData> animLibAssetRef = blobBuilder.CreateBlobAssetReference<VA_AnimationLibraryData>(Allocator.Persistent);
 | 
			
		||||
					//BlobAssetReference<VA_AnimationLibraryData> animLibAssetRef = blobBuilder.CreateBlobAssetReference<VA_AnimationLibraryData>(Allocator.Persistent);
 | 
			
		||||
					// Static because of multi scene setup.
 | 
			
		||||
					animLibAssetRef = blobBuilder.CreateBlobAssetReference<VA_AnimationLibraryData>(Allocator.Persistent);
 | 
			
		||||
 | 
			
		||||
					// Add it to the asset store.
 | 
			
		||||
					BlobAssetStore.TryAdd(new Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), animLibAssetRef);
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,9 @@ namespace TAO.VertexAnimation
 | 
			
		||||
	{
 | 
			
		||||
		protected override void OnUpdate()
 | 
			
		||||
		{
 | 
			
		||||
			BlobAssetStore.TryGet(new Unity.Entities.Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), out BlobAssetReference<VA_AnimationLibraryData> animLib);
 | 
			
		||||
			//BlobAssetStore.TryGet(new Unity.Entities.Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), out BlobAssetReference<VA_AnimationLibraryData> animLib);
 | 
			
		||||
			// Static because of multi scene setup.
 | 
			
		||||
			BlobAssetReference<VA_AnimationLibraryData> animLib = VA_AnimationLibraryConversionSystem.animLibAssetRef;
 | 
			
		||||
 | 
			
		||||
			Entities.ForEach((VA_AnimatorComponentAuthoring animator) =>
 | 
			
		||||
			{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user