mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-23 08:38:23 -05:00
23 lines
469 B
C#
23 lines
469 B
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
namespace UnityAtoms
|
|||
|
{
|
|||
|
public class OnButtonClickHook : VoidHook
|
|||
|
{
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
GetComponent<Button>().onClick.AddListener(OnClick);
|
|||
|
}
|
|||
|
|
|||
|
private void OnDestroy()
|
|||
|
{
|
|||
|
GetComponent<Button>().onClick.RemoveListener(OnClick);
|
|||
|
}
|
|||
|
|
|||
|
private void OnClick()
|
|||
|
{
|
|||
|
OnHook(new Void());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|