1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  3. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
    Dismiss Notice
  4. Unity 5.5 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  6. Unity 5.6 beta is now available for download.
    Dismiss Notice
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
    Dismiss Notice
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
    Dismiss Notice

UI Example Project

Discussion in 'Unity UI' started by Tim-C, Aug 21, 2014.

  1. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Messages:
    1,885
    Hi, if you are looking for the UI example project for the UI public beta then you have come to the right place.

    This project contains a number of examples showing how to use some of the fundamental building blocks of the system, but it is by far not an exhaustive example of what can be done!

    You can find the project on the Asset Store here:
    https://www.assetstore.unity3d.com/en/#!/content/25468

    There are a number of scenes:
    • Controls - shows some of the standard controls that come with the UI system.
    • Drag And drop - How to implement a drag and drop handler.
    • Draggable Panel - How to implement a simple draggable and resizable window.
    • Layout Groups - Example of using the auto layout system with nested layout groups and a grid.
    • Lighting - Examples of UI affected by lighting in the scene.
    • Menu 3D - How to have a 3d UI with perspective that uses Mecanim for the buttons.
    • Render Texture - How to use render textures for UI elements.

    You can find the project for beta and release candidate versions of 4.6 here:
    Beta 17: https://oc.unity3d.com/public.php?service=files&t=3df3567b33718c5ffdfe804691ed0e97&download
    Beta 20: https://oc.unity3d.com/public.php?service=files&t=1f68bffd6d9a921b2ead6013c3135556&download
    Beta 21: https://oc.unity3d.com/public.php?service=files&t=e219928abaa63e60884aba862645b8a9&download
    RC 1: https://oc.unity3d.com/public.php?service=files&t=9d2a4b547862df12cfe0c21c2b461456&download
    RC 2: https://oc.unity3d.com/public.php?service=files&t=b35741c9d9b7c81bfdcf1b326fff4086&download
    RC 3: https://oc.unity3d.com/public.php?service=files&t=d200eb8bd06796705fd505e15b54f897&download
     
    Last edited by a moderator: Nov 26, 2014
  2. nventimiglia

    nventimiglia

    Joined:
    Sep 20, 2011
    Messages:
    147
    Thanks =)
     
  3. gamedude99

    gamedude99

    Joined:
    Dec 30, 2012
    Messages:
    10
    How can I install 4.6 beta with 4.5.3 on the same computer on the same drive on Mac OS X 10.9.4?
    Thanks
     
  4. Aurore

    Aurore

    Producer Unity Technologies

    Joined:
    Aug 1, 2012
    Messages:
    3,080
  5. Josh-Naylor

    Josh-Naylor

    Unity Technologies

    Joined:
    Jul 1, 2014
    Messages:
    214
    In your applications folder change the "unity" folder name to "Unity (version number)" then install the beta, it will create another folder called "unity" and change that one to whatever version number.

    You can have as many versions as you like, like this: http://gyazo.com/af49e31ddbc05a6c02c206864e7a6cfa
     
    GregMeach likes this.
  6. gamedude99

    gamedude99

    Joined:
    Dec 30, 2012
    Messages:
    10
    Thank you
     
  7. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Messages:
    481
    new ugi just awesome......
     
  8. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Messages:
    2,492
    Does the project include Mobile Touch support?
     
  9. Josh-Naylor

    Josh-Naylor

    Unity Technologies

    Joined:
    Jul 1, 2014
    Messages:
    214
    Your first touch (Input.GetTouch(0)) is mapped to the left mouse click (Input.GetMouseButtonDown(0)). So yes, should be fine.
     
  10. zullo91

    zullo91

    Joined:
    Nov 1, 2013
    Messages:
    9
    Very helpful resources, thank you !
     
  11. fverhoef

    fverhoef

    Joined:
    Mar 28, 2014
    Messages:
    1
    Very well done, the new UI system looks fantastic! Great job :)
     
  12. scoobydoobydoo

    scoobydoobydoo

    Joined:
    Dec 18, 2013
    Messages:
    8
    I just tested out the example project with 4.6 Beta and it seems that most of the controls do not work when using the web player. Is that a known issue? When i tested it out on a desktop Windows build everything worked.
     
  13. shahan

    shahan

    Joined:
    Jan 27, 2014
    Messages:
    20
    Thank you for this, I just stripped down the project to the horizontal sliders and made some status bar stuff here:
    The project was very helpful. Going to try to make my own bar graphics in PS later.



    and scoobydoobd i had issues with the webplayer build myself, i think it's just a beta thing.
     
    Tim-C likes this.
  14. SROZOne

    SROZOne

    Joined:
    Apr 21, 2014
    Messages:
    254
    How i can add textfield with UI?
     
  15. MLow

    MLow

    Joined:
    Mar 2, 2011
    Messages:
    35
    I messed with the drag and drop scripts and ended up with this:

    Thanks for the awesome UI system!
     
    dval, Ness, Mikael-H and 4 others like this.
  16. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Messages:
    2,460
    Cool example. That would be an awesome example project :)

    While at drag n drop. It would be cool when Unity would allow drag n drop of external files ...
     
  17. HeQiuQiu

    HeQiuQiu

    Joined:
    Nov 4, 2013
    Messages:
    1
    Thanks a lot!
     
  18. HVgame

    HVgame

    Joined:
    Jun 4, 2014
    Messages:
    9
    Sir, How can I use Button.onClick In "if ()"
     
  19. Ever68

    Ever68

    Joined:
    Aug 24, 2014
    Messages:
    4
    Assets/Scripts/DragMe.cs(6,38): error CS0246: The type or namespace name `IBeginDragHandler' could not be found. Are you missing a using directive or an assembly reference?

    Assets/Scripts/DragMe.cs(6,71): error CS0246: The type or namespace name `IEndDragHandler' could not be found. Are you missing a using directive or an assembly reference?
     
  20. superpig

    superpig

    Insert bacon, receive bugfix Unity Technologies

    Joined:
    Jan 16, 2011
    Messages:
    3,719
    Do you have 'using UnityEngine.EventSystems;' at the top of your file?
     
  21. Ever68

    Ever68

    Joined:
    Aug 24, 2014
    Messages:
    4
    Yes
     
  22. Diablo404

    Diablo404

    Joined:
    Mar 15, 2013
    Messages:
    120
    Hey @MLow ! Any chance to get the source of it? Looks awesome!
     
  23. Ever68

    Ever68

    Joined:
    Aug 24, 2014
    Messages:
    4
    What i can do?
     
  24. Ever68

    Ever68

    Joined:
    Aug 24, 2014
    Messages:
    4
    I just delete all unity on my pc, and install new download. And this project work!
     
  25. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Messages:
    1,885
    I'm guessing you were using 4.5 before and not 4.6...
     
  26. MLow

    MLow

    Joined:
    Mar 2, 2011
    Messages:
    35
    Hm, maybe I will polish it up and put on asset store ? :p
     
  27. Diablo404

    Diablo404

    Joined:
    Mar 15, 2013
    Messages:
    120
    Haha! Fair enough!
     
  28. shahan

    shahan

    Joined:
    Jan 27, 2014
    Messages:
    20
    More fleshed out and featured use of the new Sliders as status bars for the player:

    what do you guys think? Is it "wrong" to use sliders in this way? Any advising against this or anything?
     
  29. _Daniel_

    _Daniel_

    Joined:
    Feb 28, 2007
    Messages:
    2,264
    Not at all. Even unity's own demos use sliders in this way. It can be slider OR progress bar.
     
  30. Venged

    Venged

    Joined:
    Oct 24, 2010
    Messages:
    502
    Is there an asset on the asset store to add Render Texture functionality to Unity Free version?
     
  31. Runnerman12

    Runnerman12

    Joined:
    Jul 20, 2012
    Messages:
    33
    Very cool, thanks for sharing. This will be a an awesome upgrade. Already using NGUI im feeling at ease with new upgrade.
     
  32. shawn

    shawn

    Unity Technologies

    Joined:
    Aug 4, 2007
    Messages:
    525
    There's an updated project for beta 18. I've added it to the original post.
     
  33. gupteraaj5

    gupteraaj5

    Joined:
    Dec 5, 2013
    Messages:
    19
    Hello Guys.

    Is multitouch input, on touch devices, supported by the new system as of now. Have been looking but not much info around.

    If yes, how can i implement a pinch to zoom.

    Thank you,
    Nihal
     
  34. _Daniel_

    _Daniel_

    Joined:
    Feb 28, 2007
    Messages:
    2,264
    @TimC recommends writing your own InputModule and send out custom OnPinch events via an IPinch interface (or something to that effect).
     
  35. gupteraaj5

    gupteraaj5

    Joined:
    Dec 5, 2013
    Messages:
    19
    Hey _Daniel_

    Thanks for your reply. Will look it up.

    Nihal
     
  36. Wolkenschauer

    Wolkenschauer

    Joined:
    Jan 27, 2014
    Messages:
    2
    Nice! Love it! By the way how would you use the particle system with the canvas?
     
  37. Slev

    Slev

    Joined:
    Sep 8, 2012
    Messages:
    148
    Are we free to use the sample code in Commercial Projects? (As with other Unity Assets?)
     
  38. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Messages:
    1,885
  39. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Messages:
    813
    lol, when/ if you update this ( i only saw v17).. maybe put a little note somewhere on screen that RenderTextures is a pro feature... ??
    loool i took like an hour trying to figure out why that scene wasnt working right :p

    then i came here and read
     
    Venged likes this.
  40. Venged

    Venged

    Joined:
    Oct 24, 2010
    Messages:
    502
    I wish the free version had RenderTexture:)
     
  41. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Messages:
    2,460
    I wish there would be a non commercial pro version for a few bucks fewer ... ah, wishes ... :)
     
  42. _Daniel_

    _Daniel_

    Joined:
    Feb 28, 2007
    Messages:
    2,264
  43. arcmohudragon

    arcmohudragon

    Joined:
    Oct 15, 2012
    Messages:
    98
    Oh...
    I can't find the ui example project for Beta 17 and Beta 19.
    because link said error.
     
  44. shawn

    shawn

    Unity Technologies

    Joined:
    Aug 4, 2007
    Messages:
    525
    Please try again? We were doing some server maintenance this morning that may have affected the downloads. The links are working correctly for me right now.
     
  45. arcmohudragon

    arcmohudragon

    Joined:
    Oct 15, 2012
    Messages:
    98
    Oh, I get it. Thank you team! I can download!
     
  46. shadowjfd

    shadowjfd

    Joined:
    Sep 24, 2014
    Messages:
    1
  47. shawn

    shawn

    Unity Technologies

    Joined:
    Aug 4, 2007
    Messages:
    525
    Beta 20 project (added to the original post) now shows off screen transitions. There's also a new HowTo page for screen transitions in the documentation.
     
  48. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Messages:
    156
    Hi,
    Is there a place where we can easily see a description or a help file of all scripts available to us by default with the new UI? Like Event System, Touch Input Module and so on.
    That would be useful.
    Thanks!
     
  49. shahan

    shahan

    Joined:
    Jan 27, 2014
    Messages:
    20
    I'm still building off m stuff with the slider graphics you uploaded in this project.
    Any tips on how to make my own slider images, like the .psd files with the right settings and stuff?

    anyway I'm having a problem with the Slider and some weird stuff I'm trying to do with it...
    Can anyone help? Or let me know where I should post this question?
     
  50. sarasa89

    sarasa89

    Joined:
    Jan 1, 2013
    Messages:
    5
    Thanks for the examples !
    i couldn't find any [ drag-to-resize ] or [ popup list ] examples, can this be easily implemented in the new UI ?
     
    Last edited: Oct 12, 2014