// Update is called once per frame void Update() { dist = Mathf.Abs(pc.x - x) + Mathf.Abs(pc.y - y); if(!talking && dist<10){ talking = true; //c = controller.AddComponent("DialogueHelper"); dh = (DialogueHelper)controller.GetComponent(typeof(DialogueHelper)); dh.parseDialogueTree(ta.text); dh.start = true; } }
// Use this for initialization void Start() { testXML = ta.text; dh.parseDialogueTree(testXML); }