private void OnDestroy()
        {
            if (instance == this)
            {
                instance = null;
            }

            ClearCars();
        }
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
 }
예제 #3
0
 public override float length(float lane)
 {
     return(Highway.curvePieceLength(lane));
 }
예제 #4
0
 public bool IsInLane(float lane)
 {
     return(Highway.LanesOverlap(lane, this.lane));
 }