IEnumerator serverLoadSceneCo(string sceneName, Action customLoadSceneFunc) { ObjectSyncMaster.Instance.SendingEnabled = false; customLoadSceneFunc();//执行自定义读取场景函数 curSceneName = sceneName; FduSyncBaseIDManager.OnLevelLoaded(); yield return(0); FduRpcManager.OnLevelLoaded(); FduActiveSyncManager.OnLevelLoaded(); ObjectSyncMaster.Instance.SendingEnabled = true; }
IEnumerator serverLoadSceneCo(string sceneName) { ObjectSyncMaster.Instance.SendingEnabled = false; //停止发送数据 UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName); //读取场景 curSceneName = sceneName; //更新当前场景名 FduSyncBaseIDManager.OnLevelLoaded(); yield return(0); FduRpcManager.OnLevelLoaded(); FduActiveSyncManager.OnLevelLoaded(); ObjectSyncMaster.Instance.SendingEnabled = true; }