Finished tutorial
This commit is contained in:
15
Assets/Scripts/TipperTrigger.cs
Normal file
15
Assets/Scripts/TipperTrigger.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user