using System; using UnityEngine; [RequireComponent(typeof(Collider2D))] public class Wheel : MonoBehaviour { public Action wheelOffRoad; public Action wheelOnRoad; private void OnTriggerExit2D(Collider2D other) { wheelOffRoad?.Invoke(); } private void OnTriggerEnter2D(Collider2D other) { wheelOnRoad?.Invoke(); } }