void OnTriggerEnter2D(Collider2D other) { if (!showing && other.tag == "Player") { hintUIController.toggleDialog(dialogBox, origPos.x, origPos.y); } }
// Use this for initialization void Awake() { hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>(); hintUIController.toggleHint(); showing = false; dialogBox = GetComponentInChildren <Canvas>(); origPos = dialogBox.transform.position; hintUIController.toggleDialog(dialogBox); }