/// <summary> /// 设置助阵玩家信息 /// </summary> void SetInstanceMercenary(Dictionary <int, MercenaryInfo> mercenaryInfo) { int count = -1; foreach (var item in mercenaryInfo) { int index = ++count; int id = item.Key; var info = item.Value; string name = "GOInstanceHelpPlayerGrid" + (index % MercenaryPageCount).ToString(); GameObject temp = m_listInstanceHelpPlayerGridSet[(int)index / MercenaryPageCount].transform.Find(name).gameObject; temp.SetActive(true); temp.transform.parent = m_listInstanceHelpPlayerGridSet[(int)index / MercenaryPageCount].transform; temp.GetComponentsInChildren <MyDragCamera>(true)[0].RelatedCamera = m_dragCamera; InstanceHelperGrid theGrid = temp.AddComponent <InstanceHelperGrid>(); if (theGrid != null) { theGrid.id = id; theGrid.SetHelper((Vocation)(info.vocation), info.name, info.level.ToString(), info.fight.ToString(), 0); // to do } m_listInstanceMercenary.Add(temp); InstanceUILogicManager.Instance.CountMercenaryGridCreate(); } }
/// <summary> /// 设置选择助阵玩家 /// </summary> /// <param name="id"></param> public void SetChooseHelper(int id) { for (int i = 0; i < m_listInstanceMercenary.Count; i++) { InstanceHelperGrid temp = m_listInstanceMercenary[i].GetComponent <InstanceHelperGrid>(); if (temp.id == id) { temp.SetEnable(true); } else { temp.SetEnable(false); } } OnHelpUISelectPlayerUp(id); }