mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 06:50:18 +00:00
关闭部分组件的raycastTarget
This commit is contained in:
@@ -286,6 +286,7 @@ namespace XCharts
|
||||
m_Content = content;
|
||||
m_ContentRect = m_Content.GetComponent<RectTransform>();
|
||||
m_ContentImage = m_Content.GetComponent<Image>();
|
||||
m_ContentImage.raycastTarget = false;
|
||||
m_ContentText = m_Content.GetComponentInChildren<Text>();
|
||||
if (m_ContentText != null)
|
||||
{
|
||||
|
||||
@@ -203,6 +203,7 @@ namespace XCharts
|
||||
txt.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
txt.color = color;
|
||||
txt.lineSpacing = lineSpacing;
|
||||
txt.raycastTarget = false;
|
||||
txtObj.transform.localEulerAngles = new Vector3(0, 0, rotate);
|
||||
|
||||
RectTransform rect = GetOrAddComponent<RectTransform>(txtObj);
|
||||
@@ -254,7 +255,8 @@ namespace XCharts
|
||||
var pivot = new Vector2(0.5f, 0.5f);
|
||||
var sizeDelta = new Vector2(width, height);
|
||||
GameObject iconObj = AddObject(name, parent, anchorMin, anchorMax, pivot, sizeDelta);
|
||||
GetOrAddComponent<Image>(iconObj);
|
||||
var img = GetOrAddComponent<Image>(iconObj);
|
||||
img.raycastTarget = false;
|
||||
return iconObj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user