修改搜索菜单样式
This commit is contained in:
parent
f66df0aab2
commit
4d23f8cd3a
@ -349,34 +349,26 @@ namespace QFramework.Example
|
|||||||
GameObject clone = GameObject.Instantiate(SearchItem.gameObject, SearchContent);
|
GameObject clone = GameObject.Instantiate(SearchItem.gameObject, SearchContent);
|
||||||
searchItemMap.Add(clone, child.gameObject);
|
searchItemMap.Add(clone, child.gameObject);
|
||||||
Transform subContent = child.Find("SubContent");
|
Transform subContent = child.Find("SubContent");
|
||||||
|
Button btn = clone.transform.Find("Button").GetComponent<Button>();
|
||||||
|
btn.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
child.Find("Content/Toggle/Obj").GetComponent<Button>().onClick.Invoke();
|
||||||
|
});
|
||||||
|
|
||||||
|
string grou = string.Empty;
|
||||||
if (subContent.childCount > 0)
|
if (subContent.childCount > 0)
|
||||||
{
|
{
|
||||||
Button btn = clone.transform.Find("Button").GetComponent<Button>();
|
grou = "(组)";
|
||||||
btn.onClick.AddListener(() =>
|
|
||||||
{
|
|
||||||
child.Find("Content/Toggle/Obj").GetComponent<Toggle>().isOn = true;
|
|
||||||
});
|
|
||||||
Transform buttonLabel = btn.transform.Find("Label");
|
|
||||||
if (buttonLabel != null)
|
|
||||||
{
|
|
||||||
TextMeshProUGUI buttonText = buttonLabel.GetComponent<TextMeshProUGUI>();
|
|
||||||
if (buttonText != null)
|
|
||||||
{
|
|
||||||
buttonText.text = "组" + name + ">";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CheckChildren(subContent, str);
|
CheckChildren(subContent, str);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
Transform buttonLabel = btn.transform.Find("Label");
|
||||||
|
if (buttonLabel != null)
|
||||||
{
|
{
|
||||||
Transform buttonLabel = clone.transform.Find("Button/Label");
|
TextMeshProUGUI buttonText = buttonLabel.GetComponent<TextMeshProUGUI>();
|
||||||
if (buttonLabel != null)
|
if (buttonText != null)
|
||||||
{
|
{
|
||||||
TextMeshProUGUI buttonText = buttonLabel.GetComponent<TextMeshProUGUI>();
|
buttonText.text = grou + name + ">";
|
||||||
if (buttonText != null)
|
|
||||||
{
|
|
||||||
buttonText.text = name + ">";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user