void UpdateUI(VD.NodeData data) { left.gameObject.SetActive(false); right.gameObject.SetActive(false); if (data.isPlayer) { Image img = left.gameObject.GetComponentInChildren <Image>(); if (data.sprite) { img.sprite = data.sprite; } left.gameObject.SetActive(true); left.SetText(data.comments[0]); left.SetName(data.tag); for (int i = 1; i < data.comments.Length; ++i) { left.CreateChoice(data.comments[i], i); } } else { Image img = right.gameObject.GetComponentInChildren <Image>(); if (data.sprite) { img.color = new Color(1, 1, 1, 1); img.sprite = data.sprite; } else { img.color = new Color(0, 0, 0, 0); } right.gameObject.SetActive(true); right.SetText(data.comments[0]); right.SetName(data.tag); } if (data.sprites[0] != null) { Image background = bg.gameObject.GetComponentInChildren <Image>(); background.sprite = data.sprites[0]; } }