Esempio n. 1
0
        protected void packOneLevelPack(PackParam param)
        {
            string        resPath  = "";
            List <string> nameList = new List <string>();
            List <string> pathList = new List <string>();

            foreach (PackItem packItem in m_packList)
            {
                pathList.Clear();
                pathList.Add(param.m_inPath);
                pathList.Add(packItem.m_path);
                resPath = ExportUtil.getRelDataPath(UtilPath.combine(pathList.ToArray()));
                nameList.Add(resPath);
            }

            StreamedSceneAssetBundleParam bundleParam = new StreamedSceneAssetBundleParam();

            bundleParam.m_levels = nameList.ToArray();
            pathList.Clear();
            pathList.Add(param.m_outPath);
            pathList.Add(m_name);
            bundleParam.m_locationPath = ExportUtil.getStreamingDataPath(UtilPath.combine(pathList.ToArray()));

            ExportUtil.BuildStreamedSceneAssetBundle(bundleParam);
        }
Esempio n. 2
0
        protected void packOneLevelPack()
        {
            string        resPath  = "";
            List <string> nameList = new List <string>();
            List <string> pathList = new List <string>();

            List <string> filesList = ExportUtil.GetAll(ExportUtil.getDataPath(m_packParam.m_inPath));
            string        ext       = "";
            string        nameNoExt = "";
            string        tmpStr    = "";
            StreamedSceneAssetBundleParam bundleParam = new StreamedSceneAssetBundleParam();

            foreach (string filePath in filesList)
            {
                ext       = ExportUtil.getFileExt(filePath);
                nameNoExt = ExportUtil.getFileNameNoExt(filePath);
                if (ExportUtil.isArrContainElem(ext, m_packParam.m_extArr))
                {
                    resPath = ExportUtil.convFullPath2AssetsPath(filePath);
                    nameList.Add(resPath);
                    bundleParam.m_levels = nameList.ToArray();
                    pathList.Clear();
                    pathList.Add(m_packParam.m_outPath);
                    tmpStr = string.Format("{0}{1}", nameNoExt, ExportUtil.DOTUNITY3D);
                    pathList.Add(tmpStr);
                    bundleParam.m_locationPath = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));

                    ExportUtil.BuildStreamedSceneAssetBundle(bundleParam);
                }
            }
        }
Esempio n. 3
0
        static public void BuildStreamedSceneAssetBundle(StreamedSceneAssetBundleParam param)
        {
#if UNITY_5
            BuildPipeline.BuildPlayer(param.m_levels, param.m_locationPath, param.m_target, param.m_options);
#elif UNITY_4_6 || UNITY_4_5
            BuildPipeline.BuildStreamedSceneAssetBundle(param.m_levels, param.m_locationPath, param.m_target, param.m_options);
#endif
        }