Exemplo n.º 1
0
 /// <summary>
 /// 定居
 /// </summary>
 /// <param name="path">定居路径</param>
 /// <param name="list">货物清单</param>
 /// <returns></returns>
 public static bool Settle(string path, Dictionary <string, string> list)
 {
     if (DirTool.Create(path))
     {
         if (list != null)
         {
             foreach (var l in list)
             {
                 FileTool.Copy(l.Key, l.Value, true);
             }
         }
     }
     return(IsSettle(path, list));
 }
Exemplo n.º 2
0
 public static bool Write(DataEntity data)
 {
     if (data != null && data.User != null && Str.Ok(data.User.Email, data.User.Passcode))
     {
         string s     = PassHelper.EnData(data);
         string file  = R.Files.GetUserDataFile(data.User.Email);
         string cache = R.Files.GetUserDataCacheFile(data.User.Email);
         bool   f1    = TxtTool.Create(cache, s);
         if (f1)
         {
             bool f2 = FileTool.Copy(cache, file, true);
             return(f2);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        /// <returns></returns>
        public override bool DoSave()
        {
            string s = Json.Object2String(this.Config);

            s = JsonFormat.Format(s);

            TxtTool.Create(this.FilePath, s);
            bool result = TxtTool.Create(this.FilePathBackup, s);

            if (result)
            {
                if (Json.File2Object <T>(this.FilePathBackup) != null)
                {
                    if (FileTool.Copy(this.FilePathBackup, this.FilePath, true))
                    {
                        FileTool.Delete(this.FilePathBackup);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 4
0
    public static void Build()
    {
        Bundle.Pack();
        //打包前 将AB包复制到 StreamingAsset目录
        FileTool.Copy(BundleTargetPath, Application.streamingAssetsPath);
        EditorBuildSettingsScene[] scenes = FindEnableScenes();
        string path = null;

        switch (EditorUserBuildSettings.activeBuildTarget)
        {
        case BuildTarget.Android:
            path = m_AndroidPath + AppName + string.Format("_{0:yyyyMMddHHmm}.apk", DateTime.Now);
            break;

        case BuildTarget.iOS:
            path = m_IOSPath + AppName + string.Format("_{0:yyyyMMddHHmm}", DateTime.Now);
            break;

        case BuildTarget.StandaloneWindows:
        case BuildTarget.StandaloneWindows64:
            path = m_WindowsPath + AppName + string.Format("_{0:yyyyMMddHHmm}/{1}.exe", DateTime.Now, AppName);
            break;
        }
        if (path != null)
        {
            try
            {
                BuildPipeline.BuildPlayer(scenes, path, EditorUserBuildSettings.activeBuildTarget, BuildOptions.None);
            }
            catch (System.Exception e)
            {
                Debug.LogError(e);
                return;
            }
            LogTool.Log("项目打包成功...平台:", EditorUserBuildSettings.activeBuildTarget, " path:", path);
        }
        AssetDatabase.Refresh();//刷新界面
    }