string filePath = GetResourcesPath() + @”/CubesJson.txt”;
判断目录是否存在bool state=Directory.Exists(fullPath);
判断文件是否存在bool state = File.Exists(fullPath);
    //不同平台的预编译
    public static string GetResourcesPath()
    {
        if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor)
        {
            return Application.streamingAssetsPath + “/”;
        }
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            //return Application.dataPath + “/Raw/”;
            return Application.persistentDataPath + “/”;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            //return “jar:file://” + Application.dataPath + “!/assets/”;
            return Application.persistentDataPath + “/”;
        }
        return “”;
    }