Fix SearchUtilities find method

This commit is contained in:
Nick J. Connors 2022-02-11 00:38:35 -05:00
parent 1a0ac92de7
commit 5afdbd94c3

View File

@ -115,9 +115,9 @@ namespace NewHorizons.Utility
if (t == null) if (t == null)
{ {
Logger.LogWarning($"Couldn't find root object in path ({names[0]})"); Logger.LogWarning($"Couldn't find root object in path ({names[0]})");
return null;
} }
else
{
for (int i = 1; i < names.Length; i++) for (int i = 1; i < names.Length; i++)
{ {
var child = t.transform.Find(names[i]); var child = t.transform.Find(names[i]);
@ -143,6 +143,7 @@ namespace NewHorizons.Utility
t = child; t = child;
} }
}
go = t?.gameObject; go = t?.gameObject;
} }