/// <summary> /// 生成资源包版本 /// </summary> static public void GenPackageBuildInfo(string ouptputPath, RuntimePlatform platform) { var path = string.Format("{0}/{1}/{2}", ouptputPath, BDApplication.GetPlatformPath(platform), PackageBuildInfo); //写入buildinfo内容 var buildinfo = new PackageBuildInfo(); buildinfo.BuildTime = DateTime.Now.ToFileTime(); var content = JsonMapper.ToJson(buildinfo); //写入本地 FileHelper.WriteAllText(path, content); }
/// <summary> /// 生成资源包版本 /// </summary> static public void GenPackageBuildInfo(string ouptputPath, RuntimePlatform platform) { var path = string.Format("{0}/{1}/{2}", ouptputPath, BDApplication.GetPlatformPath(platform), PackageBuildInfo); //写入buildinfo内容 var buildinfo = new PackageBuildInfo(); DateTime startTime = TimeZoneInfo.ConvertTime(new System.DateTime(1970, 1, 1), TimeZoneInfo.Utc, TimeZoneInfo.Local); // 当地时区 long timeStamp = (long)(DateTime.Now - startTime).TotalSeconds; buildinfo.BuildTime = timeStamp; var content = JsonMapper.ToJson(buildinfo); //写入本地 if (File.Exists(path)) { File.Delete(path); } FileHelper.WriteAllText(path, content); }