IEnumerator OnLoadLevelAsync(string assetBundleName, string levelName, bool isAdditive, Action <string, string, object[]> callback, params object[] callbackArgs) { AssetBundleLoadOperation operation = manifestAssetBundleManager.LoadLevelAsync(assetBundleName, levelName, isAdditive); yield return(operation); if (callback != null) { callback(assetBundleName, levelName, callbackArgs); } }
/** 加载场景 */ public AssetBundleLoadOperation LoadLevelAsync(string assetBundleName, string levelName, bool isAdditive) { LogFormat(LogType.Info, "LoadLevelAsync assetBundleName={0}, levelName={1}, isAdditive={2}", assetBundleName, levelName, isAdditive); AssetBundleLoadOperation operation = null; #if UNITY_EDITOR if (AssetManagerSetting.EditorSimulateAssetBundle) { operation = new AssetBundleLoadLevelSimulationOperation(assetBundleName, levelName, isAdditive); } else #endif { assetBundleName = RemapVariantName(assetBundleName); LoadAssetBundle(assetBundleName); operation = new AssetBundleLoadLevelOperation(this, assetBundleName, levelName, isAdditive); m_InProgressOperations.Add(operation); } return(operation); }