void Update ()
{
if (keyCode == KeyCode.None || !IsModifierActive()) return;
if (action == Action.PressAndClick)
{
if (UICamera.inputHasFocus) return;
UICamera.currentTouch = UICamera.controller;
UICamera.currentScheme = UICamera.ControlScheme.Controller;
UICamera.currentTouch.current = gameObject;
if (Input.GetKeyDown(keyCode))
{
UICamera.Notify(gameObject, "OnPress", true);
}
if (Input.GetKeyUp(keyCode))
{
UICamera.Notify(gameObject, "OnPress", false);
UICamera.Notify(gameObject, "OnClick", null);
}
UICamera.currentTouch.current = null;
}
else if (action == Action.Select)
{
if (Input.GetKeyUp(keyCode))
{
if (mIsInput)
{
if (!mIgnoreUp && !UICamera.inputHasFocus)
{
UICamera.selectedObject = gameObject;
}
mIgnoreUp = false;
}
else
{
UICamera.selectedObject = gameObject;
}
}
}
}