Revert "add the delay back out of fear"

This reverts commit 882b5c457121801fde6b3f19cbde4f21ba05bc38.
This commit is contained in:
JohnCorby 2022-07-21 16:56:18 -07:00
parent d7c30a9892
commit d0d72780f1

View File

@ -262,25 +262,22 @@ namespace NewHorizons.Handlers
if (body.Config.removeChildren != null) if (body.Config.removeChildren != null)
{ {
Delay.FireInNUpdates(() => var goPath = go.transform.GetPath();
var transforms = go.GetComponentsInChildren<Transform>(true);
foreach (var childPath in body.Config.removeChildren)
{ {
var goPath = go.transform.GetPath(); // Multiple children can have the same path so we delete all that match
var transforms = go.GetComponentsInChildren<Transform>(true); var path = $"{goPath}/{childPath}";
foreach (var childPath in body.Config.removeChildren)
var flag = true;
foreach (var childObj in transforms.Where(x => x.GetPath() == path))
{ {
// Multiple children can have the same path so we delete all that match flag = false;
var path = $"{goPath}/{childPath}"; childObj.gameObject.SetActive(false);
var flag = true;
foreach (var childObj in transforms.Where(x => x.GetPath() == path))
{
flag = false;
childObj.gameObject.SetActive(false);
}
if (flag) Logger.LogWarning($"Couldn't find \"{childPath}\".");
} }
}, 2);
if (flag) Logger.LogWarning($"Couldn't find \"{childPath}\".");
}
} }
// Do stuff that's shared between generating new planets and updating old ones // Do stuff that's shared between generating new planets and updating old ones