static void SelectFiles()
    {
        // 시작팝업
        if (false == ShowDialog("[SHTools] Prefab Dependency Check",
                                "리소스 폴더 내에 있는 원본 리소스들이\n선택한 프리팹에 종속되어 있는지 체크합니다.",
                                "확인", "취소"))
        {
            return;
        }

        // 선택 오브젝트 체크
        var pObjects = new List <UnityEngine.Object>(Selection.objects);

        if (0 == pObjects.Count)
        {
            ShowDialog("[SHTools] Resources Listing", "선택된 프리팹이 없습니다.", "확인");
            return;
        }

        // 알리아싱
        var pChecker = new SHPrefabDependencyChecker();

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

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

        // 종속체크
        string strBuff = string.Empty;

        SHUtils.ForToList(pObjects, (pObject) =>
        {
            string strSearchPath = string.Format("{0}/{1}", strAbsolutePath, AssetDatabase.GetAssetPath(pObject));
            SHUtils.Search(strSearchPath, (pFileInfo) =>
            {
                var pDependencys = pChecker.GetDependency(pFileInfo.FullName);
                if (null == pDependencys)
                {
                    return;
                }

                strBuff += string.Format("< Prefab : {0} >\n", Path.GetFileNameWithoutExtension(pFileInfo.FullName));
                SHUtils.ForToList(pDependencys, (pDependency) =>
                {
                    strBuff += string.Format("    Dependency : {0}\n", pDependency);
                });
            });
        });

        string strSavePath = string.Format("{0}/{1}", strAbsolutePath, "DependencyList.txt");

        SHUtils.SaveFile(strBuff, strSavePath);
        System.Diagnostics.Process.Start(strSavePath);
    }
Example #2
0
    string GetStreamingPath(string strFileName)
    {
        string strPath = string.Empty;

#if UNITY_EDITOR || UNITY_STANDALONE
        strPath = string.Format("{0}{1}", "file://", SHPath.GetPathToStreamingAssets());
#elif UNITY_ANDROID
        strPath = string.Format("{0}{1}{2}", "jar:file://", SHPath.GetPathToAssets(), "!/assets");
#elif UNITY_IOS
        strPath = string.Format("{0}{1}{2}", "file://", SHPath.GetPathToAssets(), "/Raw");
#endif

        return(string.Format("{0}/SQLite/{1}.db", strPath, Path.GetFileNameWithoutExtension(strFileName)));
    }
    public void SaveLoadResourceList()
    {
        string strBuff = string.Empty;
        SHUtils.ForToDic(m_dicRealLoadInfo, (pKey, pValue) =>
        {
            strBuff += string.Format("Scene : {0}\n", pKey);
            SHUtils.ForToList(pValue, (pInfo) =>
            {
                strBuff += string.Format("\t{0}\n", pInfo);
            });
        });

        string strSavePath = string.Format("{0}/{1}", SHPath.GetPathToAssets(), "RealTimeLoadResource.txt");
        SHUtils.SaveFile(strBuff, strSavePath);
        System.Diagnostics.Process.Start(strSavePath);
    }
    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);
    }