This commit is contained in:
CortexCore
2023-10-06 23:43:19 +08:00
parent ebf9c1f526
commit 2c4710bc5d
186 changed files with 111802 additions and 764 deletions

View File

@@ -12,16 +12,12 @@ namespace BITKit.UX
[Header(Constant.Header.Events)]
public UnityEvent onClick = new();
public UnityEvent onRightClick = new();
[SerializeField] private BITKit.Events.UnityEvent clicked=new();
public override void OnStart()
{
try
{
visualElement.clicked += Click;
}
catch (System.Exception)
{
throw;
}
if (allowRightClick)
{
foreach (var x in visualElement.Children())
@@ -38,18 +34,19 @@ namespace BITKit.UX
base.Set(active);
visualElement.SetEnabled(active);
}
void Click()
private void Click()
{
onClick.Invoke();
clicked.Invoke();
}
void OnMouseDown(MouseDownEvent mouseEvent)
private void OnMouseDown(MouseDownEvent mouseEvent)
{
if (mouseEvent.button is 1)
{
onRightClick.Invoke();
}
}
void OnMouseUp(MouseUpEvent mouseEvent)
private void OnMouseUp(MouseUpEvent mouseEvent)
{
}