public void SetStatement(Statement statement) { if (statement == null) { return; } GameObject.FindGameObjectWithTag ("PersonName").GetComponent<Text> ().text = statement.getName () + ":"; statementBox = GameObject.FindGameObjectWithTag ("Statement").GetComponent<Text> (); text = statement.getText (); position = 1; if (statement.getName () == "Blake") { npcImage.GetComponent<Canvas> ().enabled = false; playerImage.GetComponent<Canvas> ().enabled = true; } else { string img = GameObject.Find ("StateController").GetComponent<StateController> ().npcImageMap.GetImage (statement.getName ()); npcImage.GetComponent<Image>().sprite = (Sprite) Resources.Load ("Images/" + img, typeof(Sprite)); npcImage.GetComponent<Canvas> ().enabled = true; playerImage.GetComponent<Canvas> ().enabled = false; } gameObject.GetComponent<Canvas> ().enabled = false; gameObject.GetComponent<Canvas> ().enabled = true; }