diff options
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI')
6 files changed, 26 insertions, 5 deletions
diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Graphic.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Graphic.cs index 845bfc4..21acfb4 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Graphic.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Graphic.cs @@ -154,6 +154,7 @@ namespace UnityEngine.UI SetAllDirty(); } + // 在hierachy里的深度,依次增加 /// <summary> /// Absolute depth of the graphic, used by rendering and events -- lowest to highest. /// </summary> diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/GraphicRaycaster.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/GraphicRaycaster.cs index 2582204..303689a 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/GraphicRaycaster.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/GraphicRaycaster.cs @@ -249,6 +249,7 @@ namespace UnityEngine.UI } } + // /// <summary> /// Perform a raycast into the screen and collect all graphics underneath it. /// </summary> @@ -275,6 +276,7 @@ namespace UnityEngine.UI } } + // 从高到低,所以会以深度优先。越深的越先响应。 s_SortedGraphics.Sort((g1, g2) => g2.depth.CompareTo(g1.depth)); // StringBuilder cast = new StringBuilder(); totalCount = s_SortedGraphics.Count; diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/ScrollRect.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/ScrollRect.cs index f41fea8..a44bc5c 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/ScrollRect.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/ScrollRect.cs @@ -9,7 +9,16 @@ namespace UnityEngine.UI [ExecuteInEditMode] [DisallowMultipleComponent] [RequireComponent(typeof(RectTransform))] - public class ScrollRect : UIBehaviour, IInitializePotentialDragHandler, IBeginDragHandler, IEndDragHandler, IDragHandler, IScrollHandler, ICanvasElement, ILayoutElement, ILayoutGroup + public class ScrollRect + : UIBehaviour + , IInitializePotentialDragHandler + , IBeginDragHandler + , IEndDragHandler + , IDragHandler + , IScrollHandler + , ICanvasElement + , ILayoutElement + , ILayoutGroup { public enum MovementType { diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Scrollbar.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Scrollbar.cs index cbb1605..c280305 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Scrollbar.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Scrollbar.cs @@ -7,7 +7,12 @@ namespace UnityEngine.UI { [AddComponentMenu("UI/Scrollbar", 34)] [RequireComponent(typeof(RectTransform))] - public class Scrollbar : Selectable, IBeginDragHandler, IDragHandler, IInitializePotentialDragHandler, ICanvasElement + public class Scrollbar + : Selectable + , IBeginDragHandler + , IDragHandler + , IInitializePotentialDragHandler + , ICanvasElement { public enum Direction { diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Slider.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Slider.cs index 4e80fb3..4aad4e8 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Slider.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Slider.cs @@ -9,7 +9,7 @@ namespace UnityEngine.UI public class Slider : Selectable , IDragHandler - , IInitializePotentialDragHandler + , IInitializePotentialDragHandler // 拖拽之前 , ICanvasElement // 编辑器下才会用到 { public enum Direction @@ -100,7 +100,7 @@ namespace UnityEngine.UI private DrivenRectTransformTracker m_Tracker; // Size of each step. - float stepSize { get { return wholeNumbers ? 1 : (maxValue - minValue) * 0.1f; } } + float stepSize { get { return wholeNumbers ? 1 : (maxValue - minValue) * 0.1f; } } // 1/10十分之一 protected Slider() {} @@ -268,6 +268,8 @@ namespace UnityEngine.UI // Force-update the slider. Useful if you've changed the properties and want it to update visually. private void UpdateVisuals() { + LogHelper.Log("UpdateVisuals"); + #if UNITY_EDITOR if (!Application.isPlaying) UpdateCachedReferences(); @@ -352,6 +354,7 @@ namespace UnityEngine.UI public virtual void OnDrag(PointerEventData eventData) { + LogHelper.Log("OnDrag() " + gameObject.name); if (!MayDrag(eventData)) return; UpdateDrag(eventData, eventData.pressEventCamera); @@ -422,6 +425,7 @@ namespace UnityEngine.UI return base.FindSelectableOnDown(); } + // public virtual void OnInitializePotentialDrag(PointerEventData eventData) { eventData.useDragThreshold = false; diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Toggle.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Toggle.cs index 8dc4c82..f2dc8b9 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Toggle.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/UIControls/Toggle.cs @@ -89,7 +89,7 @@ namespace UnityEngine.UI onValueChanged.Invoke(m_IsOn); #endif } - + public virtual void LayoutComplete() {} |