Exemple #1
0
        private static void SetShareBundleAndAtlas(string dir)
        {
            dictionary.Clear();
            List <string> paths = EditorResHelper.GetPrefabAndScenes(dir);

            foreach (string path in paths)
            {
                string path1 = path.Replace('\\', '/');
                Object go    = AssetDatabase.LoadAssetAtPath <Object>(path1);

                SetBundle(path1, go.name);

                List <string> pathes = CollectDependencies(path1);
                foreach (string pt in pathes)
                {
                    if (pt == path1)
                    {
                        continue;
                    }

                    if (!dictionary.ContainsKey(pt))
                    {
                        if (GetBundleName(pt) != string.Empty)
                        {
                            continue;
                        }

                        Log.Info($"{path1}----{pt}");
                        BundleInfo bundleInfo = new BundleInfo();
                        bundleInfo.ParentsPaths.Add(path1);
                        dictionary.Add(pt, bundleInfo);

                        SetAtlas(pt, go.name);

                        continue;
                    }

                    BundleInfo info = dictionary[pt];
                    if (info.ParentsPaths.Contains(path1))
                    {
                        continue;
                    }

                    info.ParentsPaths.Add(path1);

                    DirectoryInfo dirInfo = new DirectoryInfo(dir);
                    string        dirName = dirInfo.Name;

                    SetBundleAndAtlas(pt, $"{dirName}-share", true);
                }
            }
        }
Exemple #2
0
        private static void SetNoAtlas(string dir)
        {
            List <string> paths = EditorResHelper.GetPrefabAndScenes(dir);

            foreach (string path in paths)
            {
                List <string> pathes = CollectDependencies(path);

                foreach (string pt in pathes)
                {
                    if (pt == path)
                    {
                        continue;
                    }

                    SetAtlas(pt, string.Empty, true);
                }
            }
        }
Exemple #3
0
        private static void SetIndependentBundleAndAtlas(string dir)
        {
            List <string> paths = EditorResHelper.GetPrefabAndScenes(dir);

            foreach (string path in paths)
            {
                string path1 = path.Replace('\\', '/');
                Object go    = AssetDatabase.LoadAssetAtPath <Object>(path1);

                SetBundle(path1, go.name);

                List <string> pathes = CollectDependencies(path1);

                foreach (string pt in pathes)
                {
                    if (pt == path1)
                    {
                        continue;
                    }

                    SetBundleAndAtlas(pt, go.name, true);
                }
            }
        }