Files
BABA_YAGA/Assets/Scripts/Player/Generic/Triggers/vDestroyOnTrigger.cs

18 lines
441 B
C#
Raw Normal View History

2026-05-30 09:16:35 +07:00
using UnityEngine;
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);
}
}
}
}