搜索框
This commit is contained in:
parent
4113906db5
commit
8278a08c0d
|
@ -21,10 +21,12 @@ public class SearchName : MonoBehaviour
|
|||
//չʾµÄÃû×Ö
|
||||
private List<string> SearchObjects = new List<string>();
|
||||
|
||||
public List<GameObject> button_objects = new List<GameObject>();
|
||||
|
||||
public SearchType searchType;
|
||||
void Start()
|
||||
{
|
||||
searchType = SearchType.None;
|
||||
//searchType = SearchType.None;
|
||||
//scrollView.SetActive(false);
|
||||
InputFieldEvent();
|
||||
}
|
||||
|
@ -129,6 +131,7 @@ public class SearchName : MonoBehaviour
|
|||
GameObject tmp = Instantiate(prefabsText, scrollViewContent, false);
|
||||
TextMeshProUGUI text = tmp.GetComponentInChildren<TextMeshProUGUI>();
|
||||
text.text = SearchObjects[i];
|
||||
button_objects.Add(tmp);
|
||||
}
|
||||
|
||||
addonClick();
|
||||
|
@ -144,25 +147,28 @@ public class SearchName : MonoBehaviour
|
|||
int childCount = SearchObjects.Count;
|
||||
for (int i = 0; i < childCount; i++)
|
||||
{
|
||||
int co = i;
|
||||
int eventCount = scrollViewContent.GetChild(i).GetComponent<Button>().onClick.GetPersistentEventCount();
|
||||
|
||||
if (eventCount > 0)
|
||||
scrollViewContent.GetChild(i).GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
//FindGo(objs, i, (go) =>
|
||||
//{
|
||||
var jigui = GameManager.Inst.FindParent(scrollViewContent.GetChild(i).gameObject, GameManager.Inst.IsDesiredParent);
|
||||
//var jigui = GameManager.Inst.FindParent(scrollViewContent.GetChild(i).gameObject, GameManager.Inst.IsDesiredParent);
|
||||
switch (searchType)
|
||||
{
|
||||
case SearchType.None:
|
||||
break;
|
||||
case SearchType.»ú¹ñ:
|
||||
{
|
||||
scrollViewContent.GetChild(i).GetComponent<Button>().onClick.AddListener(() =>
|
||||
scrollViewContent.GetChild(co).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
if (jigui)
|
||||
{
|
||||
jigui.GetComponent<ClickEvent>().Zoomin();
|
||||
}
|
||||
Debug.Log(co);
|
||||
objs[co].GetComponent<ClickEvent>().Zoomin();
|
||||
//if (jigui)
|
||||
//{
|
||||
// jigui.GetComponent<ClickEvent>().Zoomin();
|
||||
//}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -12,6 +12,9 @@ public class SearchItem : MonoBehaviour
|
|||
|
||||
public void Init()
|
||||
{
|
||||
search_button.onClick.AddListener(() =>
|
||||
{
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue