startGame.cs
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class startGame : MonoBehaviour {
// Use this for initialization
void Start () {
Button btn = transform.GetComponent<Button>();// 获取场景中的按钮
btn.onClick.AddListener(eventListener);// 点击事件触发(回调)
}
// Update is called once per frame
void Update () {
}
void eventListener()
{createNewScene.create.loadScene("createMan");//“createMan”是新场景名称
}
}
// 运行第一个场景,点击按钮,场景产生切换