void UpdateChildrenCallback(int index, Transform trans)
        {
            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
            HistroyGradeRoom      room = trans.GetComponent <HistroyGradeRoom>();

            room.GradeRoom = hgpd.GradeMessage[index];
            room.index     = index;
            room.UpdateShow();
        }
        /// <summary>
        /// 产生历史战绩的面板
        /// </summary>
        public void SpwanHistoryPanel()
        {
            //删除玩家的之前的面板
            HistroyGradeRoom[] rooms = GradeRect_Room.transform.Find("Content").GetComponentsInChildren <HistroyGradeRoom>();

            if (rooms.Length > 0)
            {
                for (int i = 0; i < rooms.Length; i++)
                {
                    Destroy(rooms[i].gameObject);
                }

                //return;
            }
            GradeRect_Room.transform.Find("Content").GetComponent <GridLayoutGroup>().enabled   = true;
            GradeRect_Room.transform.Find("Content").GetComponent <ContentSizeFitter>().enabled = true;



            HistroyGradePanelData hgpd = GameData.Instance.HistroyGradePanelData;
            int count = hgpd.GradeMessage.Count;

            if (count <= 0)
            {
                hgpd.isShowGrade_Room  = false;
                hgpd.isShowGrade_Round = false;
                UpdateShow();
            }



            //Debug.LogError("hgpd.GradeMessage:" + hgpd.GradeMessage.Count);
            if (count > 5)
            {
                for (int i = 0; i < 5; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Room"));
                    go.transform.SetParent(GradeRect_Room.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Room_" + i;
                }
                //初始化数据列表;
                infinityGridLayoutGroup = GradeRect_Room.transform.Find("Content").GetComponent <InfinityGridLayoutGroup>();
                infinityGridLayoutGroup.Init();
                //Invoke("SetAmount", 0.1f);
                infinityGridLayoutGroup.SetAmount(hgpd.GradeMessage.Count);
                infinityGridLayoutGroup.updateChildrenCallback = UpdateChildrenCallback;
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    GameObject go = Instantiate(Resources.Load <GameObject>("Lobby/HistroyGrade/HistroyGrade_Room"));
                    go.transform.SetParent(GradeRect_Room.transform.Find("Content"));
                    go.transform.localEulerAngles = Vector3.zero;
                    go.transform.localPosition    = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0);
                    go.transform.localScale       = Vector3.one;
                    go.name = "HistroyGrade_Room_" + i;
                    HistroyGradeRoom room = go.GetComponent <HistroyGradeRoom>();
                    room.GradeRoom = hgpd.GradeMessage[i];
                    room.index     = i;
                    room.UpdateShow();
                }
            }
        }