// Use this for initialization void Awake () { MySpeechBubble = gameObject.GetComponent <SpeechHandler> (); if (MySpeechBubble != null) { MySpeechBubble.MyDialogueText.gameObject.transform.parent.gameObject.SetActive (false); MySpeechBubble.SetCharacter(this); } Transform MyCharacterLabel = MySpeechBubble.MyDialogueText.transform.parent.parent.FindChild ("Label"); if (MyCharacterLabel != null) { MyCharacterLabel.gameObject.transform.GetChild(0).gameObject.GetComponent<Text>().text = name; } }
// Use this for initialization void Awake() { MySource = gameObject.GetComponent<AudioSource> (); if (MySource == null) MySource = gameObject.AddComponent<AudioSource> (); // Grab my speech handler! MySpeechBubble = gameObject.GetComponent <SpeechHandler> (); if (MySpeechBubble != null) { MySpeechBubble.MyDialogueText.gameObject.transform.parent.gameObject.SetActive (false); MySpeechBubble.SetCharacter(this); } // Title gui Transform MyCharacterLabel = MySpeechBubble.MyDialogueText.transform.parent.parent.FindChild ("Label"); if (MyCharacterLabel != null) { MyCharacterLabel.gameObject.transform.GetChild(0).gameObject.GetComponent<Text>().text = name; } }