using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SignController : MonoBehaviour { public XMLcontroller xmlController; public string signText; public DialogueBoxBackgroundController bgDialogue; public Text guiText; // Use this for initialization void Start () { xmlController = this.GetComponent(); } // Update is called once per frame void Update () { if (bgDialogue.deploying) { guiText.enabled = true; bgDialogue.Deploy(); } if (bgDialogue.retiring) { bgDialogue.Retire(); if (bgDialogue.deployed == false) { guiText.enabled = false; } } } private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { if (xmlController != null) { signText = xmlController.Text; guiText.text = signText; } } } }