Hi people! I want to know your opinion about one architectural approach for hybrid projects realization.
The idea is to create a ComponentSystemGroup of systems including one unmanaged subsystem. In the managed system we realize logic interacting with GameObject, and in the unmanaged subsystem we take out all computationally complex intermediate logic.
In abstract form, such a pair looks like this:
`partial class CharacterMovementSystem : ComponentSystemGroup
{
protected override void OnUpdate()
{
// logic that updates IComponentData by getting actual data from the GameObject
....
base.OnUpdate(); // start the child unmanaged system, calculate the displacement at the current step
// apply the calculated displacement, e.g. with the help of CharacterController.Move
....
}
}
[UpdateInGroup(typeof(CharacterMovementSystem))]
partial struct CharacterMovementSystem_Internal : ISystem
{
[Burst]
public void Update(....)
{
....
}
} `
I think this approach is universal, and it allows you to retain the maximum advantages of ECS thanks to a clear division into simple logic that uses managed data and complex logic that uses only unmanaged data (which means you can use Burst, EntityJob and other cool ECS things).
The advantages are clear, but are there any disadvantages? For example, because of regular alternation of execution of parallelized logic in subsystems and synchronous logic in ComponentSystemGroup (I mean a large number of synchronization points or something like that).