Why does ImmediateModeCanvas not call DrawPanels? (Request to be able to use ImmediateModeCanvas component directly)
I was wondering why a functional IMCanvas setup requires a custom component derived from ImmediateModeCanvas (like in the example scene). It seems all it does is draw some stuff (which could have been done with an ImmediateModePanel derived component too), and call DrawPanels.
Calling DrawPanels is the critical part so why doesn't ImmediateModeCanvas call that inside it's own virtual DrawCanvasShapes method, so ImmediateModeCanvas could be used directly without having to create a derived component?
Well, I did try to make this change myself (make ImmediateModeCanvas.DrawCanvasShapes call DrawPanels and then use the ImmediateModeCanvas component directly instead of the IMCanvasSample component). But for some reason it doesn't work.
Calling DrawPanels is the critical part so why doesn't ImmediateModeCanvas call that inside it's own virtual DrawCanvasShapes method, so ImmediateModeCanvas could be used directly without having to create a derived component?
Well, I did try to make this change myself (make ImmediateModeCanvas.DrawCanvasShapes call DrawPanels and then use the ImmediateModeCanvas component directly instead of the IMCanvasSample component). But for some reason it doesn't work.
With this change I can make the IMCanvasSample class be an empty class deriving from ImmediateModeCanvas:
public class IMCanvasSample : ImmediateModeCanvas { }And that somehow works even though using the base class directly doesn't. I can't figure out why. But either way, it would be nice if ImmediateModeCanvas could just be used directly.
Reporting a bug? please specify Unity version:
2022.3.62
Reporting a bug? please specify Shapes version:
4.5.1
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline