using UnityEngine;
using System.Collections;
using System.IO;
///
/// AssetsBundle路径和配置标记
///
public class AssetConfig_GlobalSetting
{
///
/// 是否为测试端测试模式
/// 测试模式=versiontest.txt
/// 正式版本=version.txt
///
public static bool IsClientTest = true;
public static string AssetBundleSenceEntry = "VersionManager";
///
/// 模型
///
public static string CharacterPath = "Character";
///
/// 图片(icon)
///
public static string TexturePath = "Texture";
///
/// 特效
///
public static string EffectPath = "Effect";
///
/// 全局(脚本)
///
public static string WorldPath = "World";
///
/// UI(prefeb)
///
public static string UIPath = "UI";
///
/// Scene(prefeb)
///
public static string ScenePath = "Scene";
///
/// version.txt 格式内容是:
/// Cube.assetbundle,1.0.6
/// Main.unity3d,1.0.6
/// 前面为资源名,后面为该资源的版本号
///
public static readonly string strVersionFileName = "VersionMD5.txt";
///
/// 获得资源路径
/// 使用【WWW】读取
///
public static string strLocalReadUrl
{
get
{
string persistentDataPath = Application.persistentDataPath + "/";
if (Application.isEditor)
{
return "file://" + Application.streamingAssetsPath + "/Res/";
}
return "jar:file://" + Application.dataPath + "!/assets/Res/";
}
}
///
/// 获得资源路径
/// 使用【WWW】读取
///
public static string strLocalReadPath
{
get
{
if (Application.isEditor)
{
return Application.streamingAssetsPath + "/Res/";
}
return Application.dataPath + "!/assets/Res/";
}
}
///
/// 客户端可读写目标路径
///
public static string strLocalSaveUrl
{
get { return "file://" + Application.persistentDataPath + "/Res/"; }
}
///
/// 客户端可读写目标路径
///
public static string strLocalSavePath
{
//////////这里改过,测试用。
get
{
//if (Application.isEditor)
//{
// return Application.dataPath + "/StreamingAssets/Res/";
//}
return Application.persistentDataPath + "/Res/";
}
}
///
/// 服务器地址
///
public static string strServerUrl
{
// get { return "http://192.168.10.56:8089/bundle/"; }
// get { return "http://115.159.121.129/SweepAllTower/CDN/"; } ///外网ip
get
{
if (GlobalConfig.netType == eNetType.Online || GlobalConfig.netType == eNetType.TestOnline)
{
return "http://115.159.121.129/SweepAllTower/CDN/"; // 外网
}
else
{
return "http://192.168.10.16/SweepAllTower/CDN/yanling/";///内网
}
}
}
public static string ConvertToAssetBundleName(string name)
{
return name + ".unity3d";
}
public static string ConverToStreamPath(string assetBundleName)
{
if (Application.isEditor)
{
return Application.dataPath + "/StreamingAssets/Res/" + assetBundleName; ;
}
return Application.persistentDataPath + "/Res/" + assetBundleName;
}
}