예제 #1
0
    static void AddBuildMap(string bundleName, List <string> pattern, string path)
    {
        // string[] files = Directory.GetFiles(path, pattern);

        ArrayList ArraryFiles = ResDefine.GetResourceFiles(path, pattern);

        if (ArraryFiles.Count == 0)
        {
            return;
        }
        string[] files = new string[ArraryFiles.Count];
        ArraryFiles.CopyTo(files);
        for (int i = 0; i < files.Length; i++)
        {
            files[i] = files[i].Replace('\\', '/');
        }
        AssetBundleBuild build = new AssetBundleBuild();

        build.assetBundleName = bundleName;
        build.assetNames      = files;
        maps.Add(build);
    }
예제 #2
0
    void FillContents()
    {
        int index = 0;
        SortedList <int, MapResProperty> Lists = MapDataProccess.instance.ResList;
        IList <int> ilistValues = MapDataProccess.instance.ResList.Keys;

        for (int i = ilistValues.Count - 1; i > -1; --i)
        {
            MapResProperty resProp = Lists[ilistValues[i]];
            if (resProp.GetEid() == currentProp.GetEid())
            {
                continue;                                           //排除自身
            }
            index = GetIdFormType(resProp.GetResType());
            AddResToolItem(resProp, index);
        }
        string        path     = ResDefine.GetResPath(EResType.eResScene);
        List <string> kExtList = new List <string>();

        ResDefine.GetResTypeFileExtList(EResType.eResScene, ref kExtList);
        DirectoryInfo dir = new DirectoryInfo(path);

        string[] dirs = Directory.GetDirectories(path, "*", SearchOption.AllDirectories);
        index = 10101;
        for (int k = 0; k < dirs.Length; k++)
        {
            ArrayList ArraryFiles = ResDefine.GetResourceFiles(dirs[k].ToString(), kExtList);
            string[]  files       = new string[ArraryFiles.Count];
            ArraryFiles.CopyTo(files);
            for (int i = 0; i < files.Length; i++)
            {
                FileInfo       fi      = new FileInfo(files[i]);
                MapResProperty resProp = new MapResProperty();
                resProp.SetName(fi.Name.Replace(".unity", ""));
                resProp.SetEid(index++);
                AddResToolItem(resProp, 4);
            }
        }
    }