Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 13, 2019 at 01:17 PM by Hatdatsat for the following reason:

Other

avatar image
0
Question by Hatdatsat · Feb 27, 2019 at 09:55 AM · uiguiunityeditordeveloper

Unity Developers why remove OnGui?

Hello all,

There is probably a better forum place to ask this question but i don't know where that would be.

As the title states I am wondering why the unity Developers saw it as a whise move to remove the old OnGui system and replace it for their as they call it: "You should use Unity’s up-to-date UI system instead"

I get that they like to change things and improve their engine and I get that they want to make it more accessible to make an UI. The idea is that you should be able to manage everything from inside the editor and don't need to use code to create an UI, and since artists are the once mostly focused on creating the UI this way they should be able to make it from the editor right?

This is true basically anyone can start making an ui right now instead of needing to be able to code to make an ui. But its restricting to use the editor ui. And trying to make the buttons from the new ui fully by code is an absolute nightmare.

 void OnGUI()
     {
         if (GUI.Button(new Rect(10, 10, 150, 100), "I am a button"))
         {
             print("You clicked the button!");
         }
     }

HOW SIMPLE CAN IT BE? ofcourse this is the easiest version of a button but still just try and do the same with creating a button with the new ui, here are a few things you have to do: create 2 gameobjects (one for the button and one for the text)

add a recttransform for both

define anchor points for the recttransform

set the size (and no not using the normal transform.position and transform.size etc. but the recttransform versions which are just weird after being used to using gameobject.transform

set the parent canvas add component image add component button

and many many more things just to create a normal button, seriously why unity developers? OnGui was so easy to use so simple so why did you have to force the new UI system on us? Why did you have to remove the OnGui system? why not just leave it running next to the UI system?


edit(moved from answer)


You might be wondering what prompted this question....

I have been working with both system on many different projects, but right now because of hardware i need to use 2019 so OnGui is no more in this version.

In the project that I'm working on everything needs to be scaled correctly with the screen on both axis does this work properly right now with the UI system? NO. Would this have been an easy fix using OnGui? YES. What does this mean for my project? I need to make every UI part with code to be able to change sizes fonts and everything else by code! So a system focused on working solely from the editor is terrible to mimic using code, its just plain awful compared to writing the same with OnGui. I have been spending a long time first setting it all up in the Hierarchy first of all its way to much to wanting to have it all in hierarchy but sure its meant to be build in the Editor so I comply. I finish it turns out I cant make it work with what I need

  • It takes up way to much resources to have it all in the Hierarchy

  • It is a nightmare to change the ui elements from code while its in the Hierachy

So right now I'm recreating the Whole ui by code and im looking at this hot mess and just wheep thinking how much more streamlined and optimized OnGui would have looked in comparison!

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hellium · Feb 27, 2019 at 10:06 AM 0
Share

I invite you to post on the forum ins$$anonymous$$d. The developpers of the Unity engine don't browse Unity Answers.

avatar image Kerihobo · Nov 08, 2020 at 11:19 AM 0
Share

Well it's Novermber 2020 and I$$anonymous$$GUI is still here. I really hope they don't remove it anytime soon as I would have to re-do all my tools from scratch, which will be a massive friggin pain.

I tried the UIElements/UIToolkit and really hate it. It has some nice bonuses but also hits a few brick-walls that need ironing out before I consider it a half-way viable tool.

avatar image Bunny83 Kerihobo · Nov 08, 2020 at 01:42 PM 1
Share

I don't think it will be removed any time soon, at least not for the editor. Keep in $$anonymous$$d that 90% of the editor UI is build with I$$anonymous$$GUI. AFAIK they are in the process of replacing the editor ui with UIElements as they both simplify complex ui setups and also provide performance optimisations from the ground up which aren't possible in a pure immediate mode gui. I'm sure when they have a viable solution for easily creating property drawers, custom editor, custom editor windows and wizards with UIElements they may start phasing out the I$$anonymous$$GUI system. Though I don't think that happens any time soon and if they plan to do it they usually have a longer transition period (usually a year+).


At the moment all official tutorials for editor coding uses I$$anonymous$$GUI all the way. For quite a long time the new UIElements were in the experimental namespace. At the moment Unity does not recommend to use UIElements in production as it's still under development.


2 Replies

  • Sort: 
avatar image
1

Answer by Bunny83 · Feb 28, 2019 at 02:05 PM

There are several things not clear here.


  • First of all the latest stable Unity version at the moment is something around 2018.3. Any 2019 release are beta releases which shouldn't be used in any production yet. If you have no idea what a beta version is good for, have a look at beta version.

  • I just installed the 2019.2.0a6 version and the IMGUI is still present, can be used and doesn't generate any warnings or errors.


So I don't quite get the point of the question. I don't know which version you used which may not include the IMGUI system. I also haven't heard about any plans to remove the IMGUI system from the runtime. I agree that this would be a bad move, at least they should make it an optional module in order to keep the engine small for those who don't need it.


Switching Unity versions during production is generally a bad idea. Let alone switching to a beta release. Switching to a patch release of your currently used version would be ok. Though if you are in the middle of a project you shouldn't upgrade Unity. That's why some people still use Unity 5.x.


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Rick66 · Feb 27, 2019 at 09:57 PM

The name was changed to immediate mode GUI (IMGUI) several versions ago

I am assuming that it is still available as it is listed in the 2019.1b Manual under UI, or am I mistaken?

https://docs.unity3d.com/2019.1/Documentation/Manual/GUIScriptingGuide.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

229 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UI Panels are not positioning themselves according to screen size 0 Answers

How to create gui from code ? 2 Answers

Changing where another Camera renders 0 Answers

Is there a better way to access the single active Toggle in a ToggleGroup? 4 Answers

Simple text GUI 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges