Beispiel #1
0
    public static void EachAllFile(System.Action <string> fun)
    {
#if UNITY_EDITOR || UNITY_IPHONE || UNITY_STANDALONE_WIN
#elif UNITY_ANDROID // 安卓平台的,数据存储在obb包当中
        Init();
        ApkFile.EachAllFile(
            (string file) =>
        {
            fun(file);
        });
#endif
    }
    public static void EachAllFile(System.Action <string> fun)
    {
#if UNITY_EDITOR || UNITY_IPHONE || UNITY_STANDALONE
        string            fullfile = ResourcesPath.streamingAssetsPath;
        FileSystemScanner scanner  = new FileSystemScanner("", "");
        scanner.ProcessFile =
            (object sender, ScanEventArgs e) =>
        {
            fun(e.Name.Substring(fullfile.Length).Replace('\\', '/'));
        };

        scanner.Scan(fullfile, true);
#elif UNITY_ANDROID // 安卓平台的,数据存储在apk包当中
        Init();
        ApkFile.EachAllFile(
            (string file) =>
        {
            if (file.StartsWith("assets/"))
            {
                fun(file.Substring(7));
            }
        });
#endif
    }