public void ShowDialog(string speaker, string content, WhichImage which = WhichImage.LeftImage) { characterAvatar.sprite = AvatarDict.ContainsKey(speaker) ? AvatarDict[speaker] : null; ShowTachie(speaker, which); string text = "<b>" + speaker + "</b>: "; dialogText.text = text; // dialogText.text = text; dialogPanel.SetActive(true); dialogTypewriter.SetText(content, true); }
void ImportResources() { Object[] avatars = Resources.LoadAll("Sprites/Avatar", typeof(Sprite)); Object[] tachies = Resources.LoadAll("Sprites/Tachie", typeof(Sprite)); foreach (var img in avatars) { AvatarDict.Add(img.name, img as Sprite); } foreach (var img in tachies) { TachieDict.Add(img.name, img as Sprite); } }