internal static void getPngsToRoot(string currentPath, string root) { try { List <string> queue = new List <string>(); string[] dirs = Directory.GetDirectories(currentPath); foreach (string dir in dirs) { CustomKnight.Instance.Log("Looking in" + dir); if (dirHasPng(dir, SearchOption.TopDirectoryOnly)) { IoUtils.DirectoryCopyAllFiles(dir, root); } else if (dirHasPng(dir, SearchOption.AllDirectories)) { queue.Add(dir); } } foreach (string dir in queue) { getPngsToRoot(dir, root); } } catch (Exception e) { CustomKnight.Instance.Log("The Skin could not be fixed : " + e.ToString()); } }