Ejemplo 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);
        }
Ejemplo n.º 2
0
        protected void packOneBundlePack(PackParam param)
        {
            string        resPath        = "";
            List <Object> objList        = new List <Object>();
            List <string> assetNamesList = new List <string>();

            UnityEngine.Object go;

            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()));
                assetNamesList.Add(resPath);
                go = AssetDatabase.LoadAssetAtPath(resPath, ExportUtil.convResStr2Type(packItem.m_resType));
                if (go)
                {
                    objList.Add(go);
                }
                else
                {
                    LoggerTool.error(string.Format("AssetDatabase.LoadAssetAtPath 不能加载资源 {0}", resPath));
                }
            }

            AssetBundleParam bundleParam = new AssetBundleParam();

#if UNITY_5
            bundleParam.m_buildList = new AssetBundleBuild[1];
            bundleParam.m_buildList[0].assetBundleName    = m_name;
            bundleParam.m_buildList[0].assetBundleVariant = UtilApi.UNITY3D;
            bundleParam.m_buildList[0].assetNames         = assetNamesList.ToArray();
            pathList.Clear();
            pathList.Add(param.m_outPath);
            bundleParam.m_pathName = ExportUtil.getStreamingDataPath(UtilPath.combine(pathList.ToArray()));
#elif UNITY_4_6 || UNITY_4_5
            bundleParam.m_assets = objList.ToArray();
            pathList.Clear();
            pathList.Add(param.m_outPath);
            pathList.Add(m_name);
            bundleParam.m_pathName = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));
#endif

            ExportUtil.BuildAssetBundle(bundleParam);
        }
Ejemplo n.º 3
0
        protected void packOneBundlePack(PackParam param)
        {
            string resPath = "";
            List<Object> objList = new List<Object>();
            List<string> assetNamesList = new List<string>();
            UnityEngine.Object go;

            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(ExportUtil.combine(pathList.ToArray()));
                assetNamesList.Add(resPath);
                go = AssetDatabase.LoadAssetAtPath(resPath, ExportUtil.convResStr2Type(packItem.m_resType));
                if (go)
                {
                    objList.Add(go);
                }
                else
                {
                    LoggerTool.error(string.Format("AssetDatabase.LoadAssetAtPath 不能加载资源 {0}", resPath));
                }
            }

            AssetBundleParam bundleParam = new AssetBundleParam();

#if UNITY_5
            bundleParam.m_buildList = new AssetBundleBuild[1];
            bundleParam.m_buildList[0].assetBundleName = m_name;
            bundleParam.m_buildList[0].assetBundleVariant = ExportUtil.UNITY3D;
            bundleParam.m_buildList[0].assetNames = assetNamesList.ToArray();
            pathList.Clear();
            pathList.Add(param.m_outPath);
            bundleParam.m_pathName = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));
#elif UNITY_4_6 || UNITY_4_5
            bundleParam.m_assets = objList.ToArray();
            pathList.Clear();
            pathList.Add(param.m_outPath);
            pathList.Add(m_name);
            bundleParam.m_pathName = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));
#endif

            ExportUtil.BuildAssetBundle(bundleParam);
        }
Ejemplo n.º 4
0
        public void packOnePack(PackParam param)
        {
            List<string> pathList = new List<string>();
            pathList.Add(param.m_outPath);
            pathList.Add(m_name);
            string path = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));
            ExportUtil.RecurCreateStreamDirectory(path);

            if (ExportUtil.BUNDLE == param.m_type)
            {
                packOneBundlePack(param);
            }
            else if (ExportUtil.LEVEL == param.m_type)
            {
                packOneLevelPack(param);
            }
        }
Ejemplo n.º 5
0
        public void packOnePack(PackParam param)
        {
            List<string> pathList = new List<string>();
            pathList.Add(param.m_outPath);
            pathList.Add(m_name);
            string path = ExportUtil.getStreamingDataPath(ExportUtil.combine(pathList.ToArray()));
            ExportUtil.RecurCreateStreamDirectory(path);

            if (ExportUtil.BUNDLE == param.m_type)
            {
                packOneBundlePack(param);
            }
            else if (ExportUtil.LEVEL == param.m_type)
            {
                packOneLevelPack(param);
            }
        }
Ejemplo n.º 6
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(ExportUtil.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(ExportUtil.combine(pathList.ToArray()));

            ExportUtil.BuildStreamedSceneAssetBundle(bundleParam);
        }