void Start() { PlayerReference pRef = GeneralVariables.playerRef; pm = GeneralVariables.player.GetComponent <PlayerMovement>(); wm = pRef.wm; dm = pRef.dm; pl = pm.GetComponent <PlayerLook>(); pv = pm.GetComponent <PlayerVitals>(); vc = GetComponent <VignettingC>(); wdof = GetComponent <WeaponDepthOfField>(); cb = pRef.cb; acs = pRef.acs; ia = pRef.ia; GetComponent <Camera>().fieldOfView = (float)GameSettings.settingsController.FOV; cachedTr.localPosition = Vector3.zero; lastUnAim = -0.25f; lastAim = -0.25f; lastShake = -100f; }
private void UpdatePostProcess() { foreach (Camera cam in Camera.allCameras) { SMAA defAntiAlias = cam.GetComponent <SMAA>(); Bloom b = cam.GetComponent <Bloom>(); BloomAndFlares baf = cam.GetComponent <BloomAndFlares>(); ContrastEnhance ce = cam.GetComponent <ContrastEnhance>(); MotionBlur mb = cam.GetComponent <MotionBlur>(); WeaponDepthOfField wdof = cam.GetComponent <WeaponDepthOfField>(); SunShafts ss = cam.GetComponent <SunShafts>(); AmplifyOcclusionEffect ao = cam.GetComponent <AmplifyOcclusionEffect>(); ColorCorrection ccc = cam.GetComponent <ColorCorrection>(); if (defAntiAlias) { defAntiAlias.enabled = (antiAliasing == 1); } if (wdof) { wdof.enabled = (wDepthOfField == 1); } bool bloomBool = (bloom == 1); if (baf) { baf.enabled = bloomBool; } if (b) { b.enabled = bloomBool; } if (ss) { ss.enabled = (sunShafts == 1); } if (mb) { mb.enabled = (motionBlur == 1); } bool ssaoBool = (SSAO == 1); if (ao) { ao.enabled = ssaoBool; } bool ccBool = (colorCorrection == 1); if (ccc) { ccc.enabled = ccBool; } if (ce) { ce.enabled = ccBool; } } lastPP = Time.unscaledTime; cameraCount = Camera.allCameras.Length; }