init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
13
Assets/NavMesh/Examples/Scripts/DestroyOnTrigger.cs
Normal file
13
Assets/NavMesh/Examples/Scripts/DestroyOnTrigger.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using UnityEngine;
|
||||
|
||||
// Destroy owning GameObject if any collider with a specific tag is trespassing
|
||||
public class DestroyOnTrigger : MonoBehaviour
|
||||
{
|
||||
public string m_Tag = "Player";
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.gameObject.tag == m_Tag)
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue