static void SearchFiles(DirectoryInfo pDirInfo, Action <FileInfo> pCallback) { #if UNITY_EDITOR SHUtils.ForToArray(pDirInfo.GetFiles(), (pFile) => { pCallback(pFile); }); #endif }
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 }
// 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 }
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); }