unity3d / 按钮 /切换

求问unity3d中如何:实现点击添加的按钮,使一个场景跳转到另一个场景?谢谢啦!

Unity5.3
UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ApplicationnDemo : MonoBehaviour {

// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {

}
void OnGUI()
{

Debug.Log(SceneManager.GetActiveScene().buildIndex +"当前关卡");
Debug.Log(SceneManager.sceneCountInBuildSettings +"游戏加载关卡总数");
//表示游戏关卡总数减一得到最大索引
if (SceneManager.GetActiveScene().buildIndex != SceneManager.sceneCountInBuildSettings -1)
{
    if (GUI.Button(new Rect(0, 45, 60, 40), "下一关"))
    {
        GameObject gamemanger = GameObject.Find("GameObject1");
        DontDestroyOnLoad(gamemanger);
        //获取当前活跃的场景加1
        int index = SceneManager.GetActiveScene().buildIndex + 1;
        SceneManager.LoadScene(index);
    }
}
if (SceneManager.GetActiveScene().buildIndex != 0)
{
    if (GUI.Button(new Rect(0, 90, 60, 40), "上一关"))
    {       SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);
    }
}

}
void OnApplicationQuit()
{
Application.Quit();
}

}