protected static LoadAssetBundle ( string assetBundleName, bool isLoadingAssetBundleManifest = false ) : void | ||
assetBundleName | string | |
isLoadingAssetBundleManifest | bool | |
리턴 | void |
protected static void LoadAssetBundle(string assetBundleName, bool isLoadingAssetBundleManifest = false)
{
Log(LogType.Info, "Loading Asset Bundle " + (isLoadingAssetBundleManifest ? "Manifest: " : ": ") + assetBundleName);
#if UNITY_EDITOR
// If we're in Editor simulation mode, we don't have to really load the assetBundle and its dependencies.
if (SimulateAssetBundleInEditor)
return;
#endif
if (!isLoadingAssetBundleManifest)
{
if (m_AssetBundleManifest == null)
{
Debug.LogError("Please initialize AssetBundleManifest by calling AssetBundleManager.Initialize()");
return;
}
}
// Check if the assetBundle has already been processed.
bool isAlreadyProcessed = LoadAssetBundleInternal(assetBundleName, isLoadingAssetBundleManifest);
// Load dependencies.
if (!isAlreadyProcessed && !isLoadingAssetBundleManifest)
LoadDependencies(assetBundleName);
}
public static AssetBundleLoadOperation LoadLevelAsync(string assetBundleName, string levelName, bool isAdditive) { AssetBundleManager.LoadAssetBundle(assetBundleName, false); AssetBundleLoadOperation assetBundleLoadOperation = new AssetBundleLoadLevelOperation(assetBundleName, levelName, isAdditive); AssetBundleManager.m_InProgressOperations.Add(assetBundleLoadOperation); return assetBundleLoadOperation; }