OnClickListener added but on vacation?
Shouldn't this atleast show a log when you click? right now I just get the listener added, I'm a bit confused.
using UnityEngine.Events;
UnityEvent OnMouseClick = new UnityEvent();
private void Awake()
{
OnMouseClick.AddListener(DestroyCheck);
Debug.Log("MouseClick Listener Added");
}
void DestroyCheck()
{
if (Input.GetMouseButtonDown(0))
Debug.Log("MouseButtonDown(0)");
}
Comment
I don't understand what you are expecting.
You just have created an event, and added a listener to it. If you don't invoke the event, DestroyCheck
will never be called.