Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: mindlube on December 25, 2012, 02:07:16 PM
-
I dont know if this is possible - it's certainly beyond my C# skills. It would be great to be able to do a generic event listener. This would save a lot of gameobject.GetComponent<T>() lookups in all my event listeners.
UIEventListener.Get<T>( T ).onDrag = MyOnDrag;
...
public void MyOnDrag( T obj, Vector2 delta)
{
}
And so on for the others in UIEventListener
-
You mean like UICamera.genericEventHandler? That object (if set) receives a copy of all your events.