static public int firstTouch_s(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif var ret = LTGUI.firstTouch(); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public static bool pressedWithinRect(Rect rect) { Vector2 vector = LTGUI.firstTouch(); if (vector.x < 0f) { return(false); } float num = (float)Screen.height - vector.y; return(vector.x > rect.x && vector.x < rect.x + rect.width && num > rect.y && num < rect.y + rect.height); }
static public int firstTouch_s(IntPtr l) { try { var ret = LTGUI.firstTouch(); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
public static bool pressedWithinRect(Rect rect) { Vector2 vector2 = LTGUI.firstTouch(); if (vector2.x < 0f) { return(false); } float single = (float)Screen.height - vector2.y; if (vector2.x <= rect.x || vector2.x >= rect.x + rect.width || single <= rect.y) { return(false); } return(single < rect.y + rect.height); }