Пример #1
0
 void DoLayersDropDown(Rect rect)
 {
     if (EditorGUI.DropdownButton(rect, s_LayerContent, FocusType.Passive, Styles.dropdown))
     {
         if (LayerVisibilityWindow.ShowAtPosition(rect))
         {
             GUIUtility.ExitGUI();
         }
     }
 }
 internal static bool ShowAtPosition(Rect buttonRect)
 {
   if (DateTime.Now.Ticks / 10000L < LayerVisibilityWindow.s_LastClosedTime + 50L)
     return false;
   Event.current.Use();
   if ((UnityEngine.Object) LayerVisibilityWindow.s_LayerVisibilityWindow == (UnityEngine.Object) null)
     LayerVisibilityWindow.s_LayerVisibilityWindow = ScriptableObject.CreateInstance<LayerVisibilityWindow>();
   LayerVisibilityWindow.s_LayerVisibilityWindow.Init(buttonRect);
   return true;
 }
Пример #3
0
        private void DoLayersDropDown(Rect rect)
        {
            GUIStyle style = "DropDown";

            if (EditorGUI.DropdownButton(rect, Toolbar.s_LayerContent, FocusType.Passive, style))
            {
                if (LayerVisibilityWindow.ShowAtPosition(rect))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }
Пример #4
0
        private void DoSpecialLayer(Rect rect, bool all, ref bool even)
        {
            bool visible = (Tools.visibleLayers & this.m_AllLayersMask) == (!all ? 0 : this.m_AllLayersMask);
            bool visibleChanged;
            bool lockedChanged;

            this.DoLayerEntry(rect, !all ? "Nothing" : "Everything", even, true, false, visible, false, out visibleChanged, out lockedChanged);
            if (visibleChanged)
            {
                Tools.visibleLayers = !all ? 0 : -1;
                LayerVisibilityWindow.RepaintAllSceneViews();
            }
            even = !even;
        }
Пример #5
0
 internal static bool ShowAtPosition(Rect buttonRect)
 {
     if (DateTime.Now.Ticks / 10000L < LayerVisibilityWindow.s_LastClosedTime + 50L)
     {
         return(false);
     }
     Event.current.Use();
     if ((UnityEngine.Object)LayerVisibilityWindow.s_LayerVisibilityWindow == (UnityEngine.Object)null)
     {
         LayerVisibilityWindow.s_LayerVisibilityWindow = ScriptableObject.CreateInstance <LayerVisibilityWindow>();
     }
     LayerVisibilityWindow.s_LayerVisibilityWindow.Init(buttonRect);
     return(true);
 }
Пример #6
0
        private void DoLayersDropDown()
        {
            GUIStyle style = "DropDown";
            Rect     rect  = GUILayoutUtility.GetRect(Toolbar.s_LayerContent, style);

            if (EditorGUI.ButtonMouseDown(rect, Toolbar.s_LayerContent, FocusType.Passive, style))
            {
                Rect last = GUILayoutUtility.topLevel.GetLast();
                if (LayerVisibilityWindow.ShowAtPosition(last))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }
		internal static bool ShowAtPosition(Rect buttonRect)
		{
			long num = DateTime.Now.Ticks / 10000L;
			if (num >= LayerVisibilityWindow.s_LastClosedTime + 50L)
			{
				Event.current.Use();
				if (LayerVisibilityWindow.s_LayerVisibilityWindow == null)
				{
					LayerVisibilityWindow.s_LayerVisibilityWindow = ScriptableObject.CreateInstance<LayerVisibilityWindow>();
				}
				LayerVisibilityWindow.s_LayerVisibilityWindow.Init(buttonRect);
				return true;
			}
			return false;
		}
Пример #8
0
        private void DoSpecialLayer(Rect rect, bool all, ref bool even)
        {
            int  visibleLayers = Tools.visibleLayers;
            int  num           = (!all) ? 0 : this.m_AllLayersMask;
            bool visible       = (visibleLayers & this.m_AllLayersMask) == num;
            bool flag;
            bool flag2;

            this.DoLayerEntry(rect, (!all) ? "Nothing" : "Everything", even, true, false, visible, false, out flag, out flag2);
            if (flag)
            {
                Tools.visibleLayers = ((!all) ? 0 : -1);
                LayerVisibilityWindow.RepaintAllSceneViews();
            }
            even = !even;
        }
Пример #9
0
        internal static bool ShowAtPosition(Rect buttonRect)
        {
            long num = DateTime.Now.Ticks / 10000L;

            if (num >= LayerVisibilityWindow.s_LastClosedTime + 50L)
            {
                Event.current.Use();
                if (LayerVisibilityWindow.s_LayerVisibilityWindow == null)
                {
                    LayerVisibilityWindow.s_LayerVisibilityWindow = ScriptableObject.CreateInstance <LayerVisibilityWindow>();
                }
                LayerVisibilityWindow.s_LayerVisibilityWindow.Init(buttonRect);
                return(true);
            }
            return(false);
        }
Пример #10
0
        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);
        }
Пример #11
0
        private void DoOneLayer(Rect rect, int index, ref bool even)
        {
            int  visibleLayers = Tools.visibleLayers;
            int  lockedLayers  = Tools.lockedLayers;
            int  num           = 1 << this.s_LayerMasks[index];
            bool visible       = (visibleLayers & num) != 0;
            bool locked        = (lockedLayers & num) != 0;
            bool flag;
            bool flag2;

            this.DoLayerEntry(rect, this.s_LayerNames[index], even, true, true, visible, locked, out flag, out flag2);
            if (flag)
            {
                Tools.visibleLayers ^= num;
                LayerVisibilityWindow.RepaintAllSceneViews();
            }
            if (flag2)
            {
                Tools.lockedLayers ^= num;
            }
            even = !even;
        }
		internal void OnDisable()
		{
			LayerVisibilityWindow.s_LastClosedTime = DateTime.Now.Ticks / 10000L;
			LayerVisibilityWindow.s_LayerVisibilityWindow = null;
		}
Пример #13
0
 internal void OnDisable()
 {
     s_LastClosedTime        = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond;
     s_LayerVisibilityWindow = null;
 }
Пример #14
0
 internal void OnDisable()
 {
     LayerVisibilityWindow.s_LastClosedTime        = DateTime.Now.Ticks / 10000L;
     LayerVisibilityWindow.s_LayerVisibilityWindow = null;
 }
 internal void OnDisable()
 {
     s_LastClosedTime        = DateTime.Now.Ticks / 0x2710L;
     s_LayerVisibilityWindow = null;
 }
 internal void OnDisable()
 {
     s_LastClosedTime = DateTime.Now.Ticks / 0x2710L;
     s_LayerVisibilityWindow = null;
 }
Пример #17
0
        private void DoLayersDropDown(Rect rect)
        {
            GUIStyle style = (GUIStyle)"DropDown";

            if (!EditorGUI.ButtonMouseDown(rect, Toolbar.s_LayerContent, FocusType.Passive, style) || !LayerVisibilityWindow.ShowAtPosition(rect))
            {
                return;
            }
            GUIUtility.ExitGUI();
        }