static void AllFilsInResourcesFolderWithAssetBundleInfo()
    {
        // 시작팝업
        if (false == ShowDialog("[SHTools] Update Resources Info",
                                SHEditorResourcesLister.m_strMsg_1,
                                "확인", "취소"))
        {
            return;
        }

        // 알리아싱
        var pStartTime          = DateTime.Now;
        var strSaveResourcePath = string.Format("{0}/{1}", SHPath.GetResourceJsonTable(), "JsonResourcesInfo.json");
        //var strSaveBundlePath = string.Format("{0}/{1}", SHPath.GetResourceJsonTable(), "JsonAssetBundleInfo.json");
        var strSaveDuplicationPath = string.Format("{0}/{1}", SHPath.GetRoot(), "DuplicationResourcesList.txt");

        // 리스팅
        var pLister    = new SHResourcesLister();
        var iFileCount = pLister.Listing(SHPath.GetResources());

        SHResourcesLister.SaveToResourcesInfo(pLister.m_dicResources, strSaveResourcePath);
        //SHResourcesLister.SaveToAssetBundleInfo(pLister.m_dicAssetBundles, strSaveBundlePath);
        SHResourcesLister.SaveToDuplicationList(pLister.m_dicDuplications, strSaveDuplicationPath);

        // 종료팝업
        if (true == ShowDialog("[SHTools] Update Resources Info",
                               string.Format(SHEditorResourcesLister.m_strMsg_2,
                                             iFileCount, strSaveResourcePath, ((DateTime.Now - pStartTime).TotalMilliseconds / 1000.0)),
                               "파일확인", "닫기"))
        {
            System.Diagnostics.Process.Start(strSaveResourcePath);
        }
    }
Exemplo n.º 2
0
    // 인터페이스 : 리소스 리스트를 Json형태로 쓰기
    public static void SaveToResources(Dictionary <string, SHResourcesTableInfo> dicTable, string strSaveFilePath)
    {
        if (0 == dicTable.Count)
        {
            return;
        }

        string strNewLine = "\r\n";
        string strBuff    = "{" + strNewLine;

        // 테이블별 내용작성
        strBuff += string.Format("\t\"{0}\": [{1}", "ResourcesList", strNewLine);
        SHUtils.ForToDic(dicTable, (pKey, pValue) =>
        {
            strBuff += "\t\t{" + strNewLine;
            strBuff += SHResourcesLister.MakeSaveFormat(pValue, "\t\t");
            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 += "}";

        // 저장
        SHUtils.SaveFile(strBuff, strSaveFilePath);
    }
Exemplo n.º 3
0
    static void SelectFiles()
    {
        // 시작팝업
        if (false == ShowDialog("[SHTools] Resources Listing",
                                SHEditorResourcesLister.m_strMsg_2,
                                "확인", "취소"))
        {
            return;
        }

        // 선택 오브젝트 체크
        var pObjects = Selection.objects;

        if ((null == pObjects) || (0 == pObjects.Length))
        {
            ShowDialog("[SHTools] Resources Listing", "선택된 오브젝트가 없습니다.", "확인");
            return;
        }

        // 알리아싱
        int iFileCount = 0;
        var pStartTime = DateTime.Now;
        var pLister    = new SHResourcesLister();

        // 절대경로처리
        var strAbsolutePath = SHPath.GetPathToAssets();

        strAbsolutePath = strAbsolutePath.Substring(0, (strAbsolutePath.IndexOf("Assets") - 1)).Replace("\\", "/");

        // 리스팅
        for (int iLoop = 0; iLoop < pObjects.Length; ++iLoop)
        {
            iFileCount += pLister.SetListing(
                string.Format("{0}/{1}", strAbsolutePath, AssetDatabase.GetAssetPath(pObjects[iLoop])));
        }
        var strSavePath = string.Format("{0}/{1}", strAbsolutePath, "SelectFiles.txt");

        SHResourcesLister.SaveToResources(pLister.m_dicResources, strSavePath);

        // 종료팝업
        ShowDialog("[SHTools] Resources Listing",
                   string.Format(SHEditorResourcesLister.m_strMsg_3,
                                 iFileCount, strSavePath, ((DateTime.Now - pStartTime).TotalMilliseconds / 1000.0)),
                   "확인");

        System.Diagnostics.Process.Start(strSavePath);
    }
 public void SaveJsonFileByDic(Dictionary <string, AssetBundleInfo> dicData, string strSaveFilePath)
 {
     SHResourcesLister.SaveToAssetBundleInfo(dicData, strSaveFilePath);
 }