using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ContactWall : MonoBehaviour { public Canvas canvas; public Text text; private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Finish")) { Destroy(gameObject); text.text = "Вы победили!"; canvas.enabled = true; } if (other.gameObject.CompareTag("Wall")) { Destroy(gameObject); text.text = "Вы проиграли!"; canvas.enabled = true; } } }