Example #1
0
        private void Awake()
        {
            // get the car controller
            m_Car = GetComponent<CarController>();

            //get the steering wheel controller
            m_SteeringWheel = GetComponentInChildren<VisualSteeringWheelController>();
        }
		void Awake ()
		{
			Initialize<States> ();
		
			carController = UserCar.GetComponent<CarController> ();
			carController.MaxSpeed = 15f;
			carAI = UserCar.GetComponent<CarAIControl> ();
			sensitiveSensorResponseHandler = UserCar.GetComponent<SensitiveSensorResponseHandler> ();
			trashCanSensorResponseHandler = UserCar.GetComponent<TrashcanSensorResponseHandler> ();

			crazyAI = CrazyIntersectionAI.GetComponent<CarAIControl> ();
			crazyCarController = CrazyIntersectionAI.GetComponent<CarController> ();

			hudController = UserCar.GetComponentInChildren<HUDController> ();
			audioController = UserCar.GetComponentInChildren<HUDAudioController> ();
			ambientAudioSource = GameObject.FindWithTag (VRAVEStrings.Ambient_Audio).GetComponent<AudioSource>();
			ambientAudioSource.mute = true;
			hudAsyncController = UserCar.GetComponentInChildren<HUDAsyncController> ();

			mirror = GameObject.FindWithTag (VRAVEStrings.Mirror);
			audioController.audioModel = GameObject.FindObjectOfType<ReactionTimeAudioModel> ();

			// configure HUD models
			hudController.models = new HUDModel[2];
			hudController.durations = new float[2];
			hudController.models[0] = new HUDVRAVE_Default();
			hudController.model = hudController.models[0];

			// configure ASYNC controller
			hudAsyncController.Configure(audioController, hudController);

			unsuspectingCarAI = UnsuspectingAI.GetComponent<CarAIControl> ();

			foreach (GameObject o2 in triggers) {
				o2.SetActive(false);
			}
				
			resetIntersectionScenario ();

			//resetTrashCanScenario();

			//ChangeState (States.TrashcanBriefing);
			ChangeState (States.IntersectionBriefing);
			//ChangeState(States.AIDrivingToTrashcanBriefing);


			cameraFade.StartAlphaFade (Color.black, true, 3f, () => {
				audioController.playAudio (3);
				StartCoroutine (PostIntersectionScenarioBriefingHUDChange());
			});

		}
Example #3
0
        void Awake()
        {
			cameraFade.StartAlphaFade (Color.black, true, 2f);

            Initialize<States>();

            userCarController = UserCar.GetComponent<CarController>();
            userCarController.MaxSpeed = 20f;
            userCarAI = UserCar.GetComponent<CarAIControl>();
            userCarAI.enabled = false;
            UserCar.GetComponent<CarUserControl>().enabled = false;


            AIVehicleCarController = AIVehicle.GetComponent<CarController>();
            AIVehicleCarController.MaxSpeed = 15;
            AIVehicleAI = AIVehicle.GetComponent<CarAIControl>();
            AIVehicleAI.enabled = false;
            (AIVehicle.GetComponent("Halo") as Behaviour).enabled = false;

            hudController = UserCar.GetComponentInChildren<HUDController>();
			hudAsyncController = UserCar.GetComponentInChildren<HUDAsyncController>();
			audioController = UserCar.GetComponentInChildren<HUDAudioController>();
			ambientAudioSource = GameObject.FindWithTag (VRAVEStrings.Ambient_Audio).GetComponent<AudioSource>();

            lanePassingHandler = UserCar.GetComponent<LanePassingSensorResponseHandler>();
            lanePassingHandler.Enable = false;
            followHandler = UserCar.GetComponent<FollowingSensorResponseHandler>();

			// configure HUD models
			hudController.models = new HUDModel[2];
			hudController.durations = new float[2];
			hudController.models[0] = new HUDVRAVE_Default();
			hudController.model = hudController.models[0];

			// configure ASYNC controller
			hudAsyncController.Configure(audioController, hudController);

			//configure audio
			audioController.audioModel = GameObject.FindObjectOfType<LanePassingAudioModel>();
			ambientAudioSource.mute = true;

			userMode = true;

            UserCar.SetActive(true);
            AIVehicle.SetActive(true);
			
            mirror = GameObject.FindWithTag(VRAVEStrings.Mirror);
			ChangeState(States.InitState);


        }
Example #4
0
    private CarController m_Car; // the car controller we want to use

	// Use this for initialization
	void Start () {
        m_Car = GetComponentInParent<CarController>();
	}
Example #5
0
		/* Awake */

		private void Awake ()
		{
			m_CarController = GetComponent<CarController> ();
			m_Rigidbody = GetComponent<Rigidbody> ();
			m_SteeringWheel = GetComponentInChildren<VisualSteeringWheelController> ();
			m_Sensors = GetComponent<Sensors> ();
			m_sensorResponseHandlers = GetComponents<SensorResponseHandler> ();
			IsAvoidingObstacle = false;
			ObstacleAvoidanceSteerAmount = 1f;

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

			if (m_isUser) {
				IsUser = true;
			}

			progressNum = 0;
			SetTarget (circuit.Waypoints [progressNum], false);
		}