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.
16 lines
365 B
C#
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);
|
|
}
|
|
}
|
|
}
|