Skip to content

Instantly share code, notes, and snippets.

@adamtuliper
Created April 14, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save adamtuliper/873eb881ec7fbc6273b7 to your computer and use it in GitHub Desktop.
Save adamtuliper/873eb881ec7fbc6273b7 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class ButtonCodeThatsBeenDroppedOntoButton : MonoBehaviour
{
public void IveBeenClicked()
{
//The scene you are loading should be included in the build settings
//Example, note without the .unity on the end of the scene name
Application.LoadLevel("Level1");
}
}
@laszlar
Copy link

laszlar commented Apr 1, 2016

Should add using UnityEngine.SceneManagement; at the top, and now SceneManager.LoadScene("Level1"); Thanks to the update from Unity ;p

@thatguycy
Copy link

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class RestartLvl1 : MonoBehaviour
{
    public void IveBeenClicked()
    {
        //The scene you are loading should be included in the build settings
        //Example, note without the .unity on the end of the scene name
        SceneManager.LoadScene("Level 1");
    }
}

This should work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment