void OnTriggerEnter2D(Collider2D o) { if (o.tag == "Player") { NotificationObject.ChangeText(text); } }
void OnTriggerExit2D(Collider2D o) { if (o.tag == "Player" && NotificationObject.currentText == text) { NotificationObject.ChangeText(""); } }
public void OnTriggerEnter2D(Collider2D c) { if (c.tag == "Player") { entered = true; NotificationObject.ChangeText(text); } }
void Update() { if (Vector2.Distance(transform.position, player.position) < maxDistance) { NotificationObject.ChangeText(notificationText, 0); if (Input.GetKeyDown(KeyCode.E)) { d.StartDialouge(dialogName); NotificationObject.Close(); } } else { if (NotificationObject.currentText == notificationText) { NotificationObject.Close(); } } }