Init() private method

private Init ( Object targetObj, Rect activatorRect, bool showLabelIcons ) : void
targetObj Object
activatorRect UnityEngine.Rect
showLabelIcons bool
return void
示例#1
0
        // Returns true if shown
        internal static bool ShowAtPosition(Object targetObj, Rect activatorRect, bool showLabelIcons)
        {
            int instanceID = targetObj.GetInstanceID();
            // We could not use realtimeSinceStartUp since it is resetted when entering 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 (instanceID != s_LastInstanceID || !justClosed)
            {
                Event.current.Use();
                s_LastInstanceID = instanceID;
                if (s_IconSelector == null)
                {
                    s_IconSelector = ScriptableObject.CreateInstance <IconSelector>();
                }
                s_IconSelector.Init(targetObj, activatorRect, showLabelIcons);
                return(true);
            }

            return(false);
        }