Esempio n. 1
0
        void Awake()
        {
            Initialize <States> ();

            UserCar.GetComponent <CarAIControl> ().enabled   = false;
            UserCar.GetComponent <CarUserControl> ().enabled = true;

            spawnController = GetComponent <SpawnController>();
            hudController   = UserCar.GetComponentInChildren <HUDController>();
            audioController = UserCar.GetComponentInChildren <HUDAudioController> ();


            ambientAudioSource      = GameObject.FindGameObjectWithTag(VRAVEStrings.Ambient_Audio).GetComponent <AudioSource>();
            ambientAudioSource.mute = true;

            hudController.models    = new HUDModel[2];
            hudController.durations = new float[2];

            hudAsyncController = UserCar.GetComponentInChildren <HUDAsyncController> ();
            hudAsyncController.Configure(audioController, hudController);

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

            spawnModel = new WeatherSpawnModel();
            spawnController.spawnModel = spawnModel;

            //hudController.model = new DefaultHUD ();

            UserCar.GetComponent <CarAIControl> ().enabled   = false;
            UserCar.GetComponent <CarUserControl> ().enabled = false;

            movingAI0.GetComponent <CarAIControl> ().enabled = false;
            movingAI1.GetComponent <CarAIControl> ().enabled = false;
            movingAI2.GetComponent <CarAIControl> ().enabled = false;
            movingAI3.GetComponent <CarAIControl> ().enabled = false;

            movingAIStart0 = new KeyValuePair <Vector3, Quaternion> (movingAI0.transform.position, movingAI0.transform.rotation);
            movingAIStart1 = new KeyValuePair <Vector3, Quaternion> (movingAI1.transform.position, movingAI1.transform.rotation);
            movingAIStart2 = new KeyValuePair <Vector3, Quaternion> (movingAI2.transform.position, movingAI2.transform.rotation);
            movingAIStart3 = new KeyValuePair <Vector3, Quaternion> (movingAI3.transform.position, movingAI3.transform.rotation);

            spawnController.enterScenario();

            /*foreach(GameObject nonMovingAICar in spawnController.initialSpawnedObjects.Values) {
             *      nonMovingAICar.GetComponent<CarAIControl> ().enabled = false;
             *      nonMovingAICar.GetComponent<CarAIControl> ().Circuit = movingAI0.GetComponent<CarAIControl> ().Circuit;
             * }*/

            resetScenario();
            ChangeState(States.ScenarioBriefing);

            cameraFade.StartAlphaFade(Color.black, true, 3f, () => {
                audioController.playAudio(3);
                StartCoroutine(PostIntersectionScenarioBriefingHUDChange());
            });
        }
Esempio n. 2
0
		void Awake()
		{
			Initialize<States> ();

			UserCar.GetComponent<CarAIControl> ().enabled = false;
			UserCar.GetComponent<CarUserControl> ().enabled = true;

			spawnController = GetComponent<SpawnController>();
			hudController = UserCar.GetComponentInChildren<HUDController>();
			audioController = UserCar.GetComponentInChildren<HUDAudioController> ();


			ambientAudioSource = GameObject.FindGameObjectWithTag(VRAVEStrings.Ambient_Audio).GetComponent<AudioSource>();
			ambientAudioSource.mute = true;

			hudController.models = new HUDModel[2];
			hudController.durations = new float[2];

			hudAsyncController = UserCar.GetComponentInChildren<HUDAsyncController> ();
			hudAsyncController.Configure(audioController, hudController);

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

			spawnModel = new WeatherSpawnModel ();
			spawnController.spawnModel = spawnModel;

			//hudController.model = new DefaultHUD ();

			UserCar.GetComponent<CarAIControl> ().enabled = false;
			UserCar.GetComponent<CarUserControl> ().enabled = false;

			movingAI0.GetComponent<CarAIControl> ().enabled = false;
			movingAI1.GetComponent<CarAIControl> ().enabled = false;
			movingAI2.GetComponent<CarAIControl> ().enabled = false;
			movingAI3.GetComponent<CarAIControl> ().enabled = false;

			movingAIStart0 = new KeyValuePair<Vector3, Quaternion> (movingAI0.transform.position, movingAI0.transform.rotation);
			movingAIStart1 = new KeyValuePair<Vector3, Quaternion> (movingAI1.transform.position, movingAI1.transform.rotation);
			movingAIStart2 = new KeyValuePair<Vector3, Quaternion> (movingAI2.transform.position, movingAI2.transform.rotation);
			movingAIStart3 = new KeyValuePair<Vector3, Quaternion> (movingAI3.transform.position, movingAI3.transform.rotation);

			spawnController.enterScenario ();

			/*foreach(GameObject nonMovingAICar in spawnController.initialSpawnedObjects.Values) {
				nonMovingAICar.GetComponent<CarAIControl> ().enabled = false;
				nonMovingAICar.GetComponent<CarAIControl> ().Circuit = movingAI0.GetComponent<CarAIControl> ().Circuit;
			}*/

			resetScenario ();
			ChangeState(States.ScenarioBriefing);

			cameraFade.StartAlphaFade (Color.black, true, 3f, () => {
				audioController.playAudio (3);
				StartCoroutine (PostIntersectionScenarioBriefingHUDChange ());
			});
		}
Esempio n. 3
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());
			});

		}
Esempio n. 4
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());
            });
        }
        // Use this for initialization
        void Start()
        {
            cityAudioModel = new HUDAudioModel();
            cityAudioModel.addClip("Urban-Ambient", 25f);

            cityAudioController = GetComponent <HUDAudioController> ();

            cityAudioController.primaryAudioSource = citySounds;

            cityAudioController.audioModel = cityAudioModel;

            cityAudioController.playAudio(0);
        }
		// Use this for initialization
		void Start ()
		{
			cityAudioModel = new HUDAudioModel ();
			cityAudioModel.addClip ("Urban-Ambient", 25f);

			cityAudioController = GetComponent<HUDAudioController> ();

			cityAudioController.primaryAudioSource = citySounds;

			cityAudioController.audioModel = cityAudioModel;

			cityAudioController.playAudio (0);
		}
Esempio n. 7
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);


        }
Esempio n. 8
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);
        }
Esempio n. 9
0
		// Use this for initialization
		void Start () {
			UserCar = gameObject;
			hudController = UserCar.GetComponentInChildren<HUDController>();
			audioController = UserCar.GetComponentInChildren<HUDAudioController>();
		}
Esempio n. 10
0
		// use GetComponentInParents<...> in your scenario
		public void Configure(HUDAudioController hudAC, HUDController hudC)
		{
			hudAudioController = hudAC;
			hudTextController = hudC;
		}
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     UserCar         = gameObject;
     hudController   = UserCar.GetComponentInChildren <HUDController>();
     audioController = UserCar.GetComponentInChildren <HUDAudioController>();
 }
Esempio n. 12
0
 // use GetComponentInParents<...> in your scenario
 public void Configure(HUDAudioController hudAC, HUDController hudC)
 {
     hudAudioController = hudAC;
     hudTextController  = hudC;
 }