Exemplo n.º 1
0
    /// <summary>
    /// 删除多个文件,传入路径数组,需要回调函数返回删除结果
    /// </summary>
    /// <param name="type"></param>
    /// <param name="path">路径数组</param>
    public static bool DeleteFilesWithPaths(MediaType type, string[] path)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        string pathArr = JsonArray <string> .ConvertToJson(path);

        if (pathArr == null || pathArr == string.Empty)
        {
            return(false);
        }
        string pathJson = "{\"array\":" + pathArr + "}";
        if (pathJson == "{\"array\":[]}")
        {
            return(false);
        }
        LogTool.Log("pathJson = " + pathJson);
        bool isSuccess = Delete((int)type, pathJson, true);
        return(isSuccess);
#else
        return(false);
#endif
    }