private void Awake() { var uiManager = GameObject.FindGameObjectWithTag("OnScreenUI"); if (uiManager == null) { throw new MissingReferenceException("Missing reference to the UI manager."); } inGameScreenManager = uiManager.GetComponentInChildren <InGameScreenManager>(true); if (inGameScreenManager == null) { throw new MissingReferenceException("Missing reference to the in game screen manager."); } healthBarController = inGameScreenManager.GetComponentInChildren <HealthBarController>(true); postProcessObject = GameObject.FindGameObjectWithTag("PostProcessing"); if (postProcessObject == null) { throw new MissingReferenceException("Missing reference to the post process object."); } var volume = postProcessObject.GetComponent <PostProcessVolume>(); volume.profile.TryGetSettings(out damageVolumeSettings); }
private void Awake() { screenUIController = GameObject.Find("OnScreenUI").GetComponent <ScreenUIController>(); healthBarController = screenUIController.GetComponentInChildren <HealthBarController>(true); postProcessObject = GameObject.FindGameObjectWithTag("PostProcessing"); if (postProcessObject != null) { var volume = postProcessObject.GetComponent <PostProcessVolume>(); volume.profile.TryGetSettings(out damageVolumeSettings); } }