static public int initRectCheck_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 LTGUI.initRectCheck(); pushValue(l, true); return(1); } 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 hasNoOverlap(Rect rect, int depth) { LTGUI.initRectCheck(); bool result = true; bool flag = false; for (int i = 0; i < LTGUI.buttonLevels.Length; i++) { if (LTGUI.buttonLevels[i] >= 0) { if (LTGUI.buttonLastFrame[i] + 1 < Time.frameCount) { LTGUI.buttonLevels[i] = -1; } else if (LTGUI.buttonLevels[i] > depth && LTGUI.pressedWithinRect(LTGUI.buttons[i])) { result = false; } } if (!flag && LTGUI.buttonLevels[i] < 0) { flag = true; LTGUI.buttonLevels[i] = depth; LTGUI.buttons[i] = rect; LTGUI.buttonLastFrame[i] = Time.frameCount; } } return(result); }
static public int initRectCheck_s(IntPtr l) { try { LTGUI.initRectCheck(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }