using UnityEngine; using UnityEngine.UI; public class BTN_OptionsMotionBlur : MonoBehaviour { [HideInInspector] public Toggle toggle; private RenderSettingsMy renderSettings; private void OnEnable() { if (toggle == null) { toggle = GetComponent(); } if ((bool)GlobalSettings.Instance) { renderSettings = GlobalSettings.Instance.renderSettings; toggle.isOn = renderSettings.useMotionBlur; } } public void ValueChanged() { if ((bool)renderSettings) { renderSettings.useMotionBlur = toggle.isOn; renderSettings.RefreshPostprocesses(); } } }