using System.Collections; using System.Collections.Generic; using UnityEngine; public class NotMatchCollider : MonoBehaviour { public GameObject panelWarning; void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("man-mask") || other.gameObject.CompareTag("mug-viruses")) { Debug.Log("object man and mask touched"); panelWarning.SetActive(true); } } void OnTriggerExit(Collider other) { if (other.gameObject.CompareTag("man-mask") || other.gameObject.CompareTag("mug-viruses")) { Debug.Log("object man and mask untouched"); panelWarning.SetActive(false); } } }