示例#1
0
        private void Init()
        {
            _asset       = new AssetInfo(Application.dataPath, "Assets", true);
            _validAssets = new List <AssetInfo>();
            AssetBundleTool.ReadAssetsInChildren(_asset, _validAssets);

            _assetBundle = new AssetBundleInfo();
            AssetBundleTool.ReadAssetBundleConfig(_assetBundle, _validAssets);

            _buildPath = AssetBundleTool.EditorConfigInfo.BuildPath;
            List <int> buildTargets = AssetBundleTool.EditorConfigInfo.BuildTargets;

            string[] buildTargtNames = Enum.GetNames(typeof(BuildTarget));
            for (int i = 0; i < buildTargtNames.Length; i++)
            {
                BuildTarget target = (BuildTarget)Enum.Parse(typeof(BuildTarget), (buildTargtNames[i]));
                _buildTargets.Add(buildTargtNames[i], buildTargets.Contains((int)target));
            }
            //z = (BuildTarget) AssetBundleTool.EditorConfigInfo.BuildTarget;
            _zipMode      = (ZipMode)AssetBundleTool.EditorConfigInfo.ZipMode;
            _encryptMode  = (EncryptMode)AssetBundleTool.EditorConfigInfo.EncryptMode;
            _assetVersion = AssetBundleTool.EditorConfigInfo.AssetVersion;

            Resources.UnloadUnusedAssets();
        }
示例#2
0
        public void CompressFile(ZipMode zipMode)
        {
            using (ZipService zipService = new ZipService())
            {
                if (zipMode == ZipMode.zip)
                {
                    compressedStdfPath = stdfPath + ".zip";
                    zipService.CompressFile(stdfPath, compressedStdfPath, "zip");

                    compressedMTcsvPath = mtcsvPath + ".zip";
                    zipService.CompressFile(mtcsvPath, compressedMTcsvPath, "zip");
                }
                else if (zipMode == ZipMode.gz)
                {
                    compressedStdfPath = stdfPath + ".gz";
                    zipService.CompressFile(stdfPath, compressedStdfPath, "gzip");

                    compressedMTcsvPath = mtcsvPath + ".gz";
                    zipService.CompressFile(mtcsvPath, compressedMTcsvPath, "gzip");
                }
                else if (zipMode == ZipMode.tgz)
                {
                    string tarPath = stdfPath + ".tar";
                    zipService.CompressFile(stdfPath, tarPath, "tar");
                    compressedStdfPath = tarPath + ".gz";
                    zipService.CompressFile(tarPath, compressedStdfPath, "gzip");

                    tarPath = mtcsvPath + ".tar";
                    zipService.CompressFile(mtcsvPath, tarPath, "tar");
                    compressedMTcsvPath = tarPath + ".gz";
                    zipService.CompressFile(tarPath, compressedMTcsvPath, "gzip");
                }
            }
        }
示例#3
0
        private void SettingGUI()
        {
            if (_showSetting)
            {
                GUI.BeginGroup(new Rect((int)position.width / 2 - 125, (int)position.height / 2 - 65, 250, 130), "", _flownode0on);

                GUI.Label(new Rect(5, 5, 80, 20), "Build Target: ");
                BuildTarget buildTarget = (BuildTarget)EditorGUI.EnumPopup(new Rect(90, 5, 155, 20), _buildTarget, _preDropDown);
                if (buildTarget != _buildTarget)
                {
                    _buildTarget = buildTarget;
                    AssetBundleTool.EditorConfigInfo.BuildTarget = (int)_buildTarget;
                    AssetBundleTool.SaveEditorConfigInfo();
                }

                GUI.Label(new Rect(5, 30, 80, 20), "Zip Mode: ");
                ZipMode zipMode = (ZipMode)EditorGUI.EnumPopup(new Rect(90, 30, 155, 20), _zipMode, _preDropDown);
                if (zipMode != _zipMode)
                {
                    _zipMode = zipMode;
                    AssetBundleTool.EditorConfigInfo.ZipMode = (int)_zipMode;
                    AssetBundleTool.SaveEditorConfigInfo();
                }

                GUI.Label(new Rect(5, 55, 80, 20), "Encrypt: ");
                EncryptMode encryptMode = (EncryptMode)EditorGUI.EnumPopup(new Rect(90, 55, 155, 20), _encryptMode, _preDropDown);
                if (encryptMode != _encryptMode)
                {
                    _encryptMode = encryptMode;
                    AssetBundleTool.EditorConfigInfo.EncryptMode = (int)encryptMode;
                    AssetBundleTool.SaveEditorConfigInfo();
                }

                GUI.Label(new Rect(5, 80, 150, 20), "Asset Version: " + _assetVersion);
                if (GUI.Button(new Rect(150, 80, 95, 20), "Reset", _preButton))
                {
                    _assetVersion = 1;
                    AssetBundleTool.EditorConfigInfo.AssetVersion = _assetVersion;
                    AssetBundleTool.SaveEditorConfigInfo();
                }

                if (GUI.Button(new Rect(100, 105, 50, 20), "Sure", _preButton))
                {
                    _showSetting = false;
                }

                GUI.EndGroup();
            }
        }
示例#4
0
        private void Init()
        {
            _asset       = new AssetInfo(Application.dataPath, "Assets", true);
            _validAssets = new List <AssetInfo>();
            AssetBundleTool.ReadAssetsInChildren(_asset, _validAssets);

            _assetBundle = new AssetBundleInfo();
            AssetBundleTool.ReadAssetBundleConfig(_assetBundle, _validAssets);

            _buildPath    = AssetBundleTool.EditorConfigInfo.BuildPath;
            _buildTarget  = (BuildTarget)AssetBundleTool.EditorConfigInfo.BuildTarget;
            _zipMode      = (ZipMode)AssetBundleTool.EditorConfigInfo.ZipMode;
            _encryptMode  = (EncryptMode)AssetBundleTool.EditorConfigInfo.EncryptMode;
            _assetVersion = AssetBundleTool.EditorConfigInfo.AssetVersion;

            Resources.UnloadUnusedAssets();
        }
示例#5
0
 public bool Open(ZipMode mode)
 {
     return(CPP.ReturnBool("$q->open((QuaZip::Mode)mode)"));
 }
示例#6
0
        private void SettingGUI()
        {
            if (_showSetting)
            {
                int width = 325, height = 290;

                GUI.BeginGroup(new Rect((int)position.width / 2 - width / 2, (int)position.height / 2 - height / 2, width, height), "", _flownode0on);
                //-----------Build Target
                GUI.Label(new Rect(5, 5, 100, 20), "Build Target:", "HeaderLabel");
                GUI.BeginGroup(new Rect(5, 25, 315, 135), _box);
                // string[] buildTargets = Enum.GetNames(typeof(BuildTarget));
                _buildTargetScrollView = GUI.BeginScrollView(new Rect(0, 2, 313, 132), _buildTargetScrollView,
                                                             new Rect(0, 0, 180, 20 * _buildTargets.Count), false, true);
                int index = 0;
                foreach (var item in _buildTargets)
                {
                    bool value = GUI.Toggle(new Rect(5, 20 * index, 180, 20), item.Value, item.Key);
                    if (value != item.Value)
                    {
                        _buildTargets[item.Key] = value;
                        break;
                    }
                    index++;
                }
                GUI.EndScrollView();
                GUI.EndGroup();
                //--------Zip Mode
                GUI.Label(new Rect(5, 165, 60, 20), "Zip Mode:", "HeaderLabel");
                ZipMode zipMode = (ZipMode)EditorGUI.EnumPopup(new Rect(75, 165, 240, 20), _zipMode, _preDropDown);
                if (zipMode != _zipMode)
                {
                    _zipMode = zipMode;
                    AssetBundleTool.EditorConfigInfo.ZipMode = (int)_zipMode;
                    AssetBundleTool.SaveEditorConfigInfo();
                }
                //----------Encrypt
                GUI.Label(new Rect(5, 190, 60, 20), "Encrypt: ", "HeaderLabel");
                EncryptMode encryptMode = (EncryptMode)EditorGUI.EnumPopup(new Rect(75, 190, 240, 20), _encryptMode, _preDropDown);
                if (encryptMode != _encryptMode)
                {
                    _encryptMode = encryptMode;
                    AssetBundleTool.EditorConfigInfo.EncryptMode = (int)encryptMode;
                    AssetBundleTool.SaveEditorConfigInfo();
                }
                // ----------Assets Version
                GUI.Label(new Rect(5, 215, 150, 20), "Asset Version: " + _assetVersion, "HeaderLabel");
                if (GUI.Button(new Rect(160, 215, 95, 20), "Reset", _preButton))
                {
                    _assetVersion = 1;
                    AssetBundleTool.EditorConfigInfo.AssetVersion = _assetVersion;
                    AssetBundleTool.SaveEditorConfigInfo();
                }
                //sure cancel
                if (GUI.Button(new Rect(92.5f, 255, 140, 20), "Sure", _preButton))
                {
                    //更新目标平台
                    foreach (var item in _buildTargets)
                    {
                        BuildTarget target  = (BuildTarget)Enum.Parse(typeof(BuildTarget), (item.Key));
                        int         iTarget = (int)target;
                        if (item.Value)
                        {
                            if (!AssetBundleTool.EditorConfigInfo.BuildTargets.Contains(iTarget))
                            {
                                AssetBundleTool.EditorConfigInfo.BuildTargets.Add(iTarget);
                            }
                        }
                        else
                        {
                            if (AssetBundleTool.EditorConfigInfo.BuildTargets.Contains(iTarget))
                            {
                                AssetBundleTool.EditorConfigInfo.BuildTargets.Remove(iTarget);
                            }
                        }
                    }
                    //保存配置文件
                    AssetBundleTool.SaveEditorConfigInfo();

                    _showSetting = false;
                }
                //if (GUI.Button(new Rect(175, 255, 140, 20), "Cancel", _preButton))
                //{
                //    _showSetting = false;
                //}
                GUI.EndGroup();
            }
        }