18 lines
366 B
C#
18 lines
366 B
C#
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|