When creating a blob asset, the created blob asset gets arbitrary values, despite there not being any noticable difference to the example in The Manual
The following code:
private void ConvertScriptableObjectsIntoBlobAssetReferences()
{
if (_tweaks.IsCreated)
{
_tweaks.Dispose();
}
var blobBuilder = new BlobBuilder(Allocator.Temp);
ref var blobAsset = ref blobBuilder.ConstructRoot<EsoTweaks.BlobAsset>();
blobAsset.ZoneSizePerDevelopmentPoint = _esoTweaks.ZoneSizePerDevelopmentPoint;
blobAsset.FreeMoonCoralBuildings = _esoTweaks.FreeMoonCoralBuildings;
blobAsset.FreeBuildingMaterialBuildings = _esoTweaks.FreeBuildingMaterialBuildings;
_tweaks = blobBuilder.CreateBlobAssetReference<EsoTweaks.BlobAsset>(Allocator.Persistent);
Debug.LogError($"{_tweaks.Value.ZoneSizePerDevelopmentPoint} {_esoTweaks.ZoneSizePerDevelopmentPoint}");
Debug.LogError($"{_tweaks.Value.FreeMoonCoralBuildings} {_esoTweaks.FreeMoonCoralBuildings}");
Debug.LogError($"{_tweaks.Value.FreeBuildingMaterialBuildings} {_esoTweaks.FreeBuildingMaterialBuildings}");
_esoTweaks = null;
blobBuilder.Dispose();
}
Has the following output:
1106247680 20
1127481344 3
0 1
The numbers are consistent each time I run the code. I tried it for another blob builder too that runs right before it, and that outputs:
30 30
180 30
I tried both using Persistent and Domain for the blob asset, and reusing and not reusing the blob builder for both assets, but it has the same output every time. It runs in [UpdateInGroup(typeof(InitializationSystemGroup))]