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