using UnityEngine;
using System.Collections;
using System.Text;
namespace Engine.CLoader
{
/// 资源类型
public enum AssetsType
{
/// 配置文件资源
Config = 0,
/// 正常的游戏资源
Assets,
/// 场景资源
Scene,
/// UI资源
UI,
}
public class CLoaderConst
{
/// AssetsBundle资源路径
#if UNITY_EDITOR
public static readonly string AssetsBundleURL = "file://" + Application.dataPath + "/StreamingAssets/";
#elif UNITY_ANDROID
public static readonly string AssetsBundleURL = "jar:file://" + Application.dataPath + "!/assets/";
#elif UNITY_IPHONE
public static readonly string AssetsBundleURL = Application.dataPath + "/Raw/";
#elif UNITY_STANDALONE_WIN || UNITY_EDITOR
public static readonly string AssetsBundleURL = "file://" + Application.dataPath + "/StreamingAssets/";
#else
public static readonly string AssetsBundleURL = "file://" + Application.dataPath + "/StreamingAssets/";
#endif
/// 下载对象的最大个数
public static int CLoaderMaxCount = 5;
/// 资源文件后缀名
public const string AB_POSTFIX = ".assetbundle";
/// 数据资源后缀名
public const string DATA_POSTFIX = ".bytes";
/// 预制件资源后缀名
public const string PREFAB_POSTFIX = ".prefab";
/// 音效后缀
public const string MP3_POSTFIX = ".mp3";
/// 添加一个后缀
public static string AddPostfix(string source, string postfix)
{
if (string.IsNullOrEmpty (source)) {
return string.Empty;
}
if (source.IndexOf (postfix) == -1) {
StringBuilder strBuilder = new StringBuilder ();
strBuilder.Append (source);
strBuilder.Append (postfix);
return strBuilder.ToString ();
} else {
return source;
}
}
}
}