示例#1
0
    static void SearchFiles(DirectoryInfo pDirInfo, Action <FileInfo> pCallback)
    {
#if UNITY_EDITOR
        SHUtils.ForToArray(pDirInfo.GetFiles(), (pFile) =>
        {
            pCallback(pFile);
        });
#endif
    }
示例#2
0
    static void SearchDirs(DirectoryInfo pDirInfo, Action <FileInfo> pCallback)
    {
#if UNITY_EDITOR
        if (false == pDirInfo.Exists)
        {
            return;
        }

        SHUtils.ForToArray(pDirInfo.GetDirectories(), (pDir) =>
        {
            SearchFiles(pDir, pCallback);
            SearchDirs(pDir, pCallback);
        });
#endif
    }
示例#3
0
    // Component Missing 체크
    public static void CheckMissingComponent()
    {
#if UNITY_EDITOR
        var pObjects = Resources.FindObjectsOfTypeAll(typeof(GameObject));
        SHUtils.ForToArray(pObjects, (pObject) =>
        {
            if (null == pObject)
            {
                return;
            }

            SHUtils.ForToArray((pObject as GameObject).GetComponents <Component>(), (pComponent) =>
            {
                if (null == pComponent)
                {
                    UnityEngine.Debug.Log(string.Format("<color=red>MissingComponent!!(GameObject{0})</color>", pObject.name));
                }
            });
        });
#endif
    }
示例#4
0
    public static void DeleteDirectory(string strPath)
    {
        DirectoryInfo pDirInfo = new DirectoryInfo(strPath);

        if (false == pDirInfo.Exists)
        {
            return;
        }

        FileInfo[] pFiles = pDirInfo.GetFiles("*.*", SearchOption.AllDirectories);
        SHUtils.ForToArray(pFiles, (pFile) =>
        {
            if (false == pFile.Exists)
            {
                return;
            }

            pFile.Attributes = FileAttributes.Normal;
        });

        Directory.Delete(strPath, true);
    }