static void AllFilsInResourcesFolderWithAssetBundleInfo() { // 시작팝업 if (false == ShowDialog("[SHTools] Resources Listing", SHEditorResourcesLister.m_strMsg_1, "확인", "취소")) { return; } // 알리아싱 var pStartTime = DateTime.Now; var strSaveResourcePath = string.Format("{0}/{1}", SHPath.GetPathToJson(), "ResourcesTable.json"); var strSaveBundlePath = string.Format("{0}/{1}", SHPath.GetPathToJson(), "AssetBundleInfo.json"); var pLister = new SHResourcesLister(); // 리스팅 int iFileCount = pLister.SetListing(SHPath.GetPathToResources()); SHResourcesLister.SaveToResources(pLister.m_dicResources, strSaveResourcePath); SHResourcesLister.SaveToAssetBundleInfo(pLister.m_dicAssetBundles, strSaveBundlePath); SHResourcesLister.SaveToDuplicationList(pLister.m_dicDuplications, string.Format("{0}/{1}", SHPath.GetPathToJson(), "DuplicationResourcesList.txt")); // 종료팝업 if (true == ShowDialog("[SHTools] Resources Listing", string.Format(SHEditorResourcesLister.m_strMsg_3, iFileCount, strSaveResourcePath, ((DateTime.Now - pStartTime).TotalMilliseconds / 1000.0)), "파일확인", "닫기")) { System.Diagnostics.Process.Start(strSaveResourcePath); } }
// 인터페이스 : Streaming에서 LoaclLoad로 로드 public JSONNode LoadToStreamingForLocal(string strFileName) { string strSavePath = string.Format("{0}/{1}.json", SHPath.GetPathToJson(), Path.GetFileNameWithoutExtension(strFileName)); if (false == File.Exists(strSavePath)) { return(null); } return(SetJsonNode(LoadLocal(strSavePath))); }
// 인터페이스 : DataSet을 Json으로 쓰기 public void Write(string strFileName, Dictionary <string, List <SHTableDataSet> > dicData) { #if UNITY_EDITOR if (null == dicData) { Debug.LogError(string.Format("Json으로 저장할 데이터가 없습니다!!")); return; } string strNewLine = "\r\n"; string strBuff = "{" + strNewLine; SHUtils.ForToDic(dicData, (pKey, pValue) => { strBuff += string.Format("\t\"{0}\": [{1}", pKey, strNewLine); SHUtils.ForToList(pValue, (pData) => { strBuff += "\t\t{" + strNewLine; SHUtils.For(0, pData.m_iMaxCol, (iCol) => { strBuff += string.Format("\t\t\t\"{0}\": {1},{2}", pData.m_ColumnNames[iCol], pData.m_pDatas[iCol], strNewLine); }); strBuff = string.Format("{0}{1}", strBuff.Substring(0, strBuff.Length - (strNewLine.Length + 1)), strNewLine); strBuff += "\t\t}," + strNewLine; }); strBuff = string.Format("{0}{1}", strBuff.Substring(0, strBuff.Length - (strNewLine.Length + 1)), strNewLine); strBuff += string.Format("\t],{0}", strNewLine); }); strBuff = string.Format("{0}{1}", strBuff.Substring(0, strBuff.Length - (strNewLine.Length + 1)), strNewLine); strBuff += "}"; SHUtils.SaveFile(strBuff, string.Format("{0}/{1}.json", SHPath.GetPathToJson(), Path.GetFileNameWithoutExtension(strFileName))); #endif }
public void SaveJsonFile() { SaveJsonFile(SHPath.GetPathToJson()); }