the following code:
static async Task<(Entity, Entity, Entity, Entity, Entity)> LoadAssetAndCreatePrefabs(World customWorld)
{
var customWorldUnmanaged = customWorld.Unmanaged;
var sceneGuid = new Hash128("52b77c03e0aae864286b8f57b3216c18");
var sceneEntity = SceneSystem.LoadSceneAsync(customWorldUnmanaged, new EntitySceneReference(sceneGuid, 0));
while (SceneSystem.IsSceneLoaded(customWorldUnmanaged, sceneEntity) == false)
{
customWorld.Update();
await Task.Yield();
}
EntityManager worldEntityManager = customWorld.EntityManager;
var query = worldEntityManager.CreateEntityQuery(typeof(PrefabsComponent));
var prefabHolder = query.ToComponentDataArray<PrefabsComponent>(Allocator.Temp);
var component = prefabHolder[0];
return (component.RedFood, component.BlueFood, component.RedDoofus, component.BlueDoofus, component.SpecialDoofus);
}
in conjunction with:
UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP_RUNTIME_WORLD
works fine in editor and in a mono client. However in an IL2CPP I get this error:
ArgumentException: Cannot find TypeIndex for type hash 7881543491081840453. Check in the debug file ExportedTypes.log of your project Logs folder (<projectName>/Logs) the corresponding Component type name for the type hash 7881543491081840453. And ensure your runtime depends on all assemblies defining the Component types your data uses.
at Unity.Entities.Serialization.SerializeUtility.ReadTypeArray (Unity.Entities.Serialization.BinaryReader reader, Unity.Entities.Serialization.DotsSerializationReader dotsReader) [0x000c2] in .\Library\PackageCache\com.unity.entities@1.0.0-pre.15\Unity.Entities\Serialization\SerializeUtility.cs:520
at Unity.Entities.Serialization.SerializeUtility.EndDeserializeWorld (Unity.Entities.ExclusiveEntityTransaction manager, Unity.Entities.Serialization.DotsSerializationReader dotsReader, Unity.Entities.Serialization.SerializeUtility+WorldDeserializationStatus& status, Unity.Entities.Serialization.SerializeUtility+WorldDeserializationResult& deserializationResult, System.Object[] unityObjects) [0x000bd] in .\Library\PackageCache\com.unity.entities@1.0.0-pre.15\Unity.Entities\Serialization\SerializeUtility.cs:861
at Unity.Scenes.AsyncLoadSceneOperation+AsyncLoadSceneJob.Execute () [0x000d9] in .\Library\PackageCache\com.unity.entities@1.0.0-pre.15\Unity.Scenes\AsyncLoadSceneOperation.cs:160
at Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x00008] in C:\build\output\unity\unity\Runtime\Jobs\Managed\IJob.cs:58
is it expected? do you have a fix? Or should I report a bug instead?