Search Unity

Unity UI Extensions Update 2.0 - Released (The uber, major, massive update)

Discussion in 'Immediate Mode GUI (IMGUI)' started by SimonDarksideJ, Aug 11, 2017.

  1. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Unity UI Extensions - Update 2.0
    The update so big they had to name it twice.


    https://bitbucket.org/UnityUIExtensions/unity-ui-extensions

    It's a brave new world as we head in to the first major update to the Unity UI Extensions project since our initial release back in December 2014 (WOW, has it been that long?)

    The project has been through many changes since then:
    • Doubling the controls / effects every few months
    • Major support from the community
    • The release of my second Unity book focusing on the Unity UI System
    • The move from Mercurial (hg) to Git
    • New documentation videos / tutorials
    • Thousands of supporters across the world
    It's been a wild ride but it doesn't stop there, keep an eye on the project and support us if you can. Either with code, reviews, issues, fixes or even friendly funds :D

    Above all, the project is FREE to use and will always remain FREE
    (we just ask you to think of us if the cash starts rolling in :D)

    As ever, if you have an idea for a control but don't know how to build it, then just ask by raising an issue of type Proposal on BitBucket. be sure to chat to us on Gitter beforehand, just to be check if your idea can work with the existing controls.

    Be sure to logon to the new Gitter Chat site for the UI Extensions project, if you have any questions, queries or suggestions

    New / updated features
    • Major updates to the Line renderer for texture and positioning support, inc Editor support
    • Line Renderer also includes "dotted" line support and the ability to increase the vertex count
    • Reorderable list now also works in Screenspace-Camera & Worldspace
    • H&V Scroll Snap controls now support scrollbars
    • Minor updates to the Gradient 2 control
    • Minor updates to all dropdown controls to manage control startup
    • Update UI Particle Renderer with new updates, including Texture Sheet animation support
    • New Selectable Scalar
    • New MonoSpacing text effect
    • New Multi-Touch Scrollrect support
    • New UI Grid Renderer (handy if you want a UI grid background)
    • New CoolDownButton control (adds a timer between button clicks)
    • New Curly UI - for those who like their UI Bendy
    • New Fancy Scroll View - A programmatic scroll view
    • New UI Line connector control - extends line renderer to draw lines between UI Objects
    • New Radial Slider control - for those who like their sliders to curve
    • New Stepper control - a +/- control similar to that found on iOS
    • New Segmented Control - A button array control similar to that found on iOS
    • New UIHighlightable control - just in case the user wasn't sure where they were
    Examples / Examples / Examples
    Finally added some proper examples, especially for the newer controls.
    These can be found in the Examples folder (which can be safely deleted if you wish)

    • ColorPicker - shows the Color Picker UI in both SS and WS
    • ComboBox - shows all the different combo box controls
    • Cooldown - several example implementations of the cooldown button control using Unity image effects and SAUIM
    • CurlyUI - shows off the CurlyUI control
    • FancyScrollView - the only REAL way to understand this programmatic control (direct from the contributor)
    • HSS-VSS-ScrollSnap - several working examples of the HSS/VSS scroll snaps (not ScrollSnap or FancyScrollView), including a full screen variant
    • MenuExample - A demo menu implementation showing off the new MenuManager control
    • Radial Slider - Just keep on sliding
    • ReorderableList - Several examples of the re-orderable list in action, complete with managed drag / drop features
    • ScrollConflictManager - Making ScrollRects get along
    • SelectionBox - The RTS selector in action, showing examples of selecting 2D and 3D objects
    • Serialisation - Unit test case examples for the serialisation components
    • TextEffects - All the Text effects and shaders in one easy to view place
    • UIlineRenderer - Several demos / examples for using the Line Renderer and UI Line connector controls
    • UIVerticalScrollerDemo - A full screen example of a UIVertical Scroller implementation.
    Fixes
    • H&V Scroll Snap Next/Previous Button interactable handler (only enables when there is a child to move to)
    • H&V Scroll Snap Swipe logic updated and now includes scaling support
    • Editor options for non-drawing graphic control
    • Events in ComboBox, Dropdown and autocomplete controls updated to use UI events
    • UIFlippable "Argument out of Range" bigfix (pesky component orders with effects)
    • All primitive controls will now redraw when enabled in code
    • Autocomplete has two lookup text methods now, Array and Linq
    • Line renderer pivot fix (now respects the pivot point)
    • TextPic rendering and event updates
    • Minor tweaks to the UIParticle system to remove "upgrade" errors. Still needs a rework tbh
    • Clean up of all unnecessary usings (swept under the rug)
    Upgrade Notes
    With this being a major version update, it is recommended to remove the old UI Extensions folder before importing the new asset.

    So stop just reading this and get yourself on to the site and downloading the package
    https://bitbucket.org/UnityUIExtensions/unity-ui-extensions

    P.S.
    I've submitted the package again to the Asset Store for this release. It's been kicked out every other time but who knows. I left a load of comments on the submission for consideration, so maybe we'll get lucky.
     
    Ony, Mauri, Grizmu and 3 others like this.
  2. Nowlz

    Nowlz

    Joined:
    Nov 18, 2016
    Posts:
    55
    Great work! Well done to all those involved, the UI Extensions package has been so helpful over the years. Very much appreciated.
     
    SimonDarksideJ likes this.
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    I can't believe it's been 2 years already, the time has flown.

    About time I got my second UI book done and released. More of a "How to" than a technical reference like the last one.
    Thanks for the kind words
     
  4. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This looks really nice thanks for posting.
     
  5. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there!
    Seems, that this asset doesn't fit for massive usage. I'am drawing grids with a lot of lines and rects (around 1500 and 300) and on enable/disable objects fps goes down dramatically due to CG on Canvas.sendwillrendercanvases or MaskableGraphic.OnDisable
    Here some screens
     

    Attached Files:

  6. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    @justtime please don't post exactly the same comment in multiple places, just makes it harder to answer.
    Repeating what I responded in BitBucked and this post - https://forum.unity3d.com/threads/u...t-updated-to-1-1-tons-of-new-features.408939/

    I Responded to your post on BitBucket and you have to remember that this is still based on the Unity UI system and reliant on it's framework. So having 100's of items on a canvas isn't going to perform well, you have to optimise as shown on the Unite sessions this year.

    That being said, new controls like the "GridRenderer" extend the line renderer to control how the line is generated resulting in a grid with only one draw call. So it's best to optimise the mesh you generate within a single RectTransform and it will perform a lot better. The UIConnector does something similar and we just had a PR for drawing multiple lines with the same Line Renderer which I'm reviewing.
     
  7. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Some good stuff in this, did not notice a stepped Slider though which is easy enough to do by extending Slider. Had to add one recently - essentially a Slider with added step size so you can do say 100-500 range with a 100 step to limit values to 100,200,300,400,500
     
    Last edited: Feb 19, 2018
    SimonDarksideJ likes this.
  8. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    If you know the ins and outs of the UI Framework, all of this is fairly easy to put together. Full aims of the project, like most assets is to provide them out of the box, so you don't have to :D
     
  9. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,276
    Just digging this thread up again to ask about 1 pixel lines and if any one came up with a good solution with UI Extensions or with any other technique!
    I came up with a potential solution involving using UILineRenderer with caps/joins disabled and then using a material with a 4 pixel line texture (2 inner pixels solid white, 2 outer transparent) at half size (so 2 pixel wide lines) and also snapping coordinates to half pixel values. Result is anti-aliased 1 pixel-ish lines on my Windows PC at least. I don't currently have time to suggest a mod to the project repo but can provide sample Unity project. Would be good to have a solid 1 pixel line drawing solution for community if none exists.
     
  10. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    I've been attempting to build an endless scrolling carousel (similar to app store banners, and the carousels at the top of most elements.)

    It looks like combining a Horizontal Scroll Snap with an Infinite Scroll doesn't work correctly for this, as the carousel smoothly tweens back to the start at the end of the carousel, rather than seamlessly snapping across to the first element.

    Is it intended that the Unity UI extensions project should be trivially usable to build such a thing as an endless scrolling scroll-snapped carousel?
     
  11. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    The HSS / VSS are "out of the box" solutions for standard scroll snap solutions. However what you are describing is a little more advanced, so I'd suggest looking at the FancyScrollView which is a more programmatic solution better suited to your needs.

    Another solution may be the Card UI implementation we are currently reviewing for porting over to the UI Extensions project, which can be found here:
    https://github.com/ryanslikesocool/Unity-Card-UI

    Hope this helps.
     
  12. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
  13. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    In the end I ran through this tutorial and ended up with something that worked for the case of an endless scrolling view, with the bonus points that since I'd typed all the code I understood it.



    Then I added a bunch of code to change the size of objects towards the centre, and everything now seems to work great.

    I suspect that any one of the various pre-made scrollviews and scroll snap controllers I looked at *could* have been made to do the right thing, but Unity UI's scrollviews and layout groups are unintuitive and essentially undocumented to begin with, such that if you didn't write the code from scratch yourself and set up all the scene objects yourself all sorts of things like "this needs the pivot set here on this object" can trip you up.
     
  14. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    With what versions of Unity does this work? I just get crashes.
     
  15. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    It's been tested and working up to 2018.1.9f2, as it's what I'm developing it under now. Have you tried it in a clean project, in case something is conflicting in your current one?
    P.S. which version of Unity are you trying?

    Unity crashes are usually caused by a null reference error in my experience.
     
  16. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    Thank you Simon.
    Yes, I tested it with a clean project.
    I'm using 5.3.7
    It crashed immediately on install and just threw up the bug report.
     
  17. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Yikes. The project started in the 5.x error, so I wonder what has changed so drastically for it to do that. Any change you can grab the Unity Error log and attach it to an issue on the Bitbucket site.
    You should find it in:

    %appdata%\..\Local\Unity\Editor\Editor.log
     
  18. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    OK, I went and installed Unity 5.3.7 and it does seem Unity have changed some critical things which break backwards compatibility. However, I was eventually able to import it by:

    • Delete the MenuExample folder in the "Examples" folder. Unity it seems cannot import this scene.

    Following that though, there are some breaking changes, most of which are easy to solve:

    • UIPrimitiveBase - Line 56, change "Canvas.GetETC1SupportedCanvasMaterial()" to "Canvas.GetDefaultCanvasMaterial()"
    • MenuManager - Replace instances of "Instantiate(prefab, transform)" to "Instantiate(prefab, transform.position,transform.rotation)"
    • UIParticleSystem - Remove the 3rd parameter for calls to "pSystem.Simulate"
    There are some other errors where there isn't a simple workaround, so you may simply need to remove those files.

    Ultimately my best advice would be to either:
    • Cherry pick the features you are interested in and just import those (check it out in a later Unity version if you want to test)
    • Use the older 1.1 Unity UI Extensions release which was built under this version.
    Hope that helps, but it seems that we've come too far now to go back to the 5.x series sadly :S
     
  19. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
  20. btyson_z

    btyson_z

    Joined:
    Aug 10, 2018
    Posts:
    9
    I'm curious why you don't offer these tools as individual downloads as well. I'm an artist (non-coder), and I don't need even a quarter of these tools. It would be great if each tool was a tidy little import on its own. It's a hard sell on a real game project to incorporate global editor systems, but I can get away with small self-contained plugins.
     
  21. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    @SimonDarksideJ still using your shadow outline 8 script as it's still the best! How is performance? I've tried other outline 8 scripts and they all send my laptop gpu into a spin, but yours *seems* a lot better. How tough on performance is it?
     
  22. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Yo @btyson_z that is an interesting option, I'll look in to it for 2019. Although the whole package is very lightweight and locked away in it's own namespace. Could you log an issue proposal on the Bitbucket site and give me some hints as specifically what you're looking for.
     
  23. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Thanks for reaching out @Zebbi , based on feedback from the original author, perf should be pretty good with the outline controls as they work directly with the vertex stream rather than an overlay, this intertwines well with the render pipeline that UI uses. If you see anything that might be improved however, just drop an issue or PR and contribute :D
    Glad you're enjoying the project.
     
  24. GoalLine

    GoalLine

    Joined:
    Mar 23, 2017
    Posts:
    8
    Hi,
    Is there a way to have Vertical Scroll Snap start from the top instead of the bottom - where newest is on bottom and oldest on top? One little hack I did to achieve this was to reverse order the objects in the hierarchy. The big problem that creates is new objects instanced into the scene need to be reordered as well.

    *In other words, is there a way to have objects spawned and ordered in descending order rather than ascending order such that scrolling starts from top to bottom.

    Best,
    GL
     
  25. kamchowrehab

    kamchowrehab

    Joined:
    Feb 19, 2020
    Posts:
    1
    For the UILineRenderer, what is the best practices for better performance if I want to use it for plotting few line charts for incoming data which will keep updating, say 50 times/sec?
    Thanks
     
  26. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Best to chat on the Gitter channel for UIExtensions

    But the control should be quite perfromant already as the main limitation would be Unity's underlying vector drawing libs. Best thing to si ensure you are also perfromant on your projects side, using readonly arrays and reusing elements when updating to avoid memory leakage.