This commit is contained in:
Perfare
2018-10-27 08:30:43 +08:00
parent 3cd6126ed9
commit d380c38710
2 changed files with 34 additions and 12 deletions

View File

@ -185,15 +185,27 @@ namespace AssetStudio
{
public static ImportedFrame FindFrame(string name, ImportedFrame root)
{
ImportedFrame frame = root;
if ((frame != null) && (frame.Name == name))
if (root.Name == name)
{
return frame;
return root;
}
for (int i = 0; i < root.Count; i++)
foreach (var child in root)
{
if ((frame = FindFrame(name, root[i])) != null)
var frame = FindFrame(name, child);
if (frame != null)
{
return frame;
}
}
return null;
}
public static ImportedFrame FindChild(string name, ImportedFrame root)
{
foreach (var child in root)
{
var frame = FindFrame(name, child);
if (frame != null)
{
return frame;
}