public void Navigate() { this.GetComponentInChildren <DetectAhead>().enabled = true; this.GetComponentInChildren <Rigidbody>().isKinematic = false; this.GetComponent <CapsuleCollider>().enabled = true; navigator.enabled = true; parking.enabled = false; takeoff.enabled = false; navigator.SetTarget(GlobalAccess.GetRandomGarage()); }
void SpawnCar() { try { var spawnPoint = GlobalAccess.GetRandomGarage(); var car = Instantiate(HovercarPfs.PickOne(), spawnPoint.transform.position, spawnPoint.transform.rotation); car.transform.SetParent(traffic); spawnElapsed = SpawnTimer; car.GetComponent <AICoordinator>().TakeOff(spawnPoint); } catch (Exception e) { DebugConsole.LogMessage(e.Message); } }