private static IEnumerator _UnloadScene(string scenePath, OnUnloadScene onFinish) { var asynOp = SceneManager.UnloadSceneAsync(scenePath); yield return(asynOp); if (onFinish != null) { onFinish(); } }
public static void UnloadSceneAsync(string sceneName, OnUnloadScene onFinish = null) { string scenePath = ResourceModuleConfig.GameResourcesDir + "/" + sceneName; ResManager.Instance.StartCoroutine(_UnloadScene(scenePath, onFinish)); }