Beispiel #1
0
 public bool CanDrive(Car.Driver driver)
 {
     if (roadDriveable == null)
     {
         return(false);
     }
     return(roadDriveable.CanDrive(driver));
 }
Beispiel #2
0
        public override bool CanDrive(Car.Driver driver)
        {
            Vector3 driverLeft   = -driver.transform.right;
            Vector3 startRaycast = transform.position + driver.transform.forward * Constante.Gameplay.roadSpace;

            startRaycast.y = driver.transform.position.y;

            if (Physics.Raycast(startRaycast, driverLeft, Constante.Gameplay.securityDistance * 10f, LayerMask.GetMask(Constante.Layer.Car)))
            {
                SDriverIn sDriver = new SDriverIn {
                    driver = driver,
                    time   = Time.time
                };
                driversIn.Add(sDriver);
                return(false);
            }
            driversIn.RemoveWhere(d => d.driver == driver);
            return(true);
        }
Beispiel #3
0
 public virtual bool CanDrive(Car.Driver driver)
 {
     return(true);
 }