﻿namespace JLGames.RocketDriver.Actions.Extensions
{
    public static class ExtUIElementToggle
    {
        public static void SetValue(this UnityEngine.UIElements.Toggle toggle, bool newValue, bool notify = false)
        {
            if (toggle.value == newValue) return;
            if (notify)
            {
                toggle.value = newValue;
            }
            else
            {
                toggle.SetValueWithoutNotify(newValue);
            }
        }
    }
}