You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Driftology/Assets/Scripts/FinishLine.cs

16 lines
365 B
C#

using UnityEngine;
public class FinishLine : MonoBehaviour
{
public RaceManager raceManager;
private void OnTriggerEnter(Collider other)
{
VehicleController car = other.GetComponentInParent<VehicleController>();
if (car != null && !raceManager.HasFinished(car))
{
raceManager.RegisterFinish(car);
}
}
}