// Use this for initialization void Start() { //Read the XML document xmlDoc = new XmlDocument(); xmlDoc.LoadXml(XMLAsset.text); //Set references Transform content = dialogueBox.transform.FindChild("Content"); dialogueBoxText = content.FindChild("Text").gameObject.GetComponent <Text>(); dialogueBoxTextRectTransform = dialogueBoxText.gameObject.GetComponent <RectTransform>(); face = content.FindChild("Head").gameObject.GetComponent <Image>(); audio = gameObject.GetComponent <AudioSource>(); background = dialogueBox.transform.FindChild("background").gameObject.GetComponent <Image>(); continueButtonController = dialogueBox.transform.FindChild("ContinueButtonController").gameObject; continueButtonKeyboard = dialogueBox.transform.FindChild("ContinueButtonKeyboard").gameObject; //Initialize variables dialogueCharacterDB = new DialogueCharacterDB(); //Make initial preparations state = dialogueBoxState.OFF; dialogueBox.SetActive(false); continueButtonController.SetActive(false); continueButtonKeyboard.SetActive(false); correctToResolution(); }
// Use this for initialization void Start () { //Read the XML document xmlDoc = new XmlDocument(); xmlDoc.LoadXml(XMLAsset.text); //Set references Transform content = dialogueBox.transform.FindChild("Content"); dialogueBoxText = content.FindChild("Text").gameObject.GetComponent<Text>(); dialogueBoxTextRectTransform = dialogueBoxText.gameObject.GetComponent<RectTransform>(); face = content.FindChild("Head").gameObject.GetComponent<Image>(); audio = gameObject.GetComponent<AudioSource>(); background = dialogueBox.transform.FindChild("background").gameObject.GetComponent<Image>(); continueButtonController = dialogueBox.transform.FindChild("ContinueButtonController").gameObject; continueButtonKeyboard = dialogueBox.transform.FindChild("ContinueButtonKeyboard").gameObject; //Initialize variables dialogueCharacterDB = new DialogueCharacterDB(); //Make initial preparations state = dialogueBoxState.OFF; dialogueBox.SetActive(false); continueButtonController.SetActive(false); continueButtonKeyboard.SetActive(false); correctToResolution(); }