Golf2D/Assets/Scripts/Hole.cs
2023-05-20 13:49:50 +05:30

23 lines
541 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Hole : MonoBehaviour
{
public void OnTriggerEnter2D(Collider2D other){
if(other.tag == "Player"){
Debug.Log(other.name + " Entered hole");
GameManager.Hole(transform.position);
}
}
public void OnTriggerExit2D(Collider2D other){
if(other.tag == "Player"){
Debug.Log(other.name + " Exited hole");
GameManager.CancelHole();
}
}
}