Comment what SimplifiedDetailInfo is and change title scene handler remove children to use findall

This commit is contained in:
xen-42 2025-02-16 17:40:41 -05:00
parent 731bd64bdf
commit 899e66e7ed
3 changed files with 5 additions and 6 deletions

View File

@ -210,6 +210,7 @@ namespace NewHorizons.Builder.Body
{
foreach (var detailInfo in body.Config.Props.proxyDetails)
{
// Thought about switching these to SimplifiedDetailInfo but we use AlignRadial with these so we can't
DetailBuilder.Make(proxy, null, body.Mod, detailInfo);
}
}

View File

@ -6,6 +6,9 @@ using System.ComponentModel;
namespace NewHorizons.External.Modules.Props
{
/// <summary>
/// A lesser form of DetailInfo used for the title screen since that supports fewer features
/// </summary>
[JsonObject]
public class SimplifiedDetailInfo : GeneralPropInfo
{

View File

@ -202,15 +202,10 @@ namespace NewHorizons.Handlers
private static void RemoveChildren(GameObject go, string[] paths)
{
var goPath = go.transform.GetPath();
var transforms = go.GetComponentsInChildren<Transform>(true);
foreach (var childPath in paths)
{
// Multiple children can have the same path so we delete all that match
var path = $"{goPath}/{childPath}";
var flag = true;
foreach (var childObj in transforms.Where(x => x.GetPath() == path))
foreach (var childObj in go.transform.FindAll(childPath))
{
flag = false;
// idk why we wait here but we do