



























第一次用控制面板来写Onclick,看的晕乎乎的


Main Menu(Script)的全部代码
using UnityEngine; using UnityEngine.SceneManagement; using System.Collections; public class MainMenu : MonoBehaviour { public void OnLevelLoadButton(Level level) { Debug.Log("方法被调用了!level = " + level); LevelToLoad.level = level; StartCoroutine(LoadScene()); } private IEnumerator LoadScene() { AsyncOperation asyncLoadLevel = SceneManager.LoadSceneAsync("TripleMatchCanoe", LoadSceneMode.Single); while (!asyncLoadLevel.isDone) yield return null; yield return new WaitForEndOfFrame(); } }

纯属个人理解,如果有错,希望指正。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。