/// <summary> /// 获取沙盒文件夹路径 /// </summary> public static string MakePersistentRootPath() { #if UNITY_EDITOR // 注意:为了方便调试查看,编辑器下把存储目录放到项目里 string projectPath = GetDirectory(UnityEngine.Application.dataPath); return(StringUtility.Format("{0}/Sandbox", projectPath)); #else return(StringUtility.Format("{0}/Sandbox", UnityEngine.Application.persistentDataPath)); #endif }
/// <summary> /// 获取网络资源加载路径 /// </summary> public static string ConvertToWWWPath(string path) { #if UNITY_EDITOR return(StringUtility.Format("file:///{0}", path)); #elif UNITY_IPHONE return(StringUtility.Format("file://{0}", path)); #elif UNITY_ANDROID return(path); #elif UNITY_STANDALONE return(StringUtility.Format("file:///{0}", path)); #elif UNITY_WEBGL return(path); #endif }
/// <summary> /// 获取基于沙盒文件夹的加载路径 /// </summary> public static string MakePersistentLoadPath(string path) { string root = MakePersistentRootPath(); return(StringUtility.Format("{0}/{1}", root, path)); }
/// <summary> /// 获取基于流文件夹的加载路径 /// </summary> public static string MakeStreamingLoadPath(string path) { return(StringUtility.Format("{0}/YooAssets/{1}", UnityEngine.Application.streamingAssetsPath, path)); }