Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Official]New UI System.... coming in Unity 4.6

Discussion in 'General Discussion' started by Tim-C, May 28, 2014.

  1. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I assume you are talking about the current Unity GUI. Basically every single person who is using Unity would miss it a lot, because the Unity editor is based on it.
     
  2. CptDustmite

    CptDustmite

    Joined:
    Jun 17, 2014
    Posts:
    61
    Most peoples' old projects use the "old" GUI system. If it were removed, those projects would not work anymore. I don't think most people would want to go and upgrade all their old projects with the new GUI system just to get them working again.
     
  3. Neurological

    Neurological

    Joined:
    Jun 25, 2012
    Posts:
    350
    The "old" GUI is essential for many even for just displaying debug info at runtime without the need to create a hierarchy of objects that would be a nightmare to maintain for something that won't be even into the final game.
     
    angrypenguin likes this.
  4. Agostino

    Agostino

    Joined:
    Nov 18, 2013
    Posts:
    21
    I'd like to know if this new GUI will cater to this user case:
    left mouse click = shoot, unless that click happens over a UI button.

    With the current GUI there are 2 solutions
    using GUILayer.HitTest in Update, and this won't work with the new GUI
    using GUIUtility.hotControl in OnGUI, which probably won't work either.

    Moreover, I'm interested in the synchronization.
    Will the button click arise in Update, FixedUpdate or another function similar to OnGUI?
    Thanks.
     
  5. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,339
    You're correct that the old solutions won't work. IIRC the new system has its own new method for testing whether the cursor is over a UI element.

    Until Unity gets a new input system, all clicks are always captured at the beginning of a frame - it doesn't matter whether you call Input methods in Update(), LateUpdate(), FixedUpdate(), or any other time, they'll always report the input state as it was at the beginning of the frame.
     
    deram_scholzara and Agostino like this.
  6. Kensei

    Kensei

    Joined:
    Apr 26, 2013
    Posts:
    63
    I should've used more clarity in my post, sorry. I meant after the new UI, when people start new projects, I don't see who would chose the current UI over the upcoming one.
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I am going to make a retro theme for the new GUI that looks like the old one ;)
     
  8. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    386
    It's definitely coming soon, I've already published an asset on the Asset Store that supports "uGUI" (as well as nGUI and others) which I developed using the 4.6 beta. I have to say, the workflow for uGUI is just amazing.
     
    rakkarage, sqallpl and StarManta like this.
  9. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    114
    4.6 confirmed for Unite.
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    ?
     
  11. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    114
    That was a joke lol.

    I guess this forum doesn't understand jokes like that, it's alright, my bad.

    It was a silly way of saying 4.6 is MOST LIKELY coming at Unite.
     
  12. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    One thing, can we use both at the same time? I mean will GUI.depth work with the new transform based UI?
     
  13. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,046
    They're 2 completely separate things
     
    shkar-noori likes this.
  14. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Sorry, it was not my intention to destroy your joke :)
    Even if Unite is going to be in a few days, it is not impossible that something leaked or even that an actual announcement was made. Unlikely, but definitely not impossible. Those thoughts were the cause for my reply.
     
    StarManta likes this.
  15. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    As somebody who's been writing a LOT of editor extensions lately, I can't use the new one over the old one for a lot of my needs.
     
    shkar-noori likes this.
  16. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    267
    It's not so simple: a release often fixes some bugs (that you know about) while adding new ones (that are unknown when you port). Certainly porting to Unity 5 mid-development is crazy (a 5.0.0 will be way more buggy than a 4.6.2)
     
    shkar-noori likes this.
  17. Kensei

    Kensei

    Joined:
    Apr 26, 2013
    Posts:
    63
    It all rests on the testers shoulders, u can't really know how buggy it will be, you can just extrapolate stats :p
     
  18. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Are you saying that you've downloaded a pirate copy of unity with the new gui and can't figure out how to use it?
     
  19. ForgottenCheese

    ForgottenCheese

    Joined:
    Dec 1, 2013
    Posts:
    40
    There's a beta for Unity 4.6 which includes uGUI
     
  20. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    Then, logically, wouldn't they post in the beta forum to which they have access to ask this?
     
  21. ForgottenCheese

    ForgottenCheese

    Joined:
    Dec 1, 2013
    Posts:
    40
    That's a good point, looking at the guy's profile he just joined today, and that was his first post. So yeah, probably pirate.
     
  22. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Yes, I know. It can be freely downloaded from their CDN.
     
  23. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    267
    It's an emergent fact of software development that for each level in the version, point-zero releases have more bugs, for the simple reason that they add more features and yet those features are less battle-hardened by users.
     
  24. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,525
    Yes, plus I like it for quickly prototyping UI flow in a new project before spending time getting the real UI working.
     
  25. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    321
  26. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    524
    Did they really just say the whole thing is written in C#?

    Does that mean we're not looking at any real performance gain over, say, NGUI - with the very high cost of rebuilding meshes from C# scripts? - For mobile developers, a significant UI performance gain is/was perhaps the most exciting thing to look forward in the near future of Unity....

    Will be interesting to take a look at the beta, anyway

    (Edit: Panic over, looks like at least Canvas/CanvasRenderer is native, and CanvasRenderer.SetVertices looks very useful!)
     
    Last edited: Aug 20, 2014
  27. KyleStaves

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    820
    No, the whole portion that was written in C# is open source - but not every aspect of the new UI is on the C# layer. Certain things still exist on C++ land.
     
  28. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    386
    Wanna create your own skins for the new GUI system super quickly? Prototype like a boss with GUI Generator!


     
    rakkarage likes this.
  29. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    828
    There are official beta access users without access to special forums or groups.
     
  30. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    321
    Kind of feel spammed by you now. I liked your video 10 posts above but now again?
     
    Kensei and Devil_Inside like this.
  31. iKonrad

    iKonrad

    Joined:
    Jun 23, 2013
    Posts:
    180
  32. Ness

    Ness

    Joined:
    Oct 1, 2012
    Posts:
    183
    4.6 + Tutorials on it on day one = Pure Awesomeness. Thanks Unity.
     
    ForgottenCheese and rakkarage like this.
  33. HappyLDE

    HappyLDE

    Joined:
    Apr 16, 2014
    Posts:
    56
    AWESOMEEEE!
     
  34. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    WOW! Day-1 GUI tutorials and Opensourcing the new gui!
     
  35. Neurological

    Neurological

    Joined:
    Jun 25, 2012
    Posts:
    350
    HOLY S***! CAN YOU BELIEVE THAT? GONARCH ET LABORA!
     
  36. dookie-boy

    dookie-boy

    Joined:
    Nov 29, 2012
    Posts:
    7


    Yesss. Thanks, Unity!
     
  37. gamedude99

    gamedude99

    Joined:
    Dec 30, 2012
    Posts:
    10
    Hey just downloaded the new gui update. One question: How do I install both 4.5.3 and 4.6 beta on the same computer without using separate drives on Mac OS X?
     
  38. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,339
    Just rename your existing Unity folder. I usually rename mine to include the version number.
     
  39. gamedude99

    gamedude99

    Joined:
    Dec 30, 2012
    Posts:
    10
    Thanks I'll try that :)
     
  40. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    386
    Yea, sorry, I just thought it worth mentioning since 4.6 hit public beta allowing anyone to try it. Point taken though it was, as they say "too soon".
     
  41. ForgottenCheese

    ForgottenCheese

    Joined:
    Dec 1, 2013
    Posts:
    40
    They delivered! Haven't played around with it yet, but it looks awesome from the videos.
     
  42. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    72
    Any examples/tutorials/etc. yet for creating drag and drop functionality?
     
  43. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,158
    There is one in the example project.
     
  44. Flickayy

    Flickayy

    Joined:
    Jan 20, 2013
    Posts:
    40
    Any news on how to interact with the new UI via scripts?
     
  45. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,232
    It's quite simple. The information is publicly available in the beta documentation.
     
  46. hofmnn

    hofmnn

    Joined:
    Aug 24, 2014
    Posts:
    2
    I've been using old GUI Text in my project and now I switched to new UI system.
    How do I fade in/out text now?

    I have script that operates with GUI Text.
    How to make it work with the new UI?
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3.  
    4. public class TextFadeInOut : MonoBehaviour
    5. {
    6.     public float fadeDuration = 3.0f;
    7.     public bool fadeIn = false;
    8.     public bool fadeOut = false;
    9.    
    10.     private void Start ()
    11.     {
    12.         StartCoroutine(StartFading());
    13.     }
    14.    
    15.     private IEnumerator StartFading()
    16.     {
    17.         if (fadeIn)
    18.             yield return StartCoroutine(Fade(0.0f, 1.0f, fadeDuration));
    19.         if (fadeOut) {
    20.             yield return StartCoroutine (Fade (1.0f, 0.0f, fadeDuration));
    21.             Destroy (gameObject);
    22.         }
    23.     }
    24.    
    25.     private IEnumerator Fade (float startLevel, float endLevel, float time)
    26.     {
    27.         float speed = 1.0f/time;
    28.        
    29.         for (float t = 0.0f; t < 1.0; t += Time.deltaTime*speed)
    30.         {
    31.             float a = Mathf.Lerp(startLevel, endLevel, t);
    32.             guiText.font.material.color = new Color(guiText.font.material.color.r,
    33.                                                     guiText.font.material.color.g,
    34.                                                     guiText.font.material.color.b, a);
    35.             yield return 0;
    36.         }
    37.     }
    38. }
     
  47. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,028
    UI.Graphic.Color (look it up in your local copy of the 4.6 scripting reference)
     
  48. hofmnn

    hofmnn

    Joined:
    Aug 24, 2014
    Posts:
    2
    There are no code examles in docs.
    How do I refer to my UI.Text or UI.Button in the script? (When I try to I get an error "The type or namespace name `UI' could not be found.")
    Could you give me some code example, 'cause I can't figure out how to use this new API.
    Thanks.
     
  49. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,046
    Well, it's pretty simple...
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class ColorChanger : MonoBehaviour
    6. {
    7.     private Graphic myUIElement;
    8.  
    9.     void Start ()
    10.     {
    11.         myUIElement = GetComponent<Graphic>();
    12.     }
    13.  
    14.     public void ChangeColor()
    15.     {
    16.         myUIElement.color = new Color(Random.value, Random.value, Random.value, Random.value);
    17.     }
    18. }
     
    andreadst and hofmnn like this.
  50. Luiz_Thiago

    Luiz_Thiago

    Joined:
    Feb 27, 2013
    Posts:
    31
    Someone know how to check if mouse is over the GUI?
     
unityunity