IEnumerator CopZIPFile(string filePath, string saveZipPath) { string fielURLPath = "" + filePath; #if UNITY_STANDALONE_WIN || UNITY_EDITOR File.Copy(filePath, saveZipPath, true); yield return(null); #else #if UNITY_IPHONE fielURLPath = "file://" + filePath; #endif WWW www = new WWW(fielURLPath); yield return(www); FileStream oneZip = File.Create(saveZipPath); oneZip.Write(www.bytes, 0, www.bytes.Length); oneZip.Close(); #endif bool bUnzipDone = UnCommonZip(saveZipPath); Debug.Log("解压 " + bUnzipDone); DataSetMgr.InitDataTab(); skillTabBean bean = (skillTabBean)skillTabMgr.instance._GetDataById(1); Debug.Log("data is " + bean.SkillName); }
IEnumerator CopZIPFile(string filePath, string saveZipPath) { string fielURLPath = "" + filePath; #if UNITY_STANDALONE_WIN || UNITY_EDITOR File.Copy(filePath, saveZipPath, true); // yield return null; #else #if UNITY_IPHONE fielURLPath = "file://" + filePath; #endif //Debuger.LogError ("zys start CopZIPFile "+ filePath); WWW www = new WWW(fielURLPath); yield return(www); FileStream oneZip = File.Create(saveZipPath); //Debuger.LogError ("zys CopZIPFile Length " + www.bytes.Length); oneZip.Write(www.bytes, 0, www.bytes.Length); oneZip.Close(); //Debuger.LogError ("zys get CopZIPFile"); #endif //Debuger.LogError ("zys UnCommonZip fun will ;do"); bool bUnzipDone = UnCommonZip(saveZipPath); Debuger.LogError("zys Unzip is " + bUnzipDone + " saveZipPath " + saveZipPath); if (bUnzipDone) { string assetbundlePath = Application.persistentDataPath + "/Data"; DataSetMgr.prePath = assetbundlePath; DataSetMgr.InitDataTab(); // MsgSet.loadDataFile (); // RoleSet.loadDataFile (); // ItemsSet.loadDataFile (); // PlayerSet.loadDataFile (); // SkillSet.loadDataFile (); // TrapInfoSet.loadDataFile (); // TalentSet.loadDataFile (); // MapSet.loadDataFile (); // // ParamSet.loadDataFile (); // GuideSet.loadDataFile (); } // yield return null; yield return(new WaitForEndOfFrame()); }