Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Load Level

Discussion in 'UGUI & TextMesh Pro' started by tygoo7, Aug 27, 2014.

  1. tygoo7

    tygoo7

    Joined:
    May 6, 2013
    Posts:
    68
    How would I make the new UI buttons load a level when clicked? I can't seem to figure it out.
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Create a script with a method to load the level. The method must be public, have a return type of void, and have valid arguments.

    Attach the script to a GameObject. (Your button is a GameObject...)

    Drag the GameObject into the OnClick section

    Choose the appropriate method.

    And you are done.
     
  3. tygoo7

    tygoo7

    Joined:
    May 6, 2013
    Posts:
    68
    Thank you!