22 lines
486 B
C#
22 lines
486 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/* Megfelelő safeSpace-k elhelyezésével lehet figyelni, hogy adott pozicíóban van-e még szabad helye egy új autónak.
|
|
*/
|
|
|
|
public class safeSpace : MonoBehaviour {
|
|
public int roadID;
|
|
|
|
public TrafficController traffic;
|
|
|
|
void OnTriggerEnter ()
|
|
{
|
|
traffic.roads[roadID].isThereSpace = false;
|
|
}
|
|
void OnTriggerExit ()
|
|
{
|
|
traffic.roads[roadID].isThereSpace = true;
|
|
}
|
|
|
|
}
|