void Start() { plCam = GetComponent <OcPlCam>(); cam = GetComponent <Camera>(); head = FindObjectOfType <OcPlHeadPrefabSetting>(); var volume = FindObjectOfType <PostProcessVolume>(); var master = plCam.GetRefField <OcPlCam, OcPlMaster>("_Owner"); var playername = Settings.getPlayerName(master); if (Settings.ReadBool(playername, "UseBloom", false)) { bloom = volume.profile.GetSetting <Bloom>(); bloom.enabled.value = true; bloom.active = true; bloom.threshold.value = Settings.ReadFloat(playername, "BloomThreshold", 0.2f); bloom.intensity.value = Settings.ReadFloat(playername, "BloomIntensity", 0.5f); } if (Settings.ReadBool(playername, "UseAmbientOcclusion", false)) { ambientOcclusion = volume.profile.GetSetting <AmbientOcclusion>(); ambientOcclusion.enabled.value = true; ambientOcclusion.active = true; ambientOcclusion.intensity.value = Settings.ReadFloat(playername, "AmbientOcclusionInteisity", 1.0f); ambientOcclusion.thicknessModifier.value = 1.0f; ambientOcclusion.directLightingStrength.value = 1.0f; } if (Settings.ReadBool(playername, "UseVignette", false)) { vignette = volume.profile.GetSetting <Vignette>(); vignette.enabled.value = true; vignette.active = true; vignette.intensity.value = 0.45f; vignette.smoothness.value = 0.15f; vignette.roundness.value = 0.0f; } enableAdjustDoF = Settings.ReadBool(playername, "AdjustDoF", true); distanceRate = Settings.ReadFloat(playername, "CameraDistanceRate", 1.0f); basePos = plCam.SoCam.CamOfs_Base; swordPos = plCam.SoCam.CamOfs_Sword; sprintPos = plCam.SoCam.CamOfs_SprintStraight; swimPos = plCam.SoCam.CamOfs_Swim; jumpPos = plCam.SoCam.CamOfs_Jump; }
static void Postfix(OcPlCam __instance) { __instance.gameObject.GetOrAddComponent <AdjustPlCam>(); }