16 lines
358 B
C#
16 lines
358 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class TipperTrigger : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField] GameObject[] tippers;
|
||
|
|
void OnTriggerEnter(Collider other)
|
||
|
|
{
|
||
|
|
if(other.gameObject.tag == "Player")
|
||
|
|
{
|
||
|
|
foreach (GameObject tipper in tippers)
|
||
|
|
tipper.GetComponent<Tipper>().TipObject();
|
||
|
|
}
|
||
|
|
Destroy(gameObject);
|
||
|
|
}
|
||
|
|
}
|