|
@@ -43,22 +43,21 @@ namespace SicknessReduction.Visual.Vignetting
|
|
|
if (!blitFeatureAvailable) return;
|
|
|
base.Update();
|
|
|
|
|
|
- var correctedRestriction = Mathf.Clamp(currentValue + change, 0, 1);
|
|
|
-
|
|
|
- if (correctedRestriction > 0f)
|
|
|
+ if (currentValue > 0)
|
|
|
{
|
|
|
blitFeature.SetActive(true);
|
|
|
- UpdateMaterial(correctedRestriction);
|
|
|
- return;
|
|
|
+ UpdateMaterial();
|
|
|
}
|
|
|
-
|
|
|
- blitFeature.SetActive(false);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ blitFeature.SetActive(false);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- private void UpdateMaterial(float restriction)
|
|
|
+ private void UpdateMaterial()
|
|
|
{
|
|
|
- currentValue = restriction;
|
|
|
- var r = Mathf.Clamp(1 - restriction, 0, 1);
|
|
|
+ var r = Mathf.Clamp(1 - currentValue, 0, 1);
|
|
|
blitFeatureMaterial.SetFloat("_OFOV", r);
|
|
|
blitFeatureMaterial.SetFloat("_IFOV", Mathf.Clamp(r - distInnerOuterRadius, 0, 1));
|
|
|
}
|