2025-07-08 10:46:31 +00:00
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
namespace Superlazy.UI
|
|
|
|
|
{
|
|
|
|
|
public class SLUIDragClickTarget : SLUIComponent
|
|
|
|
|
{
|
|
|
|
|
public SLValueComparison comparison;
|
|
|
|
|
|
|
|
|
|
private Button button;
|
|
|
|
|
|
|
|
|
|
protected override void Validate()
|
|
|
|
|
{
|
|
|
|
|
button = GetComponent<Button>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Init()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Enable()
|
|
|
|
|
{
|
|
|
|
|
//if (comparison.useCheckValue) comparison.OnEnable(bindParent.BindPath, OnChange);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Disable()
|
|
|
|
|
{
|
|
|
|
|
//if (comparison.useCheckValue) comparison.OnDisable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool CanClick()
|
|
|
|
|
{
|
|
|
|
|
if (comparison.useCheckValue && comparison.Result == false) return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Click()
|
|
|
|
|
{
|
|
|
|
|
button.onClick.Invoke();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|