Forum rules - please read before posting.

Unity UI in scene disabled by AC on scene switch

As mentioned in the 1.73 update thread, I'm experiencing some difficulty with Unity UI in scene menus since updating my project.

The menu, that was previously experiencing the bug fixed in 1.73 where Unity UI in Scene was receiving two clicks per interaction, is now being disabled (it seems by AC) when the scene loads.

The menu, which has an appear type of Manual, behaves as expected when the scene it resides in is run directly from play mode. However, when the menu is loaded by AC from the game's title screen via a Scene: Switch action, the menu game object is disabled, and the menu does not appear. It can be enabled in the inspector and then works as usual.

There are a couple of other strange behaviours with the UI in this scene - in case they are related, I'll post them here:

  • A Unity UI in Scene Toggle (one of many) that is part of the menu above seems to be automatically clicked when the scene starts: It is selected by default, but since the update, the onclick-run-actionlist now plays as soon as the scene starts.

  • There are two other toggles in this scene, also part of the menu, that are used to open submenus; these submenus are seperate AC menus, with appear type of Manual, and they also have multiple toggles inside them, that change global variables and animation parameters. These no longer work at all since the update, neither the animation params or the global variables change. AC has constant IDs for the toggles and the menu.

  • All of my Unity UI in Scene menus, including all the ones in this scene and another (my title screen) all generate the following warning in the console:
    "The menu [my menu names] has its Source set UnityUIinScene, but no linked Canvas can be found!"
    These menus all have canvases and rect transforms linked to AC with constantIDs. This happened both before and after the update to 1.73, so may well be unrelated to any of this...

All of the other UI elements (30 odd toggles, mostly changing global variables and animation parameters) work fine, and seem to be receiving one click now!

Turning the menu on via the scene's onStart cutscene does seem to work; it also stops the first of the two problems above. The second one is still in effect though.

I've PM'd you some screens of my inspector and menu manager.

As always, thanks for all your help!

Comments

  • In the Menu.cs script file, look for the AfterSceneChange function around line 2210. Replace the code block:

    if (menuSource == MenuSource.UnityUiInScene)
    {
        LoadUnityUI ();
        Initalise ();
    }
    

    with:

    if (menuSource == MenuSource.UnityUiInScene)
    {
        LoadUnityUI ();
        Initalise ();
        EnableOnStart ();
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.