// TODO: maybe make this private and change it so the class sends an event maybe to get the Thing param? public void BuildDialoguePanel(BaseCharacter thing) { _currentTargetThing = thing; HideUIPanel(); var temp = Instantiate(_dialoguePanel); temp.transform.SetParent(_canvas.transform, false); DialoguePanel newPanel = temp.GetComponent <DialoguePanel>(); newPanel.InitDialoguePanel(thing); UpdateCurrentPanel(newPanel.gameObject); }