Okay I have looked at it and I think I have it most of the way worked out. But I might be having a problem with uicamera.notify now. Currently when I have clicked on a ui element with the mouse I can activate it as many times as I want, even though my UICamera.selectedObject is being changed on every raycast.
void Awake()
{
UICamera.onCustomInput = NGUIinput;
}
void NGUIinput()
{
if(hintButtonDown)
{
print("hit object " + UICamera.selectedObject);
UICamera.Notify(UICamera.selectedObject, "onKey", KeyCode.Mouse0);
}
}
void Update ()
{
if(hintButtonDown)
{
UICamera.selectedObject = UICamera.Raycast(new Vector3(cursorX, (Screen.height - ursorSystem.Instance.cursorY)), ref cursorHit) ? cursorHit.collider.gameObject : fallThrough;
}
}
with that trimmed down code and some print statements I can see that i'm accurately raycasting to ngui elements and hitting them, my customInput function won't actually "click" them unless a mouse has clicked them. Thanks in advance.