public static void SetData(string fileName, object pObject)
        {
            //将对象序列化为字符串
            string toSave = SerializeObject(pObject);

            //对字符串进行加密,32位加密密钥
            toSave = RijndaelEncrypt(toSave, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

            DirFileHelper.CreateFileTxt(fileName, toSave);
        }
예제 #2
0
        private static void MenuClicked()
        {
            var generatePackageName = Exporter.GenerateUnityPackageName();

            EditorUtil.ExportPackage("Assets/PanFrame", generatePackageName + ".unitypackage");

            if (DirFileHelper.IsExistsFile(generatePackageName + ".unitypackage"))
            {
                Debug.Log("///嘎嘎,导出成功");
                //EditorUtil.OpenInFolder(Path.Combine(Application.dataPath, "../"));
                EditorUtil.OpenInFolder(@"");
            }
            else
            {
                Debug.LogError("///嘎嘎,导出失败");
            }
        }
예제 #3
0
        public static void DownTool(string toolPath)
        {
            string url    = youthupPath + toolPath + "/";                     //服务器文件
            string locurl = Application.dataPath + locaPath + toolPath + "/"; //本地路径

            //SUnityWebRequest.Instance().DownloadFile(url, locurl, (r)=> {

            //    string[] arrayLine = File.ReadAllLines(locurl);
            //    for (int i = 0; i < arrayLine.Length; i++)
            //    {
            //        string currentUrl = youthupPath + toolPath + "/" + arrayLine[i];
            //        string currentlocurl = Application.dataPath + locaPath + toolPath + "/" + arrayLine[i];
            //        SUnityWebRequest.Instance().DownloadFile(currentUrl, currentlocurl,(s)=> {
            //        });
            //    }
            //});
            if (!DirFileHelper.IsExistsFile(locurl + explainPath))
            {
                WebClient wc = new WebClient();
                wc.DownloadFileCompleted += (send, e) =>
                {
                    Debug.Log("下载完成" + send);
                    Debug.Log(locurl + explainPath);
                    string[] arrayLine = File.ReadAllLines(locurl + explainPath);
                    for (int i = 0; i < arrayLine.Length; i++)
                    {
                        string currentUrl    = url + arrayLine[i];
                        string currentlocurl = locurl + arrayLine[i];
                        Debug.Log(currentUrl);
                        Debug.Log(currentlocurl);
                        wc.DownloadFile(new Uri(currentUrl), currentlocurl);
                    }
                };
                Debug.Log(url);
                Debug.Log(locurl);
                DirFileHelper.CreateDirectory(locurl);

                wc.DownloadFileAsync(new Uri(url + explainPath), locurl + explainPath);
            }
            else
            {
                Debug.Log("文件已经存在 " + locurl);
            }
        }