Advertisement

Unity 获取不同平台下的文件保存路径

阅读量:

///


/// 获取不同操作系统中文件的存储路径
///

public class GetFilePath
{
///
/// 确定当前文件所处的存储路径
///

///
public static string getPath()
{
string src =
#if UNITY_EDITOR
Application.persistentDataPath;
#elif UNITY_ANDROID
Application.persistentDataPath;
#else
Application.persistentDataPath;
#endif
return src;
}

public static string FilePath = "";//用于存储文件路径的变量

**///


/// 确定不同平台下文件的存储位置信息
///

///
public static string GetPath()
{
if (Application.isMobileP

全部评论 (0)

还没有任何评论哟~