/// <summary>
/// 设置开发模式下资源服务器地址,对应“AssetBundleManager/Resources/AssetBundleServerURL”文件配置
/// </summary>
public static void SetDevelopmentAssetBundleServer()
{
#if UNITY_EDITOR
// If we're in Editor simulation mode, we don't have to setup a download URL
// 如果在编辑器模式,且处于模式模式,不设置下载url地址
if (SimulateAssetBundleInEditor)
{
return;
}
#endif
TextAsset urlFile = Resources.Load("AssetBundleServerURL") as TextAsset;
string url = (urlFile != null) ? urlFile.text.Trim() : null;
if (url == null || url.Length == 0)
{
Debug.LogError("Development Server URL could not be found.");
//如果未配置,可以取消以下注释,使用本地url地址
//AssetBundleManager.SetSourceAssetBundleURL("http://localhost:7888/" + UnityHelper.GetPlatformName() + "/");
}
else
{
// 设置源资源URL地址
AssetBundleManager.SetSourceAssetBundleURL(url);
}
}