Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / PressurePlate2.cs
@Rackday Rackday on 21 Aug 776 bytes Project Added
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;
    // Start is called before the first frame update
    void Start()
    {
        triggers = transform.parent.GetComponent<Triggers>();
    }

    // Update is called once per frame
    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);
    }
}