public void RefreshSlot(int pos) { TeamMonsterCell cell = null; if (m_dicMonCell.ContainsKey(pos)) { cell = m_dicMonCell[pos]; cell.InitUI(pos); } CheckEmptyGuides(); }
//更新当前队伍 public void RefreshCurTeam() { m_txtMember.text = TeamUI.mInstance.curTeam.validateMember.ToString() + "/14"; while (m_grid.transform.childCount > 0) { Transform tf = m_grid.transform.GetChild(0); tf.parent = null; Destroy(tf.gameObject); } m_dicMonCell.Clear(); if (m_prefabMonster == null) { m_prefabMonster = PrefabLoader.loadFromPack("ZQ/TeamMonsterCell"); } for (int i = 0; i < TeamUI.mInstance.curTeam.capacity; i++) { GameObject obj = Instantiate(m_prefabMonster) as GameObject; RED.AddChild(obj, m_grid.gameObject); obj.name = (10 + i).ToString(); TeamMonsterCell cell = obj.GetComponent <TeamMonsterCell>(); cell.InitUI(i); m_dicMonCell.Add(i, cell); cell.SetSelected(false); } m_grid.enabled = true; m_grid.Reposition(); m_grid.GetComponentInParent <UIScrollView> ().ResetPosition(); this.AutoShowVoidPos(); CheckEmptyGuides(); ShowFateEffect(); SetMonSelected(m_dicMonCell[TeamUI.mInstance.mSelectIndex]); }