Beispiel #1
0
    public static void ExportBundlesEx()
    {
        ExportScenesManager.AutoSwitchTarget();
        var dirs = Directory.GetDirectories(ExportScenesManager.GetFolderPath(ExportScenesManager.ExportPath));
        //if (files.Length != 0)
        //{
        var currentVersion = new VersionCodeInfo("0.0.0.1");

        foreach (var item in dirs)
        {
            var fileVersion = new VersionCodeInfo(new DirectoryInfo(item).Name);
            if (fileVersion.Compare(currentVersion) > 0)
            {
                currentVersion = fileVersion;
            }
        }
        //var m_currentVersion = currentVersion.GetLowerVersion();
        var m_newVersion       = currentVersion.ToString();
        var m_newVersionFolder = Path.Combine(ExportScenesManager.GetFolderPath(ExportScenesManager.ExportPath), m_newVersion).Replace("\\", "/");

        var targetPath = m_newVersionFolder + BuildProjectExWizard.ExportFilesPath;

        var selection = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
        var paths     = (from s in selection
                         let path = AssetDatabase.GetAssetPath(s)
                                    where File.Exists(path)
                                    select path).ToArray();

        foreach (string item in paths)
        {
            Debug.Log("ex " + item);
            ExportBundle(new string[] { item }, targetPath);
        }
    }
Beispiel #2
0
    public static void ExportAllBundles()
    {
        ExportScenesManager.AutoSwitchTarget();
        string path     = "Assets/Resources/GUI";
        var    rootPath = ExportScenesManager.GetFolderPath(ExportScenesManager.SubMogoResources);

        fileList.Clear();
        GetSubDir(path);
        var files = fileList.Select(x => x.Replace('\\', '/')).Where(x => x.EndsWith(".prefab")).ToArray();

        ExportScenesManager.LogDebug(files.PackArray('\n'));
        BuildBundleWithRoot(files, rootPath, true);
    }
Beispiel #3
0
    public static void ExportBundles()
    {
        ExportScenesManager.AutoSwitchTarget();
        //ExportScenesManager.CurrentBuildTarget = BuildTarget.StandaloneWindows64;
        var rootPath  = ExportScenesManager.GetFolderPath(ExportScenesManager.SubMogoResources);
        var selection = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
        var paths     = (from s in selection
                         let path = AssetDatabase.GetAssetPath(s)
                                    where File.Exists(path)
                                    select path).ToArray();

        foreach (var item in paths)
        {
            ExportBundle(new string[] { item }, rootPath);
        }
        //var shederPath = ExportScenesManager.GetFolderPath("Shader_PC");
        //ExportScenesManager.DirectoryCopy(shederPath, rootPath, true, true);
        //var path = AssetDatabase.GetAssetPath(Selection.activeObject);
        //if (File.Exists(path))
        //    ExportBundleIfNeeded(path, rootPath);
        //else if (Directory.Exists(path))
        //    ExportDirectoryIfNeeded(path);
    }