mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-11-09 22:32:55 +01:00
Static Store
Static store for multi scene setup.
This commit is contained in:
parent
cab2c4ad12
commit
6c9a52c1a6
@ -12,6 +12,9 @@ namespace TAO.VertexAnimation
|
|||||||
|
|
||||||
public class VA_AnimationLibraryConversionSystem : GameObjectConversionSystem
|
public class VA_AnimationLibraryConversionSystem : GameObjectConversionSystem
|
||||||
{
|
{
|
||||||
|
// Static because of multi scene setup.
|
||||||
|
public static BlobAssetReference<VA_AnimationLibraryData> animLibAssetRef;
|
||||||
|
|
||||||
protected override void OnUpdate()
|
protected override void OnUpdate()
|
||||||
{
|
{
|
||||||
Entities.ForEach((VA_AnimationLibraryComponentAuthoring animationLib) =>
|
Entities.ForEach((VA_AnimationLibraryComponentAuthoring animationLib) =>
|
||||||
@ -34,7 +37,9 @@ namespace TAO.VertexAnimation
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct blob asset reference.
|
// 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.
|
// Add it to the asset store.
|
||||||
BlobAssetStore.TryAdd(new Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), animLibAssetRef);
|
BlobAssetStore.TryAdd(new Hash128(VA_AnimationLibraryUtils.AnimationLibraryAssetStoreName), animLibAssetRef);
|
||||||
|
@ -26,7 +26,9 @@ namespace TAO.VertexAnimation
|
|||||||
{
|
{
|
||||||
protected override void OnUpdate()
|
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) =>
|
Entities.ForEach((VA_AnimatorComponentAuthoring animator) =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user