- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PressurePlate2 : MonoBehaviour
- {
- [SerializeField] private List<string> acceptedTags;
- private bool canRayCast = true;
- private Triggers triggers;
-
- void Start()
- {
- triggers = transform.parent.GetComponent<Triggers>();
- }
-
- private void OnTriggerEnter(Collider other)
- {
- foreach (string s in acceptedTags)
- {
- if (other.gameObject.CompareTag(s))
- {
- triggers.CheckInverse(true);
- }
- }
- }
- private void OnTriggerExit(Collider other)
- {
- triggers.CheckInverse(false);
- }
- }