internal static bool ShowAtPosition(Rect buttonRect) { // We could not use realtimeSinceStartUp since it is set to 0 when entering/exitting playmode, we assume an increasing time when comparing time. long nowMilliSeconds = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond; bool justClosed = nowMilliSeconds < s_LastClosedTime + 50; if (!justClosed) { Event.current.Use(); if (s_LayerVisibilityWindow == null) { s_LayerVisibilityWindow = CreateInstance <LayerVisibilityWindow>(); } s_LayerVisibilityWindow.Init(buttonRect); return(true); } return(false); }