Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/SRF/UI/Unselectable.cs
2026-02-21 16:45:37 +08:00

29 lines
581 B
C#

using UnityEngine;
using UnityEngine.EventSystems;
namespace SRF.UI
{
[AddComponentMenu("SRF/UI/Unselectable")]
public sealed class Unselectable : SRMonoBehaviour, ISelectHandler, IEventSystemHandler
{
private bool _suspectedSelected;
public void OnSelect(BaseEventData eventData)
{
_suspectedSelected = true;
}
private void Update()
{
if (_suspectedSelected)
{
if (EventSystem.current.currentSelectedGameObject == base.CachedGameObject)
{
EventSystem.current.SetSelectedGameObject(null);
}
_suspectedSelected = false;
}
}
}
}