20 lines
438 B
C#
20 lines
438 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class SmileyTrigger : MonoBehaviour
|
|||
|
{
|
|||
|
public delegate void TriggerDelegate();
|
|||
|
public static event TriggerDelegate OnEnterSmiley;
|
|||
|
|
|||
|
|
|||
|
private void OnTriggerEnter(Collider other)
|
|||
|
{
|
|||
|
if (other.gameObject.CompareTag("Smiley"))
|
|||
|
{
|
|||
|
OnEnterSmiley?.Invoke();
|
|||
|
Destroy(other.gameObject);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|