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