/* * SPDX-License-Identifier: AGPL-3.0-or-later * Copyright (C) 2025 Sergej Görzen * This file is part of OmiLAXR. */ using UnityEngine.UI; namespace OmiLAXR.Extensions { /// /// Extension methods for Unity's Selectable UI components. /// Provides convenient methods for common UI interaction patterns. /// public static class SelectableExt { /// /// Enables or disables a selectable UI component with proper deselection. /// Ensures the component is properly deselected before changing its interactive state. /// /// The selectable component to modify /// True to disable the component, false to enable it public static void SetDisabled(this Selectable selectable, bool flag) { selectable.OnDeselect(null); selectable.interactable = !flag; } } }