0
\$\begingroup\$

Unity3d allows to construct window with custom UI. Just need to use EditorGUI/EditorGUILayout classes and their static methods. Example of custom window:

enter image description here

The problem is that all the components have to be added manually via script. Then need to save, switch to Editor, wait for little compile things, and then we can see the result.

In web-development people use Web Inspector (for example, we can press F12 in chrome, Tab Elements -> Styles). We can add all needed properties to element and can see the result in real-time.

enter image description here

EDIT. another example (better than previous): we know C# winFormApp, C++ MFC e.t.c, which has form designer. We can choose any elements and set their properties: enter image description here

It would be nice to have similar plugins for Unity

So. Does Unity3d have similar tools, utilities, plugins? Utilities to inspect code and editing styles (position, margin, padding, background, width, height, color e.t.c.)?

\$\endgroup\$
1
\$\begingroup\$

Well, I found something interesting...Editor window designer

The plugin is almost what I need

The project had been started but not completed yet. As the author says: he decided to release Editor Window Designer as an open source project, that code is here

For now plugin allows add elements and styling them (position, padding, width, height, e.t.c) Base demo window:

img1

And here is hierarchy window and properties of concrete element

img2

I wonder why Unity developers (or someone else) still didn't do something like that? It is very useful and necessary thing...

\$\endgroup\$
  • \$\begingroup\$ good find. Any idea how to integrate this into unity. Do I just put the source code in a Editor folder? \$\endgroup\$ – Uri Popov May 2 '16 at 18:26
  • \$\begingroup\$ @UriPopov You can just put "uAssist" folder (wich contains "EditorDesigner" and "UEditorWidgets") in the root (Asset folder). And that's all... Then in menu you can find: Window->uAssist->WindowDesigner->Create New Form/Edit Form ...... also at the bottom of the page forum.unity3d.com/threads/… you can find the package \$\endgroup\$ – Alexey Shimansky May 2 '16 at 18:51
0
\$\begingroup\$

No, since the scripts are compiled (before run) and therefore can't be manipulated at runtime. However: you could add debug fields to your scripts to change certain fields (let's say a color or so).

\$\endgroup\$
  • \$\begingroup\$ Not run-time. I wrote "real-time". It's different... I guess)) ....Well, Form designer in c# winFormApp does not compile Form every N-seconds or M-actions. It keeps state of the fields in some variables and then (when saveBtn was clicked) just adds lines to the File (Form.cs, xml and others).... And it is possible to do the same in Unity. 100% ...It can be hard, but really posssible)) Even do not need to compile anything \$\endgroup\$ – Alexey Shimansky May 2 '16 at 12:19
  • \$\begingroup\$ And my answer was meant to describe the status quo. Sure you could do a designer and generate a respective script, but this would be quite a lot of work. Regarding run-time: since you spoke about chrome inspector I thought you'd mean run-time. \$\endgroup\$ – M156 May 2 '16 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.