Thanks, I am using NGUI's event system(why reinvent the wheel?) for my game camera so was going to use their position variables for getting where on the screen the user touched.
When I played with it I was having some trouble with UICamera.lastTouchPosition so I changed to using UICamera.lastHit instead and this seems to be working better, see below:
using UnityEngine;
using HutongGames.PlayMaker;
[ActionCategory("NGUI")]
[Tooltip("Last raycast hit prior to sending out the event. This is useful if you want detailed information about what was actually hit in your OnClick, OnHover, and other event functions.")]
public class UICameraLastHit : FsmStateAction
{
[Tooltip("Returns the last raycast hit point from UICamera.")]
public FsmVector3 pointLastHit;
public override void Reset ()
{
pointLastHit = new FsmVector3 { UseVariable = true };
}
public override void OnEnter()
{
DoAction();
Finish();
}
void DoAction() {
pointLastHit.Value = UICamera.lastHit.point;
}
}