Example #1
0
        /// <summary>
        /// 根据方式获取对应的路径
        /// </summary>
        /// <param name="assetPath">相对路径</param>
        /// <param name="type">加载方式</param>
        /// <returns></returns>
        public static string GetSpecialPath(string assetPath, SpecialPathType type)
        {
            string path = assetPath;

            switch (type)
            {
            case SpecialPathType.Resources:
//#if !UNITY
//                    path= Environment.CurrentDirectory + "/Resources/"+path;
//                    break;
//#else
                path = Application.dataPath + "/Resources/" + path;
                break;

            case SpecialPathType.Persistent:
                path = Application.persistentDataPath + "/" + path;
                break;

            case SpecialPathType.StreamingAssets:
                path = Application.streamingAssetsPath + "/" + path;
                break;
//#endif
            }
            return(path);
        }
Example #2
0
        /// <summary>
        /// 根据方式获取对应的路径
        /// </summary>
        /// <param name="assetPath">相对路径</param>
        /// <param name="type">加载方式</param>
        /// <returns></returns>
        public static string GetSpecialPath(string assetPath, SpecialPathType type)
        {
            string path = assetPath;

            switch (type)
            {
            case SpecialPathType.Resources:
                path = Application.dataPath + "/Resources/" + path;
                break;

            case SpecialPathType.Persistent:
                path = Application.persistentDataPath + "/" + path;
                break;

            case SpecialPathType.StreamingAssets:
                path = Application.streamingAssetsPath + "/" + path;
                break;
            }
            return(path);
        }