Search in body instead of doing search utilities

This commit is contained in:
Noah Pilarski 2024-05-31 05:30:21 -04:00
parent fb9e10fee7
commit f27bb25f86

View File

@ -35,7 +35,7 @@ namespace NewHorizons.Builder.Props
}
else
{
return (AddToExistingDialogue(info, xml), null);
return (AddToExistingDialogue(go, info, xml), null);
}
}
@ -70,9 +70,11 @@ namespace NewHorizons.Builder.Props
return (dialogue, remoteTrigger);
}
private static CharacterDialogueTree AddToExistingDialogue(DialogueInfo info, string xml)
private static CharacterDialogueTree AddToExistingDialogue(GameObject go, DialogueInfo info, string xml)
{
var existingDialogue = SearchUtilities.Find(info.pathToExistingDialogue)?.GetComponent<CharacterDialogueTree>();
var dialogueObject = go.FindChild(info.pathToExistingDialogue);
if (dialogueObject == null) dialogueObject = SearchUtilities.Find(info.pathToExistingDialogue);
var existingDialogue = dialogueObject != null ? dialogueObject.GetComponent<CharacterDialogueTree>() : null;
if (existingDialogue == null)
{