Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Transition to submenu from UI Button

Discussion in 'UGUI & TextMesh Pro' started by chrispduck, Sep 3, 2014.

  1. chrispduck

    chrispduck

    Joined:
    May 5, 2014
    Posts:
    4
    Hi I am building a menu system using the new UI and I'm trying to find documentation on how I would transition from my main menu which is a canvas with UI buttons to a submenu for example a settings menu? It mentions in the documentation that a UI button (on click) event can be used for this but I can't work out how. Can anyone point me in the right direction?
    many thanks
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,033
    Set the GameObject of the second menu disabled. Add an OnClick() trigger that calls SetEnabled(true) on the second menu. Add another trigger that calls SetEnabled(false) on the first menu. No need for code, just select methods and variables from the OnClick() section of the Button.
     
    fabian_rensch and chrispduck like this.
  3. chrispduck

    chrispduck

    Joined:
    May 5, 2014
    Posts:
    4
    Excellent.. works a treat..as simple as that.. thanks very much :)
     
    Last edited: Sep 4, 2014