Search Unity

DoozyUI: Complete UI Management System

Discussion in 'Assets and Asset Store' started by AlexMares, Apr 13, 2016.

?

Would you like to see a free version of DoozyUI with limited features?

Poll closed May 12, 2016.
  1. Yes

    1 vote(s)
    33.3%
  2. No

    2 vote(s)
    66.7%
  1. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    DoozyUI 2.5 - New Features
     
    Bhanshee00 likes this.
  2. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi All,

    We are happy to announce that DoozyUI 2.5 has been submitted for review. The price is the same and the upgrade is free.

    Please read the Release Notes before upgrading as there are some Breaking Changes that you should be aware of.
    The main features we introduced with this version are the Orientation Manager, that will allow you to create separate UIElements for Landscape and Portrait orientations (using the same ElementName), and an improved approach to handling hidden UIElements (we disable the Canvas and the Graphic Raycaster components, thus you get a better overall performance). Also, because Unity improved a lot the UI side (it fixed a lot of bugs and improved it's performance) from 5.1 to 5.3 and up, we decided to up the minimum Unity version from 5.1 to 5.3.

    We are on track with developing DoozyUI 3.0 that will bring a new inspector interface and a lot of new features. As a side note, the Orientation Manager was intended for DoozyUI 3.0, but we saw that some users were in need of it so we implemented it now.

    We are working on a daily basis on improving this asset and with your help we will make it even better.
    If you already use it, send us a message and tell us what you think of it or better yet leave us a review on the asset store.

    We hope that you'll enjoy using DoozyUI as your UI management system of choice and that you will be able to create wonderful apps and games with it.

    Should you have a question, an issue, a suggestion or a feature request, we are a message away! :)

    Cheers,
    Alex
     
    Last edited: Aug 3, 2016
  3. adriansotov

    adriansotov

    Joined:
    Jul 14, 2015
    Posts:
    16
    Hi!

    Is it possible to have a single button show multiple elements in series? For example, if I click once element1 shows, if I click again then element2 shows and element1 hides, and so on….


    Thanks
     
  4. adriansotov

    adriansotov

    Joined:
    Jul 14, 2015
    Posts:
    16
    Question #2, Is it possible to have a button show an element based on an external condition? For example, when a button is pressed, If condition A is met show something but if condition B is met, show something else.


    Thanks
     
  5. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    The core functionality for an UIButton is to show/hide one or more UIElements at once, not in a series. But you can achieve this if you write a small helper script.

    Every UIButton has 3 public List<string> showElements, hideElements and gameEvents. You can trigger a method every time the user presses a button and update the showElements and the hideElements Lists with your desired ElementNames (the names of the UIElements you want to show/hide). Thus you can do what you are looking for, just not without writing a small script.
     
  6. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Again, this can be easily done with a very small script that adjusts the showElements and hideElements List string values to the ones you want.

    Another approach can be as follows:
    1. You do not set any Show/Hide values and use a GameEvent instead
    2. You send, for example, a game event named 'MyCustomEvent'
    3. You create a script with the following method inside

    Code (CSharp):
    1.  
    2. public void OnGameEventForMyCustomMethod()
    3. {
    4.       //do your logical test here (example code below)
    5.       if(myExternalCondition == true)
    6.       {
    7.            UIManager.ShowUIElement("ElementNameForCondition_1");
    8.       }
    9.       else
    10.       {
    11.            UIManager.ShowUIElement("ElementNameForCondition_2");
    12.       }
    13. }
    4. You attach said script to a GameObject inside your Hierarchy and attach an UITrigger that listens for a game event named 'MyCustomEvent'
    5. DONE!

    So looking at my previous answer and this one, you now have two methods that can achieve the results you are looking for. Should you need more help, find issues or have any suggestion, don't hesitate to send us an email. We're happy to help! :)

    Cheers,
    Alex
     
    Last edited: Aug 5, 2016
  7. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
  8. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    I don't see anything about input. Does this offer some kind of way to integrate with input solutions other than the horrible default Unity input system, such as InControl or Rewired?
     
  9. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Obsurveyor,

    DoozyUI can be configured to work with a controller, every UIElement having the option to set the default button that gets selected when shown. Thus you can create an Explicit Navigation scheme using the native Unity Button component and navigate the UI with just a controller. This is not an input solution, but an UI animation and management system. You can however use a custom input solution along side DoozyUI.

    Cheers,
    Alex
     
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Just purchased this on sale. I imported DOTween (free) first, then Doozy UI, but I get a bunch of compiler errors -- see screenshot.
     

    Attached Files:

  11. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi gecko,

    Those missing methods are from DOTween and I believe you forgot to press the setup button for it. You can do that by going to Tools --> DOTween Utility Panel --> Setup DOTween...
    That will import the missing methods and you should be good to go. Also take a look at the initial setup for DoozyUI (you will have to create a sorting layer named 'UI', because it cannot be done from code at the moment).

    Did this fix your issue?

    Cheers,
    Alex
     
  12. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    That was it, thanks much!
     
  13. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Glad it worked!
    Also check this out - How To create a Simple UI
    (just by watching this you will get a decent grasp on how to use DoozyUI with ease)


    You will find a lot of answers by watching our tutorials on our YouTube channel.
    Should you need help, find issues or have any suggestions, don't hesitate to send us an email. We're friendly! :)

    Cheers,
    Alex
     
  14. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    Hey, I was interested in getting this while it was on sale and just e-mailed you a few questions. Google often puts my e-mails in spam so I wanted to make sure it wasn't missed.
     
  15. jestermaximusJr

    jestermaximusJr

    Joined:
    Jan 12, 2013
    Posts:
    14
    Hello, I'm very interested in your product but was wondering if it could work with a canvas set to worldspace. I'd like to create menu system that that moves a camera through a 3D space during menu transitions (each menu being located in a different physical location). Additionally, I'm making a flight sim so parts of my UI will be attached to the aircraft's geometry. Thanks!
     
  16. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    We received your email and gave you a detailed answer. Should you have more questions, fire away! (on email :)

    Cheers,
    Alex
     
  17. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi jestermaximusJr,

    Right now DoozyUI uses one main Canvas that is set to Screen Space - Camera. The system has not been designed to work with multiple Canvases set to World Space, but we have this feature under development.

    I understand what you are looking for, but the current version of DoozyUI can't help you with this type of setup.

    What I can tell you now is that we have tested several options to work with this type of use case scenario and we will be introducing it with DoozyUI 3.0. This is still in it's early stages of development, but it will probably be ready for production two months from now.

    We do not release new features for production unless we do all the in-house tests and are certain that it behaves as expected. Thus we would rather release a feature later (that is error free), than sooner (that might be error prone).

    Cheers,
    Alex
     
    jestermaximusJr likes this.
  18. jestermaximusJr

    jestermaximusJr

    Joined:
    Jan 12, 2013
    Posts:
    14
    Thanks for your quick answer! The time horizon for 3.0 release doesn't worry me too much, as long as that is a targeted feature to support. I've watched most of your videos and love the idea of your asset. You've got a new customer! :)
     
  19. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi jestermaximusJr,

    Thank you for your support. We try to keep all the DoozyUI users up to date with the new features and optimizations through detailed release notes and videos so that they will know how to use/implement them. Be sure there will be video tutorials on how to implement World Space canvases with DoozyUI 3.0 when it will be released.

    Cheers,
    Alex
     
  20. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    For anyone who gets confused for a sec:

    DOTween on the Asset Store is extremely out of date and doesn't work with this asset. You need to go to DOTween's website and download the latest version from there and then setup DOTween(just clicking a setup button).

    Maybe the Asset Store is currently broken though, store.unity3d.com isn't working for me, I can't even get a newer version of Unity right now.
     
  21. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Obsurveyor,

    The version currently on the Asset Store should work just fine. You can see that in most of the video tutorials, where we also show the initial setup, and we install the free DOTween version from the Asset Store. (example video: How to create a simple UI).

    DOTween needs an update since Unity 5.4 because it uses some deprecated methods, but until it gets updated, you should not encounter any issues using it, either by itself or along side DoozyUI.

    Cheers,
    Alex
     
    Last edited: Aug 6, 2016
  22. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Just looking at this asset and I think I will get it, I am reading and watching videos about it. Just a question while I learn more about it. Would this support/help build/or have issues with having a multiword menu where the player can slide through pages of levels. (e.g. Angry birds level select functionality)
    Thanks
     
  23. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    It wouldn't work for me in 5.3.5f1, it would just complain about missing functions in the DOTween libraries, once I got the version from their website, everything was fine. The version of DOTween on the Asset Store is 1.1.135 and 6 months out of date compared to the website version 1.1.310.
     
  24. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi ProjectOne,

    If you are referring to the world selection menu from 'Angry Birds' then yes, you can do that just by putting a horizontal ScrollView that contains a Horizontal Layout Group of buttons. And you will have the touch scroll of the levels. And you can also attach the left and the right scroll buttons, that scroll the ScrollView, if you want to.

    Cheers,
    Alex
     
    ProjectOne likes this.
  25. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Obsurveyor,

    Those missing functions were there because you had to install and then setup DOTween before installing DoozyUI. By setup I mean going to Tools --> DOTween Utility Panel --> and pressing the button [Setup DOTween... ] and that will add the missing files. It's just the way DOTween works.

    And yes, you are right, DOTween needs an update on the Asset Store, but DoozyUI works just fine with the current uploaded version.

    Also, did you find the written documentation we provided lacking? Please tell us what would you like to see besides the component details, code examples and functionality explications. We tried to cover all of DoozyUI in the 30 pages of documentation that we wrote. If you feel that there is something missing, please let us know so that we can address it.
    Documentation link (PDF)

    We really try to provide a good product and help you guys create with ease beautiful user interfaces for your projects. That is the core idea behind DoozyUI. That is why we worked a lot on the inspector interface so that it easy to work with, we commented most of the code, we made the pdf documentation and all the videos. And we always ask if anyone encounters issues or has any suggestions to let us know, because we want to make this asset better and better. So please don't take this the wrong way, as we are actively developing this asset, any help/suggestion/criticism is most welcome.

    Thank you,
    Alex
     
    Bhanshee00 likes this.
  26. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    Hi,

    I am setting up a basic Main Menu. Following the video. I want my main menu up and running before the game view or at the same time that the game shows up. My main menu is transparent so that you can see the game running in the background. With a basic canvas setup the menu sets up before (or at the same time) the background game materializes. With Doozy UI, even if I set the animations (which I don't want for the main screen) at .0001, the game shows up first in background and then a fraction of a second later the Doozy UI shows up. How can I remedy this. I would like for the MainMenu to get to the screen before the game. As it is set up there is only a textMesh title in a transparent mainmenu panel and image.

    thanks
     
  27. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi steeloblk,

    Right now, DoozyUI gets the device screen size at runtime on the second frame (on the first frame the UI hasn't been drawn yet, so we don't have the measurements for it), thus you have a small window (1 frame) when the UI is invisible (the UI camera is disabled and you see your game's background and you get that delay).
    We have a new system that gets the device screen size in testing for DoozyUI 3.0 (I am talking about a system because those measurements need to be integrated with the animation calculations). Since no one asked to see the UI on the first frame we didn't have this on the priorities list, but since you just did, we well implement it with a patch in DoozyUI 2.5.1. Give us a few days to port the new system from the 3.0 version to the 2.5.1 version and do our in-house tests and we'll give you the solution to your use case scenario. Also please send us an email so that we can get back to you as soon as we are done and the patch is ready for production.

    Cheers,
    Alex
     
  28. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    OK thanks Alex. Should I hold off adding any more stuff? Will the upgrade process erase any of the work that I have done?

    thanks again

    Warren
     
  29. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Warren,

    You can continue adding stuff as normal. This is just a functionality that is automated and working inside the core without outside intervention. Plus we test all the new features before each launch and we try (and succeeded thus far) not to affect any ongoing projects. So no, the upgrade process will not erase any of the work you've done. :)

    Cheers,
    Alex
     
  30. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi All,

    Because we are upgrading the UIAnimator with the new calculation system, that we designed for DoozyUI 3.0, we will also be implementing multiple Canvas support. This means that you will be able to use any root canvas type (Screen Space - Overlay, Screen Space - Camera and World Space) and this will allow you to create any type of interface imaginable, especially user interfaces for VR.

    Right now we have the movement part implemented (the hardest one), but we still have the rotate, scale and fade tweens to port and test. The tests we've done so far have been a success and we will try to be ready with a production build by the end of this week. We'll keep you posted!

    Cheers,
    Alex
     
    Bhanshee00 and ikazrima like this.
  31. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    Hi quick question,

    Have you ever seen this error. My project keeps freezing.

    Invalid layer id. Please use the unique id of the layer (which is not the same as its index in the list).
    UnityEngine.Renderer:set_sortingLayerID(Int32)
    DoozyUI.UIEffect:UpdateEffectSortingOrder() (at Assets/DoozyUI/Scripts/UI/UIEffect.cs:159)
    DoozyUI.UIEffect:Start() (at Assets/DoozyUI/Scripts/UI/UIEffect.cs:135)

    Everything was fine until I switched from my project scene to look at some of the scenes that were provided as examples. The examples are temporarily in my project also. I am not sure what changed. Now every time I change something in Doozy I have to save or the game will freeze and I lose the changes.

    thanks
    Warren
     
  32. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Warren,

    Because we cannot manage the sorting layers from code (create/delete/rename) you have to do it.
    I will assume that you have a sorting layer named 'UI' already created. So to fix this, do the following steps:
    1. Open that example scene
    2. Select the game object 'UI Container'
    3. Notice the Canvas component and see the value of the Sorting Layer (it should be <unknown layer>)
    4. Look a bit down and see the component named 'Update Sorting Layer Name'
    5. Press the buttons [Update Canvases] and [Update Renderers]
    6. Done

    Look at the 'UI Container' at the Canvas and see that the Sorting Layer is now 'UI'.
    I know this situation is not ideal, but we haven't found a better solution to handle this yet. When we do, be sure we will change/simplify the workflow.

    Did this fix your issue?

    Cheers,
    Alex
     
  33. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    i think the option "disable when hidden" need some refactor, right now it just disable the object itself.
    so if we have script on the object that can break logic. an alternative solution would be to disable gameobject childs + disable MaskableGraphic ( images etc) instead
     
  34. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Damien,

    Thank you for telling us about that. We will look into it.
    Just so you know, as of version 2.5, DoozyUI automatically disables (when hidden) the canvas and the graphic raycaster components on the UIElements. This ensures the draw call drop and allows your scripts to work when the UIElement is hidden (thus you are not forced to use 'disable when hidden'). Nevertheless we will look into your suggestions.

    Cheers,
    Alex
     
    Tiny-Tree likes this.
  35. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    Thanks Alex,

    It sorta fixed the problem. I updated as you mentioned but for some reason it would always default back to the unknown state after I hit play button. Strange thing is that it wasn't always the same demo scene..... but at least one of them would always default back to the unknown UI.
    I just deleted all of the demo scenes and that seems to have solved the problem for now.

    thanks for the help.
     
    AlexMares likes this.
  36. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    Hi Alex,
    What is the best way to use the toggle sound/music and turn off all output from MasterAudio? Should I use the send game events to set it up?

    thanks
     
  37. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Warren,

    First I will explain how the system works so that you'll have a better understanding of it.
    SOUND
    This happens in the UIManager:
    The game starts and we execute the SoundCheck() method. This checks the PlayerPrefs for the value of 'soundState'. It is an int that can be 0 (sound off) or 1 (sound on). This in turn makes the static bool isSoundOn false or true.
    To toggle the sound state we execute UIManager.ToggleSound(). This changes the soundState from 0 to 1 or vice versa and saves it to PlayerPrefs. Then it sets isSoundOn true or false according to the new setting.
    Whenever we want to play a sound, we check isSoundOn and if it's true we continue and play it, otherwise we return.
    If you use MasterAudio it will play the sound either with 'PlaySoundAndForget' or 'FireCustomEvent' depending of what you selected.

    MUSIC
    This happens in the UIManager
    The game starts and we execute the MusicCheck() methos. This checks the PlayerPrefs for the value 'musicState'. It is also an int that can be 0 (music off) or 1 (music on). This in turn makes the static bool isMusicOn false or true.
    To toggle the music state we execute UIManager.ToggleMusic(). This changes the musicState from 0 to 1 or vice versa and saves it to PlayerPrefs. Then it sets isSoundOn true or false according to the new setting.

    Now, the sound part is taken care of since if the UIManager.isSoundOn is false, no sound will be played. But, the music part is all up to you and I'll recommend the following setup:
    1. In Unity create an AudioMixer with a Bus named 'Music'
    2. Expose the volume parameter
    3. With the help of an UITrigger you can listen for a gameEvent 'UpdateSoundSettings' (this event gets sent whenever a ToggleSound or a ToggleMusic has been executed) and execute a method that checks if UIManager.isMusicOn is true or false and you set the exposed volume parameter value to 0 or to your initial volume.

    Did this help you out or do you need more info?

    Cheers,
    Alex
     
  38. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    is there a way to do a toggle show/hide on UiElement from UIButton?

    for example i want button a to disable panel1 & toggle panel2 so if i click once it close panel1 / open panel2 if i click again it close everything
     
  39. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Damien,

    Right now, you have to use different buttons, but we have an UIToggle in works.

    is there a way to do a toggle show/hide on UiElement from UIButton?
    for example i want button a to disable panel1 & toggle panel2 so if i click once it close panel1 / open panel2 if i click again it close everything

    No, that is not possible because the core functionality for the UIButtons has not been set up to work that way. However, you can achieve that exact effect by stacking buttons (identical visual-wise), but with different actions (show/hide) and each button having an UIElement attached. Let me explain the configuration:
    UIButton_1 has an UIElement_1 attached. Press it and it shows UIElement_2, while hiding UIElement_1 (it shows the next button, while hiding itself)
    UIButton_2 has an UIElement_2 attached. Press it and it shows UIElement_3, while hiding UIElement_2 (it shows the next button, while hiding itself)
    UIButton_3 has an UIElement_3 attached. Press it and it shows UIElement_4, while hiding UIElement_3 (it shows the next button, while hiding itself)
    ...
    UIButton_x has an UIElement_x attached. Press it and it shows UIElement_x+1, while hiding UIElement_x (it shows the next button, while hiding itself)

    and if you want to make it circular
    UIButton_x has an UIElement_x attached. Press it and it shows UIElement_1, while hiding UIElement_x (it shows the first button, while hiding itself)

    and if you want to closte them all
    UIButton_x has an UIElement_x attached. Press it and it shows nothing, while hiding UIElement_x (it shows nothing, while hiding itself)

    So you can achieve that effect, you just have to set it up properly. Also, for the UIElements on the buttons, you can set as the IN and OUT animation the SCALE IN and the SCALE OUT in 0 (zero) seconds. That way the user doesn't know that you switched the button.

    Did this help you out?

    Cheers,
    Alex
     
  40. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20

    Sorta, I followed your explanation. In my case I have sounds on in the game via MasterAudio and I have the Doozy UIToggle button set to on. When I toggle the UIToggle manager to off, I want it to turn off all MasterAudio sounds as well as Doozy sounds (clicks etc). . If I follow you correctly I should be able to use the FirecustomeEvent. I have certain sounds that are triggered in the game during coin collection etc. However when the Doozy toggle sound toggle is off I want to mute all sounds including MasterAudio without doing them one at a time. I will take a look at the FireCustomEvent.

    thanks
     
    AlexMares likes this.
  41. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    it would be so much simple to add on UIElement an option like "toggle Elements" and on the corresponding element do something like void toggle()
    {
    if(isvisible)hide()else show()
    }

    seems its the only thing missing to this wonderful framework
     
  42. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Damien,

    That may seem like an easy method to implement, but we have to take into account the UI Navigation System that listens for the Show and Hide methods of the UIElements. Many users rely on that in their projects. That is why we have an UIToggle component, under development, that will work alongside a native Toggle component, thus allowing you to toggle the UIElement's shown/hidden state. (checked/unchecked)
    .
    When we introduce a new feature and/or a new method for an existing component, we have to make sure we do not affect any ongoing projects that use DoozyUI. It does take longer to release because we need to test several use case scenarios, but it's safer this way for everybody.
    No worries, that component will be available soon. :)

    Cheers,
    Alex
     
    Tiny-Tree likes this.
  43. steeloblk

    steeloblk

    Joined:
    Dec 27, 2014
    Posts:
    20
    Hi Alex, my bug is back.

    I am still having a problem with the Invalid Layer id. I've deleted all the extra Doozy sample scenes and I have checked the UI container to update the Canvases and Update the Renderers however the error still shows up. DoozyIssue.PNG

    Any other ideas?

    thanks
     
  44. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi Warren,

    Please check your email.
    We've sent you a new UIEffect.cs file and we would like your feedback on this.
    If the problem is gone, we will implement this fix in the next update.

    Thanks,
    Alex
     
  45. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    I'm enjoying DoozyUI, however I have a few questions while I'm learning the system and having a few difficulties.

    1. Can I can add a onStart animation listener in script?
    I was hoping to use onInAnimationStart, so that when an animation starts, or stops, I can use the callback. However this does not seem to work. When I get a listener count it's always 0.
    UIElement.onInAnimationsStart.addListener( callback );

    2. I'm creating modal windows using UI elements. However some times theres going to be more than one modal window come up. Because of this I would like to find a way to use a single greybox UI blocker that appears and disappears based on the number of identified modal popups. ie if there are 2 modal popups, then when 1 goes away the greybox remains.
     
  46. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi jayderyu,

    1. Can I can add a onStart animation listener in script?
    Yes you can. I can see you are trying to add a non persistent listener to our UnityEvent, but you should know that in order for the event to get triggered you need to tick, in your case, the 'IN Animations Events @Start' in the inspector of your target UIElement. You need to do this in order for the system to trigger that event, because it's disabled by default for performance reasons.



    Here is a lambda example of your example listener:
    Code (CSharp):
    1.  
    2.             onInAnimationsStart.AddListener(() =>
    3.             {
    4.                 Debug.Log("UIElement - " + elementName + " - onInAnimationsStart)");
    5.             });
    2. I'm creating modal windows using UI elements. However some times theres going to be more than one modal window come up. Because of this I would like to find a way to use a single greybox UI blocker that appears and disappears based on the number of identified modal popups. ie if there are 2 modal popups, then when 1 goes away the greybox remains.
    I would suggest using game events and an 'additive bool'. Here is how the system would work:
    1. Create an UIElement that will be your dark overlay (or your background grey box).
    2. Name it 'DarkOverkay' and set it's fade animations (IN and OUT) and hide @Start.
    3. Create a script named DarkOverlayManager

    Code (CSharp):
    1.         [RequireComponent(typeof(UIElement))]
    2.         public class DarkOverlayManager : MonoBehaviour
    3.         {
    4.             UIElement overlayElement;
    5.             int darkOverlayLevel = 0;
    6.  
    7.             void Awake()
    8.             {
    9.                 overlayElement = GetComponent<UIElement>();
    10.             }
    11.  
    12.             public void ShowOverlay()
    13.             {
    14.                 darkOverlayLevel++;
    15.                 UIManager.ShowUiElement(overlayElement.elementName);
    16.             }
    17.  
    18.             public void HideOverlay()
    19.             {
    20.                 darkOverlayLevel--;
    21.                 if (darkOverlayLevel <= 0)
    22.                 {
    23.                     darkOverlayLevel = 0;
    24.                     UIManager.HideUiElement(overlayElement.elementName);
    25.                 }
    26.             }
    27.         }

    4. Attach that script to your dark overlay UIElement and add 2 UITriggers
    5. First UITrigger listens for 'ShowOverlay' game event and triggers the ShowOverlay() method
    6. Second UITrigger listens for 'HideOverlay' game event and triggers the HideOverlay() method
    7. Every time you show one of your modal windows, you send the 'ShowOverlay' game event (it can be sent from code or from the UIButton).
    8. Every time you hide one of your modal windows, you send the 'HideOverlay' game event (it can be sent from code or from the UIButton); if it's the last modal window that is visible, it will also hide the dark overlay, otherwise the overlay will remain on the screen and only the modal window will hide.

    Did this help you out with your use case scenario?

    Cheers,
    Alex
     
    Last edited: Aug 25, 2016
  47. jayderyu

    jayderyu

    Joined:
    Dec 28, 2015
    Posts:
    17
    oh man, thank you soooooo much. This is good stuff. I'm really liking doozy. I'm just new and my head hasn't quite wrapped around it yet.
     
  48. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi jayderyou,

    You're most welcome!
    We're are glad that you like DoozyUI and that you enjoy using it. :)

    Cheers,
    Alex
     
    Last edited: Aug 19, 2016
  49. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    Hi there,

    we are using Doozy ui in our game which will be released soon.

    I have a few questions, because we are having problems using simple buttons...

    I have two almost identical buttons in the pause menu (both have the name "PauseMenu" in UIElement settings)
    - Settings Button -> opens the settings menu
    - Continue -> Continues game and closes the pause menu

    When I press the Settings Button -> it works fine and it closes the pause menu and opens the settings menu
    When pressing back button from settings menu (we are not using standard navigation back button), but call ShowUIElement("PauseMenu") and HideUIElement("SettingsMenu") from code.

    SettingsMenu disappears fine, but the Pause Menu appears without the Settings Button visible. Further investigation and debugging brought to light, that if I remove the ScaleOut animation from the Settings Button (Continue Button has the same setup), the button shows up but the interactable flag is still off.

    I changed the DisableButtonForTime function to make it work:

    Code (CSharp):
    1.      
    2.         void DisableButtonForTime()
    3.         {
    4.             if (allowMultipleClicks == false)
    5.             {
    6.                 //StartCoroutine("DiableButtonWithDelay");
    7.                 DisableButtonClicks();
    8.                 DOVirtual.DelayedCall(disableButtonInterval, EnableButtonClicks);
    9.             }
    10.         }
    11.  
    When using the continue button instead, where Hide/Show are also called from code, the pause menu appears fine after pausing the game again.

    I have a workaround now, but there seems to be timing issue when buttons are animated in/out and the interactable flag coroutine code seems to be not working correctly, at least sometimes.


    A second issue we have with buttons is "allowMultipleClicks" does not seem to work properly sometimes. I had to remove the flag from all buttons, because they did not get interactable again. It seems to be a similar issue, but I am not sure.

    Another issue which I want to mention, but I am not sure if it is a problem with doozy UI. Since Unity 5.4. the game freezes in the editor on pressing start button quite often. Sometimes after 2 starts, sometimes after 5 starts. Sometimes a bit more, but we only have this issue with projects having the doozy ui. It could also be another plugin tbh but I just wanted to mention it in case anybody else experienced this problem.
     
    Last edited: Aug 22, 2016
  50. AlexMares

    AlexMares

    Joined:
    Mar 4, 2015
    Posts:
    498
    Hi,

    there seems to be timing issue when buttons are animated in/out and the interactable flag coroutine code seems to be not working correctly, at least sometimes.
    We have already addressed this issue and the fix will be available as of 2.6 version.

    "allowMultipleClicks" does not seem to work properly sometimes. I had to remove the flag from all buttons, because they did not get interactable again. It seems to be a similar issue, but I am not sure.
    This is the same issue as the one you mentioned earlier since they are directly related. If the button is not interactable, it affects this as well. Again, the fix is on the way. :)

    Since Unity 5.4. the game freezes in the editor on pressing start button quite often. Sometimes after 2 starts, sometimes after 5 starts. Sometimes a bit more, but we only have this issue with projects having the doozy ui. It could also be another plugin tbh but I just wanted to mention it in case anybody else experienced this problem.
    We didn't notice any freezes in the editor yet (and we test the asset with a very complex UI setup that is intended to stress the system). Should anyone experience freezes, caused by DoozyUI, please contact us so that we can see what causes them.

    Should you need the UIButton fix right away, please send us an email and we will send you the updated script.

    We are still working on version 2.6 as the calculation system for the moving animations is not up to par with our imposed standards. This update will allow DoozyUI to work with multiple canvases of different types and sizes and also it will be great for VR.

    Cheers,
    Alex