yyl
2026-04-03 99a11d2bb19d74f6cc8584ac16838062af4fb301
Main/Utility/UGUIEventListenerContainDrag.cs
@@ -28,12 +28,28 @@
    //是否处于按下状态 与长按配合使用
    bool isDown = false;
    float time = 0;
    private Button _cachedButton;
    private bool _buttonCached;
    private Button CachedButton
    {
        get
        {
            if (!_buttonCached)
            {
                _cachedButton = GetComponent<Button>();
                _buttonCached = true;
            }
            return _cachedButton;
        }
    }
    public void OnPointerClick(PointerEventData eventData)
    {
        if (OnClick != null)
        {
            if (!GetComponent<Button>() || GetComponent<Button>().interactable)
            if (!CachedButton || CachedButton.interactable)
            {
                OnClick(gameObject);
            }