Files
beyond/Assets/ThirdParty/Invector-3rdPersonController/Basic Locomotion/Scripts/Generic/Triggers/vDestroyOnTrigger.cs
2024-11-20 15:21:28 +01:00

19 lines
467 B
C#

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Invector
{
public class vDestroyOnTrigger : MonoBehaviour
{
public List<string> targsToDestroy;
public float destroyDelayTime;
void OnTriggerEnter(Collider other)
{
if (targsToDestroy.Contains(other.gameObject.tag))
{
Destroy(other.gameObject, destroyDelayTime);
}
}
}
}