示例#1
0
        private IEnumerator ChangeAIPaths(float time, UnityStandardAssets.Utility.WaypointCircuit wc,
                                          CarAIControl ai)
        {
            yield return(new WaitForSeconds(time));

            ai.switchCircuit(wc, 0);
        }
示例#2
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;
            }
        }
示例#3
0
		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 ();					
			}
		}
示例#4
0
		private IEnumerator ChangeAIPaths (float time, UnityStandardAssets.Utility.WaypointCircuit wc,
			CarAIControl ai)
		{
			yield return new WaitForSeconds (time);
			ai.switchCircuit(wc, 0);
		}