Beispiel #1
0
        //[MenuItem("Package/测试/生成场景文件", false, 4)]

        public static void BuildSceneAssetBundle()
        {
            MarkTool.ClearMarkDir("Assets");
            //场景
            string[] scenes = MarkTool.GetSceneConfig();

            //List<string> marks = new List<string>();
            //foreach (var k in scenes)
            //{
            //    marks.AddRange(AssetDatabase.GetDependencies(k));
            //}

            //foreach(var k in marks)
            //{
            //    if(!k.EndsWith(".cs"))
            //        MarkTool.MarkForFile(k, "scenes/" + new FileInfo(k).Name);
            //}

            foreach (var k in scenes)
            {
                if (!k.EndsWith(".cs"))
                {
                    MarkTool.MarkForFile(k, "scenes/" + new FileInfo(k).Name);
                }
            }

            BuildPipeline.BuildAssetBundles("test/", BuildAssetBundleOptions.UncompressedAssetBundle, EditorUserBuildSettings.activeBuildTarget);



            GenMD5();

            //BuildPipeline.BuildStreamedSceneAssetBundle(new string[1] { file }, outname, BuildTarget.Android, BuildOptions.BuildAdditionalStreamedScenes);
        }
Beispiel #2
0
        public static void FitterRecord(List <string> files)
        {
            List <Analysis.Info> results = new List <Analysis.Info>();

            files.Clear();


            foreach (var k in Analysis.fileInfos)
            {
                string lower = k.Value.fileName.ToLower();
                if (k.Value.ext == ".cs" || k.Value.ext == ".mask")
                {
                    continue;
                }
                else if (lower.EndsWith("jpg") || lower.EndsWith("png") || lower.EndsWith("psd"))
                {
                    results.Add(k.Value);
                }
                else if (k.Value.fileName.EndsWith("prefab") || k.Value.fileName.Contains("Resources"))
                {
                    results.Add(k.Value);
                }
                else
                {
                    if (k.Value.usedCount > 1)
                    {
                        results.Add(k.Value);
                    }
                }
            }



            foreach (var k in results)
            {
                files.Add(k.fileName);
            }


            //场景
            string[] scenes = MarkTool.GetSceneConfig();
            files.AddRange(scenes);
        }