Wondering if someone could please help me out. Basically I want to create BlobAssetReference from different GO using IConvertGameObjectToEntity and then add them all to a single entity in a GameObjectConversionSystem.
How do i create a BlobAssetReference safely outside using{}, access it in a GameObjectConversionSystem and dispose.
public class GameObj_A_Authoring : MonoBehaviour, IConvertGameObjectToEntity
{
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
BlobAssetReference<DataA> basDataA = BuildBlobA();
}
}
public class GameObj_B_Authoring : MonoBehaviour, IConvertGameObjectToEntity
{
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
BlobAssetReference<DataB> basDataB = BuildBlobB();
}
}
public class MyConversionSystem : GameObjectConversionSystem
{
//.. Safely create and add this to an entity
var comp = new AllBlobsComponent
{
// add BlobAssetReference<DataA>
// add BlobAssetReference<DataB>
};
}
Can any one please share a simple example to safely do this. Thank you heaps in advance
For the life of me i cant find it, Iv only downloaded the physics package for the first time today so pretty lost, I found Library/PackageCache/com.unity.physics@0.4.0-preview.5/Unity.Physics.Hybrid/Conversion but cant find the example you are referring too.
I thought you were trying to apply the same blob asset reference to multiple entities, but you want to create references on multiple entities then group them after on a single entity.
Could you just make your final conversion system run after the conversion is done and filter on the destination world?
“Could you just make your final conversion system run after the conversion is done and filter on the destination world”
not sure follow , so I just create a BlobAssetReference in each conversion, store it in the destination world on the primary entity and then in the conversion system create a new entity and add each BlobAssetReference so that I have a single entity with a component container a BlobAssetReference to each blob