Ejemplo n.º 1
0
        public static void BuildApkMiniNoGenRes()
        {
            Version v = Version.LoadVersionFromStreamingAsset();

            byte[] bytes = FileUtils.ReadBytesFromStreaming("Audio/GeneratedSoundBanks/Android/Init.bnk", false);

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            //WriteApkConfig();

            //写入其他文件
            FileUtils.WriteFile(Application.streamingAssetsPath + "/Audio/GeneratedSoundBanks/Android/Init.bnk", bytes, false);
            string movePath = string.Format("{0}/{1}", ResSetting.build_root_path, v);

            FileUtilTool.CopyFolder(movePath + "/Movie", "Assets/StreamingAssets/Movie");


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();

            string outputPath = string.Format("{0}/{1}/{2}", ResSetting.AssetBundlesOutputPath, ResSetting.GetChannelRes(), v);
            string location   = string.Format("{0}/{1}", outputPath, "TankGirl.apk");

            BuildApk(v, location);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
        }
Ejemplo n.º 2
0
        public static void BuildIOSFull()
        {
            BuildIOSRes();
            Version v = Version.LoadVersionFromStreamingAsset();

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            WriteIOSConfig();

            //拷贝除apk以外的资源
            ResTool.CopyResToStreaming();

            BuildIOSProject(v);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();

            //上传资源
            //ResTool.UploadRes();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 是否是该版本第一次启动
        /// </summary>
        /// <returns></returns>
        bool IsFullApkFirstStart()
        {
            //is full apk
            string filename = "firstStart";
            string version  = Version.LoadVersionFromStreamingAsset().ToString();
            string content  = "";

            FileUtils.ReadFileInPersistent(filename, ref content, false);
            if (string.IsNullOrEmpty(content)) //没有这个文件
            {
                FileUtils.WriteFileInPersistent(filename, version, false);
                return(true);
            }
            else
            {
                if (content == version) //有这个文件并且内容相同,不是第一次启动
                {
                    return(false);
                }
                else
                {
                    FileUtils.WriteFileInPersistent(filename, version, false);
                    return(true);
                }
            }
        }
Ejemplo n.º 4
0
        public static void BuildStandaloneWithoutRebuiltRes()
        {
            Version v = Version.LoadVersionFromStreamingAsset();

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            WriteStandaloneConfig();

            //拷贝除apk以外的资源
            ResTool.CopyResToStreaming();

            BuildStandaloneProject(v);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// asset/[Platform]/[Version]/assetrecord.dat
        /// </summary>
        /// <returns></returns>
        public static string GetRecordPath()
        {
            string filePath = string.Format("{0}/{1}/{2}", ResSetting.build_root_path, Version.LoadVersionFromStreamingAsset(), "assetrecord.dat");

            return(filePath);
        }
Ejemplo n.º 6
0
        public static void UploadRes()
        {
            string sourcePath = ResSetting.build_res_path;
            string targetPath = string.Format("\\\\192.168.2.85\\FtpData\\{0}\\{1}", ResSetting.GetChannelRes(), Version.LoadVersionFromStreamingAsset());

            EditorUtility.DisplayProgressBar("上传资源", "...", 0);
            FileUtilTool.CopyFolder(sourcePath, targetPath);
            EditorUtility.DisplayProgressBar("上传资源", "...", 1);
            EditorUtility.ClearProgressBar();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 和BuildCode一一对应 ,但是形式是x.x.x
 /// </summary>
 /// <returns></returns>
 public static Version LoadCodeVersion()
 {
     return(Version.LoadVersionFromStreamingAsset());
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 返回asset/[ChannelRes]/[Version]
        /// </summary>
        /// <returns></returns>
        public static string ResPath()
        {
            string outputPath = string.Format("{0}/{1}/{2}", AssetBundlesOutputPath, GetChannelRes(), Version.LoadVersionFromStreamingAsset());

            return(outputPath);
        }