Drawing blocks using editor scripting

Hi!

I started learning editor scripting in Unity. It is very easy to create buttons, labels, sliders, etc.

But I am trying to find what library or tools to use to create a editor Window that would contain draggable elements like blocks that snap together.

A great example of a editor asset using that type of editor scripting is Blox3: Blox Visual Scripting | Visual Scripting | Unity Asset Store

Any idea where to start to have a canvas in an editor window that would let me place visually customizable draggable elements like this?

Thank you!

I don’t know that asset you’ve linked, but it looks like it’s just some custom styles. So each “block” is simply a GUIStyle with a specific texture. You just have to define the border to specify which parts of the texture should stretch and which should keep the size. The IMGUI uses a 9-slice to draw any GUIStyle background texture.

However apart from that you can do simple low level drawing by using the GL class. If you plan to draw a lot (thousands of elements) you better create a Mesh for all your elements and draw that. Your question is to unspecific to go into more detail since we don’t know what you want to do. Anyways here’s my IMGUI crash course for reference.