IEnumerator OnDaoRu(EJiHeType type, List <FileInfo> infos) { foreach (FileInfo fileInfo in infos) { // 1. 创建一个实例 Transform t = InstantiateMoBan(go_MoBan, GetParent(type)); MyLoadTu.LoadSingleTu(fileInfo, (resBean) => { InitMoBan(t, resBean); }); yield return(0); } }
private void InitMoBan_Tu(Transform t, FileInfo fileInfo) // 初始化图片文件 { MyLoadTu.LoadSingleTu(fileInfo, (bean) => { allGoK_ResultBeanV.Add(t.gameObject, bean); t.Find("Icon").GetComponent <Image>().sprite = bean.SP; t.GetComponent <Button>().onClick.AddListener(() => { if (t.gameObject.Equals(go_CurrentSelect) && isSelect) // 双击 { isSelect = false; MyEventCenter.SendEvent(E_GameEvent.ShowSingleTuInfo, bean); } else // 单击 { go_CurrentSelect = t.gameObject; m_CurrentSelectFile = fileInfo; if (isNormalClick && !isShift) { if (chooseGOK_BgV.Count > 0) { foreach (GameObject bgGo in chooseGOK_BgV.Values) { bgGo.SetActive(false); } chooseGOK_BgV.Clear(); } } if (isShift && chooseGOK_BgV.Count > 0) // 按下 Shift { rt_Kuang.anchoredPosition = StartPosition; List <GameObject> tmpList = new List <GameObject>(chooseGOK_BgV.Keys); GameObject lastGo = tmpList[tmpList.Count - 1]; int index1 = l_MiddleItems.IndexOf(go_CurrentSelect); int index2 = l_MiddleItems.IndexOf(lastGo); int minIndex = Mathf.Min(index1, index2); int maxIndex = Mathf.Max(index1, index2); for (int i = minIndex + 1; i < maxIndex; i++) { AddChoose(l_MiddleItems[i]); } } AddChoose(go_CurrentSelect); input_GeiMing.text = allGoK_ResultBeanV[go_CurrentSelect].SP.name; Ctrl_Coroutine.Instance.StartCoroutine(CheckoubleClick()); } }); }); }