Initial
This commit is contained in:
commit
36a53f343e
1 changed files with 300431 additions and 0 deletions
22
UnityProject/Assets/Scripts/misc/safeSpace.cs
Normal file
22
UnityProject/Assets/Scripts/misc/safeSpace.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue