Forum rules - please read before posting.

Change scene with Unity UI in Scene

edited March 2015 in Technical Q&A
Hello!
I'm trying to change from a scene to another and back using the Unity UI. 
I created a new Game using the Adventure Creator Wizard choosing Unity UI for menus.
I am working on a clean 2D project with Adventure Creator v 1.42c just imported in Unity 5 (platform iOS).

I am using the first scene as Loading Screen. 
I selected "Use loading screen" : Number : 0 in AC Settings Manager and the scene is #0 in Unity Build Settings.
There's nothing in the scene except a Unity UI with 5 buttons (grouped inside a GameObject with the GridLayoutGroup script). 
In AC Menu Settings I created a Menu called Home and put it as first among Menus. 
In menu 'Home' properties I set the source as Unity UI in Scene, linked the Canvas in the Hierarchy to Linked Canvas and RectTransform boundary. 
The rest is unchecked, Appear type and Position type are set to manual. 
In menu 'Home' elements I created the 5 buttons.
The first button is linked to the first button inside the canvas.
The button runs an ActionList on click. 
I created the GoToUserMenu ActionList and set the only action to "Engine: Change Scene" : Number : 1.

I created another scene (#1 in Unity Build Settings) that should be used to collect User personal informations. I am using a scene and not a simple menu because I have a complex UI with interactions like uploading a picture of the user. 
I added a Unity UI button in a Canvas to test going back to Home scene.
In AC Menu Settings I created a Menu "User" and set it as second after Home (is position influent?).
I set the properties like I did with the Home Menu and added a Home Button, to change back to the first scene.
The button has assigned an ActionList with the action Engine: Change Scene" set to Number 0.

This should be enough to test. 
I open the first scene (#0 in BS) and hit RUN.
The UI is visible, but when I click on the first button, nothing happens.

What am I missing?

If I open the second scene (#1 in BS) and hit RUN I can see the (default?) Pause Button (bottom-left) and Inventory bar (top-center) but not the "Home" button I added.

How do I disable the Pause Menu just for this scene, and show the in Scene UI?

Sorry for the long post, hope I was clear
BTW, Thank you for this wonderful asset!

Comments

  • The "Loading scene" option allows you to have a loading screen / effect when you transition between complex scenes that take a few seconds to load.  It shouldn't contain any logic / menus, and also shouldn't be the first scene in your Build Settings - otherwise it'll load but AC won't know where to go from there.

    Uncheck the "Loading scene" checkbox and re-try it.
  • edited March 2015
    I'm following this tutorial: http://www.adventurecreator.org/tutorials/creating-title-screen-menu

    I tried unchecking the "Loading scene"

    This is what I have right now:
    image


    The scene settings:
    image


    The onStart Cutscene:
    image


    When I click on the "USER" button the USER scene loads, but I have menu and inventory bar again, but no Unity UI menu, even if it is present in hierarchy:
    image


    This is the actionList that loads the USER scene:
    image


    And here are the two menus: HOME
    image


    this is the USER menu when I'm starting from scene #0 (the HOME scene, notice there's no linked canvas or button):
    image


    and this is the same USER menu when I am starting from scene #1 (the USER scene):
    image

    The canvas and button linking isn't the same from scene to scene. Is this normal?

    BTW how to disable the Pause and Inventory Menus?

  • To disable the Pause and Inventory menus (and the InGame one, too), you have to "Lock" them using the Menu: Change state Action, not "Turn Off".  Menus will always abide by their "Appear type" property, so if they're turned off, but the rule is to have them on (e.g. During Gameplay), they'll re-appear unless they've been locked.  When you're ready for them to come back, unlock them.

    Your User menu won't appear in the new scene because it's local to that scene (as set by "Unity Ui In Scene").  Instead, you want to reference a UI prefab.  Make a prefab out of the UI, change to "Unity Ui Prefab" in the Menu properties, and then reference the prefab instance of the Canvas / RectTransform / Buttons.

    This tutorial covers the process of a prefab-based UI menu.
  • Now It's all clear. I got it working! Thank you for your patience, and keep up the good work!
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.