예제 #1
0
        private void doVersion()
        {
            AssetBundle ab = AssetBundle.LoadFromFile(ShineToolGlobal.bundleTempPath + "/" + _targetName + "/" + _targetName);

            _manifest = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest");

            _newVersion = new VersionSaveExData();

            _newVersion.appVersion           = _isNewApp ? _lastTargetVersion.appVersion + 1 : _lastTargetVersion.appVersion;
            _newVersion.leastAppVersion      = _isAppNeedUpdate ? _newVersion.appVersion : _lastTargetVersion.appVersion;
            _newVersion.resourceVersion      = _lastTargetVersion.resourceVersion + 1;
            _newVersion.leastResourceVersion = _isResourceNeedUpdate ? _newVersion.resourceVersion : _lastTargetVersion.leastResourceVersion;

            if (_versionFunc == null)
            {
                _newVersion.version = EditorPrefs.GetString("AssetBundleWindow_version");
            }
            else
            {
                //版本显示
                _newVersion.version = _versionFunc.Invoke(_newVersion.appVersion, _newVersion.leastAppVersion, _newVersion.resourceVersion, _newVersion.leastResourceVersion);
            }

            _newVersion.isRelease = _isReleasePack;

            //bundle部分
            foreach (BundleInfoData v in LoadControl.getBundleInfoDic())
            {
                string name = LoadControl.getResourceNameByID(v.id);

                int type = _signedResourceSaveDic.get(name);

                if (type <= 0)
                {
                    type = _defaultSaveType;
                }

                doBundleSaveOne(name, type);
            }

            //common部分
            SList <string> list = FileUtils.getDeepFileListForIgnore(ShineToolGlobal.sourceCommonPath, _ignoreEx);

            foreach (string fName in list)
            {
                String name = fName.Substring(ShineToolGlobal.sourceCommonPath.Length + 1);

                int type = _signedResourceSaveDic.get(name);

                if (type <= 0)
                {
                    type = _defaultSaveType;
                }

                if (type != ResourceSaveType.OnlyStreamingAsset)
                {
                    doFileSaveData(ShineToolGlobal.sourceCommonPath, name, type);
                }
            }

            //bundleInfo.bin
            doFileSaveData(getTargetSourcePath(), ShineGlobal.bundleInfoPath, ResourceSaveType.InStreamingAsset);

            //其余额外部分
        }