- Home /
Question by
Ky6eH · Aug 29, 2020 at 04:58 PM ·
c#cameracolor changeautomaticcorrection
How to turn off or turn on Shadows Midtones Highlights CC from code?
Hi everyone! Can you help me? How can I switch off this value from code?
That's piece of my code now:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class Player : MonoBehaviour
{
public Volume volume;
public void Start()
{
ShadowsMidtonesHighlights _smh = null;
if (volume.profile.TryGet<ShadowsMidtonesHighlights>(out _smh))
{
_smh.enabled.value = false;
}
}
}
unity-cc.png
(25.5 kB)
Comment
Best Answer
Answer by Ky6eH · Aug 30, 2020 at 12:04 AM
I found a solution. In new versions, access to this parameter is as follows:
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public Volume volume;
if (volume.profile.TryGet(out ShadowsMidtonesHighlights _smh))
{
_smh.active = !_smh.IsActive();
}