summaryrefslogtreecommitdiff
path: root/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics')
-rw-r--r--Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/Graphic.cs2
-rw-r--r--Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/MaskableGraphic.cs6
2 files changed, 4 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 53cc1bd..e0d70f3 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
@@ -367,7 +367,7 @@ namespace UnityEngine.UI
canvasRenderer.materialCount = 1;
canvasRenderer.SetMaterial(materialForRendering, 0);
- canvasRenderer.SetTexture(mainTexture);
+ canvasRenderer.SetTexture(mainTexture); // 设置_MainTex,会覆盖材质上设置的_MainTex
}
//c 顶点重建
diff --git a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/MaskableGraphic.cs b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/MaskableGraphic.cs
index 4995dc1..51e2fe2 100644
--- a/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/MaskableGraphic.cs
+++ b/Assets/uGUI-2017.1/UnityEngine.UI/UI/Core/Graphics/MaskableGraphic.cs
@@ -101,15 +101,15 @@ namespace UnityEngine.UI
{
UISystemProfilerApi.AddMarker("MaskableGraphic.cullingChanged", this);
m_OnCullStateChanged.Invoke(cull);
- SetVerticesDirty();
+ SetVerticesDirty(); // 这里需要更新一下canvasRenderer的网格数据
}
}
public virtual void SetClipRect(Rect clipRect, bool validRect)
{
if (validRect)
- canvasRenderer.EnableRectClipping(clipRect);
- else
+ canvasRenderer.EnableRectClipping(clipRect);
+ else
canvasRenderer.DisableRectClipping();
}