Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Canvas Flow - UI Presentation & Storyboarding

Discussion in 'Assets and Asset Store' started by Pelican_7, May 26, 2018.

  1. AndreasO

    AndreasO

    Joined:
    Sep 25, 2012
    Posts:
    90
    Do you happen to have a Discord channel where we could discuss things a bit easier and more direct?
     
  2. AndreasO

    AndreasO

    Joined:
    Sep 25, 2012
    Posts:
    90
    Alright. It seems to work in my test project including the fade in/out transition animations. There must be something wrong in my other project.

    Anyway, maybe this is interesting for others to try out as well so I am posting my project code here. Of course it does not contain the CanvasFlow asset so you still need to get your own copy of it. ;-)

    I've made a short video that demonstrates the test project. What you see there is cycling through three test scenes that use a loading screen to swap out scenes. I made the loading screen interactive so I can decide what and when should happen next instead of having it all run in an automatic sequence.

    https://www.dropbox.com/s/4cv9qep6099p7xc/CF-TestProject.mp4?dl=0

    Here's the test project as a
    .unitypackage
    :
    https://www.dropbox.com/s/l2o508bj8q1jl0z/CF-TestProject.unitypackage?dl=0

    Here is the structure of my test project:

    ProjectStructure.png

    As you can see there are three Storyboard Scenes (
    OneScene
    ,
    TwoScene
    ,
    ThreeScene
    ). The
    MainScene
    is just there as a single point of entry to the test project (where all starts) and it basically just loads
    OneScene
    .

    Here are three storyboards that are 100% set up in the same way. Each uses a FadeToBlack transition animator for the transition that can be triggered by clicking the button in the center.

    Storyboards.png

    So the most interesting part is the
    LoadingCanvasController
    , I guess.

    In the Loading Scene you will see several buttons. Some are nudged a bit to the right which means they are optional. The flow of buttons to be clicked is top to bottom. I marked the first buttons that should be used just to cycle through the three scenes without doing anything special beyond scene swapping and triggering the fade in/out animation.

    LoadingScreen.png

    Then there is an
    ExtraScene
    that can optionally be loaded/unloaded at certain points in time. I stated in one of my earlier posts that there is an error that occurs on CanvasFlows side but it doesn't seem to happen in this test project so it must be something else specific to my own other project.

    Let me know if something is unclear about this. ;-)
     
  3. AndreasO

    AndreasO

    Joined:
    Sep 25, 2012
    Posts:
    90
    Aha! My further tests indicate that there must be a bug in CanvasFlow when using manual transition triggers.

    I've extended my test project by adding "autoplay" to it. It will trigger manual transitions after a short delay.
    It is all configurable in the
    Main.cs
    file.

    Flip the variable
    autoplay_load_extra_scene_before_next_storyboard
    and you will see the error I described earlier. It seems to only happen when using manual triggers.

    Here's the code package:
    https://www.dropbox.com/s/nonhx06nih15mwz/CF-TestProject_v2.unitypackage?dl=0

    error.png

    Stack Traces:
    Code (CSharp):
    1. [Error] Could not find storyboardable in node: UIStoryboardNode - TwoCanvasController (P7.CanvasFlow.StoryboardNode)
    2. P7.CanvasFlow.<>c__DisplayClass37_0.<LoadNodeAndEmbeddedNodes>b__0()
    3.  
    4. P7.CanvasFlow.<LoadSceneRoutine>d__8.MoveNext()
    5.  
    6. SetupCoroutine.InvokeMoveNext()
    7.  
    Code (CSharp):
    1. [Error] Could not find storyboardable in node: UIStoryboardNode - TwoCanvasController (P7.CanvasFlow.StoryboardNode)
    2. P7.CanvasFlow.<>c__DisplayClass37_0.<LoadNodeAndEmbeddedNodes>b__1()
    3.  
    4. P7.CanvasFlow.<LoadSceneRoutine>d__8.MoveNext()
    5.  
    Code (CSharp):
    1. [Exception] NullReferenceException: Object reference not set to an instance of an object
    2. StoryboardDownstreamEdge+<>c__DisplayClass6_0.<PerformStoryboardTransitionFromNodeAndEmbedInContainer>b__1()
    3.  
    4. StoryboardNode+<>c__DisplayClass36_0.<Load>b__0()
    5.  
    6. StoryboardNode+<>c__DisplayClass37_0.<LoadNodeAndEmbeddedNodes>b__1()
    7.  
    8. SceneLoader+<LoadSceneRoutine>d__8.MoveNext()
    9.  
    10. SetupCoroutine.InvokeMoveNext()    C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17
    11.  
    Code (CSharp):
    1. [Error] Cannot PerformTransitionWithIdentifier 'load'. Canvas controller's 'Storyboard' is null. PerformTransitionWithIdentifier should only be used with canvas controller's that have been loaded from a storyboard.
    2. CanvasController.PerformTransitionWithIdentifier()
    3.  
    4. <CR_Autoplay>c__Iterator0.MoveNext()    Assets/CanvasFlowTest/Canvas Controllers/TwoCanvasController.cs:22
    5.  
    6. SetupCoroutine.InvokeMoveNext()
    7.  
     
  4. AndreasO

    AndreasO

    Joined:
    Sep 25, 2012
    Posts:
    90
    This is my last post for today, I promise. :D

    I've added an example to get notified when a new storyboard will or did appear.

    https://www.dropbox.com/s/icu8dz74k83jzzi/CF-TestProject_v3.unitypackage?dl=0

    You need to hit the "Go Next" button once to kick off the autolay. It cycles through the scenes at maximum speed which is only slowed down by the configured transition animations. (delay variables have been set to zero, see
    Main.cs
    )

    I don't know if there is a more elegant way to support this in CanvasFlow as it will probably be very specific to what you want to do in your application/game. This is at least one way to do it.

    Alright, hopefully I can now continue with my own project after this "little" excursion ... :rolleyes:
     
    Last edited: Dec 8, 2018
    Pelican_7 likes this.
  5. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    @AndreasO Wow, that's awesome. Nice work! Separating out the stages like that makes it really clear what's going on. I also like that you've specified what scene to unload rather than using the active scene. I suppose this could theoretically be a group of scenes too if you're loading multiple scenes.

    The issue that you have found is an interesting one. And I think you've already worked out what's going on. I believe it's caused by loading another scene whilst the storyboard is loading its initial canvas controller's scene - e.g. when your TwoScene has loaded and TwoCanvasController is being loaded.

    To show you exactly what I think is happening, this is the initial (internal) code for loading a canvas controller's scene.
    Code (CSharp):
    1. AsyncOperation loadOperation = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
    2. yield return loadOperation;
    3.  
    4. int lastSceneIndex = SceneManager.sceneCount - 1;
    5. Scene scene = SceneManager.GetSceneAt(lastSceneIndex);
    It is simply getting the number of loaded scenes, and querying for the last one. Why? As far as I'm aware, the SceneManager.LoadSceneAsync method offers no way to retrieve the newly loaded scene directly (e.g. a return type or property on AsyncOperation). Which means we need to turn to the SceneManager to query for loaded scenes. Again, as far as I'm aware, the SceneManager only offers the following ways to retrieve a newly loaded scene:
    • GetActiveScene
    • GetSceneAt
    • GetSceneByBuildIndex
    • GetSceneByName
    • GetSceneByPath
    We cannot query by active scene, as we cannot rely on that (nor do we want to as UI scenes are secondary to main content scenes), nor can we query by build index, name, or path as we could have multiple instances of the same scene loaded (you can load multiple instances of a screen). Which leaves the GetSceneAt method that we are using.

    So, I think to fix this issue in Canvas Flow I'll need to make this method a little smarter by combining the index lookup with a check for the name. It can check to see if the name of the returned scene is what was expected and if not, check the second to last etc.

    In an ideal world there would be a way to just get the loaded scene back from LoadSceneAsync to protect against when multiple scenes are being loaded in the same frame (I really hope I've missed a Unity API call somewhere :D).

    Thanks for your tests on this. Really interesting and cool to see the control you were able to get.
    -andy.
     
  6. nycucumber

    nycucumber

    Joined:
    Feb 16, 2014
    Posts:
    12
    Hi! Not sure if this is the right place to post questions about the asset, instruct me if this is not.

    I am trying to build a logging in and signup flow using CanvasFlow, which includes a LogoScreen, a CreditScreen, a SignUpScreen and then boom you finally land in the main menu screen. I use
    PerformTransitionWithIdentifier
    to do the transition each time. But then I realize after the user landed in the main screen, the scene SplashScreen and SignUpScreen are still present in the hierarchy and not being dismissed but only the content gameobject being set inactive. I tried to use
    DismissCanvasController
    but it only dismiss the top most canvas which is not what I want.

    Is there any way to unload a specific canvas controller manually? Or is that I am using CanvasFlow the wrong way?


    I am showing my story board here so you know what I am talking about...


    Screen Shot 2018-12-28 at 4.32.25 PM.png
     
  7. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @nycucumber.

    In Canvas Flow you use downstream transitions (blue) to present screens and upstream transitions (orange) to dismiss them. Presenting a screen adds it to the current hierarchy and, as you mentioned, will only deactivate previous screens in the hierarchy. This allows you to return to a previous screen using DismissCanvasController or an upstream transition (which does then unload and destroy them).

    I have a similar setup to yours in my game (logo/splash etc. into main menu) and as such I'd recommend either:
    1. Making the MainMenu the entry screen, and having this MainMenu screen present the splash screen flow.
    2. Breaking out the splash screen flow into its own storyboard (SplashLogo -> SplashCredit -> Loading -> NewUser)
    In the first option you can present the SplashScreenLogo screen from the MainMenu in Start (or when you want to show the splash). If you create an upstream transition from your InputNewUserName screen back to the MainMenu then when the user completes this option, the hierarchy will be dismissed back to the main menu. For example, something like this:
    Capture2.PNG

    The second option may be overkill for your scenario, but it is the way I have it set up in my game so thought it might be worth mentioning. The idea is to have an entirely separate storyboard containing only the splash screen flow. You can then present this storyboard in its own splash scene and when appropriate, load your main menu scene, which contains your main menu storyboard. The advantage of breaking it out in this way is that your main menu knows nothing about your splash screen and therefore the splash screen storyboard can be re-used elsewhere (but this may not be relevant in your scenario?).

    Hope that helps. Sure, feel free to ask questions here or via email, whichever you prefer.

    -andy.
     
  8. ibompuis

    ibompuis

    Joined:
    Sep 13, 2012
    Posts:
    100
    Hi,

    After some test and application created with CanvasFlow, I'v problem with button in storyboard: https://screencast.com/t/UhO8qTnOtgsE
    I can't select the button on storyboard to select parameters...

    Scene setup: https://screencast.com/t/lHon6mwhf

    The idea is cool but in fact with many buttons it's a mess to use it and some strange error like screenshot appear sometimes. maybe just create a listbox with buttons ?

    Best,
     
  9. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @ibompuis. Thanks for the detailed feedback.

    Ah yes, I'm considering how to adjust this UI to work better with off-screen buttons and/or large numbers of items/transitions.

    As a temporary workaround – if you move your button into the canvas' rect (on-screen) and save the scene, you should be able to connect it and select it for editing. You can then move it back to its off-screen position when you're done. I appreciate its not ideal. I think like you suggested, I'd like to have all items in a list so you can edit them regardless of their position in the canvas.

    -andy.
     
    ibompuis likes this.
  10. DoPie

    DoPie

    Joined:
    Jun 20, 2013
    Posts:
    64
    I try to make new one but now showing button inside of storyboard Screen Shot 2019-03-29 at 3.28.42 PM.png
     
  11. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @DoPie. Please try updating to Unity 2018 as the minimum supported Unity version is 2018.1.
    -andy.
     
  12. DoPie

    DoPie

    Joined:
    Jun 20, 2013
    Posts:
    64
    Another Question it can be possible to apply this i dynamic buttons like instantiate inside of the List ?
     
  13. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    To trigger a transition from buttons that you have instantiated (i.e. buttons that don't exist at edit time), create a manual transition between the canvas controllers and then use PerformTransitionWithIdentifier() in response to a button click.

    Code (CSharp):
    1. public void OnButtonClicked()
    2. {
    3.     PerformTransitionWithIdentifier("YourManualTransitionIdentifier");
    4. }
     
  14. imevul

    imevul

    Joined:
    May 2, 2015
    Posts:
    1
    Anyone else running into issues when using Canvas Flow with LWRP? When I transition to other screens (controllers), the previous screen goes black instead of actually rendering during the transition.

    (I suspect this has something to do with the transparency sort axis, but that's just a guess.)
     
  15. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @imevul. LWRP doesn't currently support UI Screen-Space cameras. Unity are planning to release support for this in 2019.2. You can follow a discussion of it in this thread with comments from a Unity developer on the LWRP team: https://forum.unity.com/threads/glitching-with-multiple-cameras-lwrp.592477/#post-4099729
     
    imevul likes this.
  16. steven_wong

    steven_wong

    Joined:
    Oct 19, 2016
    Posts:
    5
    Is it possible to change the CanvasController backgroundImage to "Graphic" type? It is because if it is an Image we cannot use RawImage for backgroundImage animation and the animation is just changing the colour property. So I think using "Graphic" as the type for backgroundImage will be a better choice. Thanks.
     
  17. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Thanks for the feedback Steven. This is something I've looked at for the next version (2.0). The canvas controller now only requires the bare minimum of a Canvas and a Rect Transform in its view. Plus one additional component - a Canvas Group - to make setting interactivity and alpha of whole screens much easier. With this you'll be able to use any UI component you wish for the background, which I also much prefer.

    -andy.
     
  18. steven_wong

    steven_wong

    Joined:
    Oct 19, 2016
    Posts:
    5
    Great! When will be version 2.0 ready? I hope it will be here for us very soon.
     
  19. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Hey hey, still loving CanvasFlow.

    Curious what would be the best way to create the behavior of clicking outside a popup window to dismiss the canvascontroller.

    thanks in advance!
     
  20. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Here's my solution to the problem above for anyone interested.

    Code (CSharp):
    1. /// <summary>
    2. /// Allows us to do something when a ui element is the only element clicked (nothing else is above it)
    3. /// </summary>
    4. public class IsolatedClickResponder : MonoBehaviour, IPointerClickHandler
    5. {
    6.     [Tooltip("The function to execute if this and only this element was clicked.")]
    7.     public UnityEvent onClick;
    8.  
    9.     public void OnPointerClick(PointerEventData eventData)
    10.     {
    11.         if (eventData.pointerCurrentRaycast.gameObject == gameObject)
    12.         {
    13.             onClick.Invoke();
    14.         }
    15.     }
    16.  
    17. }
    ---Update ---

    Ah crap, disregard the above. All you have to do to get this behavior is add a Button component to the background component and make sure that your container isn't nested inside it rather that it sets below the Background Image...You live and you learn haha.
     
    Last edited: May 23, 2019
  21. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    I'm noticing some really weird behavior on 2019.1. When i tried to present a CanvasController it seems to lag really bad. before being presented for some reason.
     
  22. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Sorry have another question. Given unity's new nested prefab / prefab workflow, do you see CanvasFlow moving in a prefab oriented workflow rather then a scene oriented workflow?

    Just curious of your thoughts on the advantages of using scenes now that the prefabs can be isolated to there own screens.

    Thanks in advance!
     
  23. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hey @Meatloaf4. Thanks! Ah yes, I was going to suggest using an invisible button in the background - that's the way I did it in Lily. You can also trigger this button from a key press, like ESC.

    So, starting with Unity 2019.1 I'm going to be moving to version 2.0. For 1.x I'd recommend staying on Unity 2018. I'm currently working full-time on this version and aiming for a release later this summer (it's a particularly large-scale update).

    And I'm glad you asked about the prefabs - yes! :) Version 2.0 uses prefabs rather than scenes to house (specifically) the canvas view. I'm finding this to be a massive improvement for these reasons:

    1. Loading happens in the same frame. The Unity scene loading API is limited to always taking at least one frame to complete. Forcing a sychronous scene load also has the effect of forcing other async operations to complete. This becomes complicated when building features such as the nested/container view controllers. Prefabs allows us to instantiate the view in the same frame, making things like loading nested/child controllers simpler.
    2. More lightweight. Scenes contain information we don't need in the UI, such as lighting settings etc.
    3. We don't need to add each canvas controller to the scene build settings.
    4. The new prefab edit window in Unity gives us a way to edit the prefab intuitively (without dragging it into a scene), and maintains the benefits of keeping individual screens isolated, allowing team members to work on different screens concurrently.

    As I mentioned, I'm currently full-time on this so if you have any points you want to highlight, questions you want to ask etc., feel free and I can do my best to consider it for version 2.0.

    -andy.
     
  24. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    That all sounds great to hear! Also that's awesome that your full time on CanvasFlow, the asset is amazing and i'm excited to see what you've come up with.

    After using it for quite some time I think I definitely have a few suggestions that would be great to have implemented. I'll send those along when I get a chance.

    In the meantime I stupidly upgraded to 2019.1 as I thought CanvasFlow supported it, is there any hotfix that you can think of to fix the hanging menu scene load in 2019.1? I understand if not as it is ultimately my fault, but I figured I would ask.

    Thanks in advance!


    Also, another question, do you have a smooth upgrade path planned for the CanvasFlow from version 1.x to 2.x since the menu workflow will be different?
     
    Last edited: May 24, 2019
  25. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    So it looks like the hanging I was experiencing may have just been my computer.

    I do notice that that on the first load of any new menu scene there does seam to be a fraction of a second delay though when no animation is set. I think this largely due to things being loaded in to memory the first time though.
     
  26. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Thanks!

    Regarding the upgrade path, the architecture in version 2.0 is significantly different, and as such there won't be an automatic upgrade path. The reality is that Unity has changed significantly since the inception of Canvas Flow several years ago and, in particular, the new Prefab Workflows along with the new UIElements framework (which is coming soon to runtime) lead me to believe that in order to provide the best and most relevant menu system, I need to adapt to integrate these new technologies.

    Therefore, version 2.0 is going to be a new package with a new name. Existing Canvas Flow users will have the option to upgrade to the new package for a (heavily) discounted upgrade price, rather than paying the full price of the new package.

    Now, in terms of updating existing projects, adopting this strategy has the benefit that the two packages will be able to co-exist within the same project. This means that existing projects that require the features of the new package can be gradually migrated over to the new workflow, one section/flow at a time. I'll be using this strategy to update my existing released projects in areas that require the new features of 2.0. For example, moving over the main-menu UI and associated screens first, then a level UI flow later etc.
     
  27. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    This is really exiting to hear. I completely agree with you about Unity doing things quite different from when canvas flow was released.

    I'm really stoked to hear your adapting along side these trends rather then trying to resist the inevitable.

    As for the additional charge for the upgrade, that's a bit of a bummer but I understand the need to charge for additional work. As long as the money is going toward a better product I don't mind spending it.

    Two additional things. It sounds like your really leaning in to UI elements. Is this correct? If so that's great to hear. I do a lot of web development and I think UI elements is the way to go.

    Secondly the one thing I find pretty frustrating with canvas flow currently is the issue with presenting a canvas while another is transitioning. I would love it if canvas flow took care of this behind the scenes. Utilizing something like a queue behind the scenes so if I try to transition multiple canvas at once it just throws the additional ones on the queue and transitions them in sequence or something.

    I have a bunch of other feedback for you but have been so busy lately it's been hard to list it all. We extend the native canvascontroller and utilize that in all our games in order to bring forward some missing features we wish we had. I'll try and share that as soon as I have a chance.
     
  28. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    That's great, no hurry at all. It'll be interesting to see how you extend the CanvasController. Perhaps one thing worth mentioning - and it's taken me a while to come around to this way of thinking - but I am planning to ship full source code with this release (and no DLLs). This means you'll be able to extend and adapt classes/features much more easily.

    The queue idea is interesting. What is your specific use-case to require this? I ask because I'm wondering if there is only a specific type of screen that requires this. For example, on iOS I believe you can present multiple alerts (UIAlertControllers) and they do something similar to what you describe. So in that scenario it may be best to write a solution for that type of screen specifically.

    My initial concern with making it a default behaviour would be that I think it places the responsibility of checking whether or not a screen can be presented on the developer. For example, consider a simple button callback that calls PresentCanvasController. Currently, if a user were to press that button multiple times in quick succession, Canvas Flow can automatically block subsequent presentation requests. If however, these subsequent calls to Present... were placed on a presentation queue, the multiple presses would cause multiple instances of the screen to be presented one after another. This likely means a developer ends up wrapping all PresentCanvasController calls in a "if can present" statement.

    About UIElements - I see it as the future of Unity UI but at the moment it is only in its infancy. For example, runtime support has been announced but we haven't seen what that looks like yet in any of the alphas/betas. Unity's UI Canvas workflow will likely still be the UI system of choice for many users for a while yet. So, what I've done is to write a generic ViewController core that supports both a UICanvas-based workflow (CanvasController) and a currently experimental UIElements-based workflow (ElementsController). Naturally the UIElements workflow will remain experimental until Unity releases their runtime UIElements support and I can solidify the API.
     
  29. steven_wong

    steven_wong

    Joined:
    Oct 19, 2016
    Posts:
    5
    For version 2.0 will you add the preloading scene feature (asyncOperation.allowSceneActivation = false) ? Since unity load scene async at runtime will take time to load in some mid-grade mobile device. Therefore, we can take control how do preloading specific transition to some scenes and improve the overall UX.

    the flow can be
    1. preload all the scenes that the UI may transit to set the flag asyncOperation.allowSceneActivation = false
    2. when we really want to do transition set the flag back to asyncOperation.allowSceneActivation = true and continue the loading process.
    3. Present the destination scene

    Expected result:
    The additive loaded scene will present instantly no lag or delay.
     
  30. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @steven_wong. Version 2.0 uses prefabs to house screens rather than scenes. This means they load in the same frame as they are instantiated, unlike scene loading which requires an async operation of at least one frame. Preloading of screens therefore won't be supported.
     
  31. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hi @Pelican_7

    I import CanvasFlow into a clean 2019.3 project and get the following:

    Code (CSharp):
    1. Assets\Canvas Flow\Transition Animators\ScaleAndFadeBackgroundTransitionAnimator.cs(177,60): error CS0012: The type 'Image' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
    2.  
    I have the Unity UI package installed.
     
  32. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @PyroStudios. Thanks for letting me know. I believe this is closely related to the issue Unity had in the 2019.1 and 2019.2 betas whereby they renamed the UI dll from UnityEngine.UI to Unity.ugui. As mentioned here by Phil - https://forum.unity.com/threads/ui.673504/#post-4540480 - this should be resolved by Unity in time for 2019.3 release.
     
    GamePowerNetwork likes this.
  33. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Sorry for coming back with more problems, but i'm noticing once again that my canvas controllers are taking an exceedingly long time to load for some reason. I'm on unity 2018.4. Could there be some common reason this is occurring?

    My canvases are all fairly light weight ( a few sprites ). Seems like they take about 3 to 4 seconds every time.
     
  34. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Hi @Meatloaf4. Hmm, I'm running in 2018.4 with no loading issues.

    - Is this happening in builds or is it Editor only?
    - Do you have any other AsyncOperations running (such as network requests) whilst scenes are loading?
    - Does the Profiler give any hint as to what the issue may be? For example, it's possible something like an audio file can block like this if not set to load async.
     
  35. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    This is looking like it's only happening in the editor.

    I am performing a playfab getstoreitems network request in the CanvasWillAppear(). However I tried removing this and the problem persisted.

    I'll go ahead and check the profiler in the meantime.
     
  36. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
  37. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
  38. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    I'm noticing the CanvasWillDisapear callback is not firing when canvases / a canvas disapears as a result of a scene change. Is this standard behavior?
     
  39. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    I believe so, yes. The appearance callbacks will only be called on presentation/dismissal. You could dismiss the canvas (without animation if necessary) before changing scene to get appearance callbacks.
     
  40. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Just a ping to see how v2 is coming along?
     
  41. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    It's ready and should be going live very soon (I hope within the next week or so). In the meantime you can see the new website and trailer here if you're interested – https://uigraph.xyz/.
     
    Jos-Yule likes this.
  42. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Wow, that looks really impressive. I'd buy that today if it was available! Great work!
     
    Pelican_7 likes this.
  43. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Thanks so much @Jos-Yule :)
     
  44. hard_code

    hard_code

    Joined:
    Aug 29, 2013
    Posts:
    238

    Is this a paid upgrade since it's a whole new product then?
     
  45. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Yes, $20 (the difference in price) for existing users. That way Canvas Flow users get the option to upgrade to UI Graph by only paying the difference in price between the two packages.
     
    CodePoKE and hard_code like this.
  46. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    Andy just wanted to say after all this time i took you up on your suggestion and it worked perfectly haha. Thanks so much!

    In my case I decided to just disable the event system as it was the easiest way to get what I wanted.

    Also i'm still using CanvasFlow and it's working amazingly which is a testament to how well it was built to begin with. Can't wait to start using UIGraph! I haven't seen a whole lot of updates on it so I hope your not discontinuing it! I literally can't live without CanvasFlow and i'm sure the same will be true of UIGraph.
     
  47. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    183
    For anyone out there needing a stopgap for CanvasFlow in URP before they upgrade to UIGraph here's how I got CanvasFlow to work with camera stacking.

    Code (CSharp):
    1. /// <summary>
    2. /// Add custom behavior to <see cref="CanvasController"/> including URP camera stacking
    3. /// </summary>
    4. public class URPCanvasController : CanvasController
    5. {
    6.     /// <inheritdoc cref="CanvasController.PresentCanvasController{T}(bool,Action{T},Action{T},Vector3?,bool)"/>
    7.     public new void PresentCanvasController<T>(bool animated = true, Action<T> configuration = null,
    8.         Action<T> completion = null, Vector3? canvasWorldPositionOverride = null, bool loadAsynchronously = true)
    9.         where T : CanvasController {
    10.         Action<T> updatedConfig = (controller) => {
    11.             var cameraData = Camera.main.GetUniversalAdditionalCameraData();
    12.             controller.camera.GetUniversalAdditionalCameraData().renderType = CameraRenderType.Overlay;
    13.             cameraData.cameraStack.Add(controller.camera);
    14.             configuration?.Invoke(controller);
    15.         };
    16.         base.PresentCanvasController(animated, updatedConfig, completion, canvasWorldPositionOverride,
    17.             loadAsynchronously);
    18.     }
    19.  
    20.     /// <inheritdoc cref="CanvasController.PresentInitialCanvasController"/>
    21.     public new static void PresentInitialCanvasController<T>(
    22.         Action<T> configuration = null,
    23.         Action<T> completion = null,
    24.         bool animated = true,
    25.         Vector3? canvasWorldPositionOverride = null,
    26.         bool loadAsynchronously = true,
    27.         CanvasControllerWorldSpaceContainer worldSpaceContainer = null) where T : CanvasController
    28.     {
    29.         Action<T> updatedConfig = (controller) => {
    30.             var cameraData = Camera.main.GetUniversalAdditionalCameraData();
    31.             var camera = controller.camera;
    32.             camera.GetUniversalAdditionalCameraData().renderType = CameraRenderType.Overlay;
    33.             cameraData.cameraStack.Add(camera);
    34.             configuration?.Invoke(controller);
    35.         };
    36.      
    37.         CanvasController.PresentInitialCanvasController<T>(updatedConfig,completion,animated,canvasWorldPositionOverride,loadAsynchronously,worldSpaceContainer);
    38.     }
    39.  
    40.     /// <inheritdoc cref="CanvasController.DismissCanvasController(bool,Action)"/>
    41.     public new void DismissCanvasController(bool animated = true, Action completion = null)
    42.     {
    43.         Action updatedCompletion = () => {
    44.             var cameraData = Camera.main.GetUniversalAdditionalCameraData();
    45.             cameraData.cameraStack.Remove(camera);
    46.             completion?.Invoke();
    47.         };
    48.         base.DismissCanvasController(animated, updatedCompletion);
    49.     }
    50. }
    51.