private IEnumerator ChangeAIPaths(float time, UnityStandardAssets.Utility.WaypointCircuit wc, CarAIControl ai) { yield return(new WaitForSeconds(time)); ai.switchCircuit(wc, 0); }
/* WaitToPass */ public void WaitToPass_Enter() { if (userMode) { (UserCar.GetComponent <CarUserControl>() as CarUserControl).enabled = true; userCarAI.enabled = false; } else { (UserCar.GetComponent <CarUserControl>() as CarUserControl).enabled = false; circuitProgressNum = Mathf.CeilToInt((userCarAI.ProgressNum - 3) / 4) * 4 + 3; //Rounds the waypoints up to multiples of 3+4n userCarAI.switchCircuit(UserTrack, circuitProgressNum); userCarAI.IsCircuit = true; userCarAI.enabled = true; userCarController.MaxSpeed = AIVehicleCarController.MaxSpeed + 0.6f; } }
private IEnumerator ChangeAIPaths (float time, UnityStandardAssets.Utility.WaypointCircuit wc, CarAIControl ai, Action postPathChange) { yield return new WaitForSeconds (time); ai.switchCircuit(wc, 0); if (postPathChange != null) { postPathChange (); } }
private IEnumerator ChangeAIPaths (float time, UnityStandardAssets.Utility.WaypointCircuit wc, CarAIControl ai) { yield return new WaitForSeconds (time); ai.switchCircuit(wc, 0); }