// _////////////////////////////////////////////////_ _///////////////////////_ _____ Send in Dic _____ GameMsg _____ public void ActionGameStartMsg() { Ag.LogStartWithStr(2, mName + " ActionGameStartMsg Emit ... \t\t\t\t <<< Action :: GameMsg >>>"); SendGameMsg(new NodeGameStartMsg()); SceneLoadComplete.InitSet(false); Ag.LogString(mName + " ActionGameStartMsg Emit ... \t\t\t\t <<< Done >>>"); }
/// <summary> /// 加载场景 /// </summary> /// <param name="name"></param> public void LoadScene(string name, SceneLoadComplete completedelegate, bool additive = false) { //Debug.Log("名字为" + name); SceneData data = SceneConfigManager.Instance.GetSceneData(name); if (data == null && completedelegate != null) { completedelegate(); return; } LoadComplete = completedelegate; BehaviourUtil.StartCoroutine(LoadScene_impl(data, additive)); }
private IEnumerator doLoadUIScene(string sceneName, SceneLoadComplete onCallBack = null, params object[] args) { mLoading.Percent = 0; while (mLoading.Percent < 1) { mLoading.Percent += Time.deltaTime; yield return(new WaitForSeconds(0.05f)); } mLoading.Percent = 1; UIManager.GetInstance().SwitchScene(sceneName, args); mLoading.gameObject.SetActive(false); if (onCallBack != null) { onCallBack(); } }
private IEnumerator doLoadRealScene(string sceneName, SceneLoadComplete onCallBack = null) { async = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName); while (async.progress < 0.9) { mLoading.Percent = async.progress; print(async.progress); yield return(new WaitForSeconds(0.01f)); } if (async.isDone) { mLoading.Percent = 1; if (onCallBack != null) { onCallBack(); } mLoading.gameObject.SetActive(false); } }
/// <summary> /// 跳转UI场景 /// </summary> /// <param name="sceneName"></param> /// <param name="OnCallBack"></param> public void GotoUIScene(string sceneName, SceneLoadComplete OnCallBack = null, params object[] args) { StartCoroutine(doLoadUIScene(sceneName, OnCallBack, args)); mLoading.gameObject.SetActive(true); }
/// <summary> /// 跳转真是场景 /// </summary> /// <param name="sceneName">要设置的场景名称</param> /// <param name="OnCallBack">要跳转场景加载完成后的回调函数</param> public void GotoRealScene(string sceneName, SceneLoadComplete OnCallBack = null) { mLoading.gameObject.SetActive(true); StartCoroutine(doLoadRealScene(sceneName, OnCallBack)); }