Can I use Immediate Mode in ECS System?
I would like to use IM in a system like the following:
public partial class SomeSystem : SystemBase
{
protected override void OnCreate()
{
base.OnCreate();
}
protected override void OnUpdate()
{
Entities.WithAll().ForEach((in DrawingData someData) =>
{
Draw.Line();
}).WithoutBurst().Run();
}}
Would it be possible to access IM from within such an Entites ForEach loop?
It does work as simple as that!:
{protected override void OnUpdate()
using (Draw.Command(Camera.main))
{
Entities.WithAll().ForEach((in DrawingData someData) =>
{
Draw.Line();
}).WithoutBurst().Run();
}
}}