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());
			});

		}
Beispiel #2
0
        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());
            });
        }