1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using UnityEngine;
- using System.Collections;
- using System.Text;
- namespace Engine.CLoader
- {
- /// <summary>资源类型</summary>
- public enum AssetsType
- {
- /// <summary>配置文件资源</summary>
- Config = 0,
- /// <summary>正常的游戏资源</summary>
- Assets,
- /// <summary>场景资源</summary>
- Scene,
- /// <summary>UI资源</summary>
- UI,
- }
- public class CLoaderConst
- {
- /// <summary>AssetsBundle资源路径</summary>
- #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
-
- /// <summary>下载对象的最大个数</summary>
- public static int CLoaderMaxCount = 5;
- /// <summary>资源文件后缀名</summary>
- public const string AB_POSTFIX = ".assetbundle";
- /// <summary>数据资源后缀名</summary>
- public const string DATA_POSTFIX = ".bytes";
- /// <summary>预制件资源后缀名</summary>
- public const string PREFAB_POSTFIX = ".prefab";
- /// <summary>音效后缀</summary>
- public const string MP3_POSTFIX = ".mp3";
- /// <summary>添加一个后缀</summary>
- 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;
- }
- }
- }
- }
|