Sometimes there is still a need to work with managed data types, let’s say I would like to use “new” Unity input system in my ECS-based project. To accomplish that, I have basically two options as far as I know:
-
Using SystemBase system, exactly like in this example script: EntityComponentSystemSamples/PhysicsSamples/Assets/Common/Scripts/DemoInputGatheringSystem.cs at master · Unity-Technologies/EntityComponentSystemSamples · GitHub
-
Using standard MonoBehaviour class, then passing gathered values to ECS components, demonstrated in this video: https://www.youtube.com/watch?v=sgWyFaSMC3c
My question is what do you consider as a more correct approach in the terms of better performance and general project design/scalability? Can you also list some dis/advantages of both approaches?
Thanks in advance for your opinions!
PS: I used input usage just as an example to illustrate this problematic, but this question relates to many other areas - for example now I am in need to use Camera.main.ScreenPointToRay() method which is not available in pure ECS, so I am dealing with exact same problem.