Hi all;
Im having some issues with Roslyn code generation and ECS ISystems. I have IComponentData with a specific attribute I would like to generate systems for dynamically. These systems would just watch this attributes components for change. I understand I could hardcode every single IComponentData with this behavior but we have hundreds. Everything works fine, except when SystemAPI.Query<>() is invoked I am getting the error:
InvalidOperationException: No suitable code replacement generated
I presume that the ecs gode gen pass didnt have ‘time’ to transform my generated code?
Any insight on how I can approach this differently or ensure which pass my roslyn code is generated in would be great.
Edit: I know the generated query works. I coded a test ISystem and it was fine.
Edit. I solved it by just making an editor script that watches AssetDatabase for IComponentData with the attribute and generate/remove the scripts in the editor. Would really love a runtime solution though.