diff options
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/UI/Core')
3 files changed, 10 insertions, 4 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 e0d70f3..845bfc4 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 @@ -532,6 +532,7 @@ namespace UnityEngine.UI if (canvas != null && canvas.overrideSorting) continueTraversal = false; + // 如果实现了这个接口再进一步判断一下 var filter = components[i] as ICanvasRaycastFilter; if (filter == null) diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Image.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Image.cs index 4844c19..65e0cfd 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Image.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Image.cs @@ -202,8 +202,12 @@ namespace UnityEngine.UI } } - public virtual void OnBeforeSerialize() {} + public virtual void OnBeforeSerialize()
+ {
+ //Debug.Log("OnBeforeSerialize");
+ } + // 序列化之后,即修改了序列化参数之后。校正一下结果 public virtual void OnAfterDeserialize() { if (m_FillOrigin < 0) @@ -321,11 +325,12 @@ namespace UnityEngine.UI return; } + //如果是ETC压缩格式,会生成一份alphaTex只保存透明度信息,不在_MainTex里 Texture2D alphaTex = activeSprite.associatedAlphaSplitTexture; if (alphaTex != null) { - canvasRenderer.SetAlphaTexture(alphaTex); + canvasRenderer.SetAlphaTexture(alphaTex); // _AlphaTex } } @@ -1082,6 +1087,7 @@ namespace UnityEngine.UI public virtual int layoutPriority { get { return 0; } } + //会根据透明度做更细致的射线检测,透明的地方不算 public virtual bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera) { if (alphaHitTestMinimumThreshold <= 0) diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/RawImage.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/RawImage.cs index 35f0508..e6dab1b 100644 --- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/RawImage.cs +++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/RawImage.cs @@ -29,14 +29,13 @@ namespace UnityEngine.UI get { if (m_Texture == null) - { + {
if (material != null && material.mainTexture != null) { return material.mainTexture; } return s_WhiteTexture; } - return m_Texture; } } |