我在使用 Unity ECS 时遇到问题。我的系统没有通过查询找到我的实体。这是我的设置:我目前只使用一个由预制件创建的实体进行测试,使用以下功能:
Entity CreateEntity => GameObjectConversionUtility.ConvertGameObjectHierarchy(_parameters.carPrefab, _conversionSettings);
和
_assetStore = new BlobAssetStore();
_conversionSettings = GameObjectConversionSettings.FromWorld(World.DefaultGameObjectInjectionWorld, _assetStore);
我的系统使用这个查询:
Entities.ForEach((DynamicBuffer<EdgeBufferElement> pathBuffer, ref Translation position,
ref Rotation rotation, ref CarComponentData car) => {
//logic
}).Schedule(inputDeps);
但是我的系统逻辑没有得到执行。这可能是因为系统显示它找不到实体:
我还尝试将查询更改为仅引用翻译,但这会导致相同的结果。你知道这里出了什么问题吗?
我在这里先向您的帮助表示感谢 !