UnityGame/Library/PackageCache/com.unity.ai.navigation/Samples~/Scripts/Despawner.cs

18 lines
366 B
C#
Raw Normal View History

2024-10-27 10:53:47 +03:00
using System;
using UnityEngine;
namespace Unity.AI.Navigation.Samples
{
/// <summary>
/// Destroy GameObjects upon collision
/// </summary>
[RequireComponent(typeof(Collider))]
public class Despawner : MonoBehaviour
{
void OnCollisionEnter(Collision collision)
{
Destroy(collision.gameObject);
}
}
}