Esempio n. 1
0
 private void onHistory()
 {
     if (HistoryController.Instance.tableList == null || HistoryController.Instance.tableList.Count == 0)
     {
         _zjInfo.SetActive(false);
         _zjNone.SetActive(true);
     }
     else
     {
         _zjInfo.SetActive(true);
         _zjNone.SetActive(false);
         _curPage   = HistoryController.Instance.page;
         _sumPage   = HistoryController.Instance.sumPage;
         _page.text = _curPage + "/" + _sumPage;
         _zjGrid.destoryChild(true);
         for (int i = 0; i < HistoryController.Instance.tableList.Count; i++)
         {
             GameObject obj = GameObject.Instantiate(_zjItem, _zjItem.transform.parent, true) as GameObject;
             obj.transform.localScale = Vector3.one;
             obj.transform.parent     = _zjItem.transform.parent;
             obj.name = HistoryController.Instance.tableList[i].index.ToString();
             obj.SetActive(true);
             obj.transform.FindChild("button").GetComponent <Button>().onClick.AddListener(delegate
             {
                 ProtoReq.historyDetailReq(int.Parse(obj.name));
             });
             obj.transform.FindChild("roomNum").GetComponent <Text>().text = "房间号:" + HistoryController.Instance.tableList[i].table_id;
             obj.transform.FindChild("date").GetComponent <Text>().text    = "日期:" + HistoryController.Instance.tableList[i].start_time;
             IconMgr.Instance.SetImage(obj.transform.FindChild("index").GetComponent <Image>(), "index" + (i + 1));
             GameObject objInfo = obj.transform.FindChild("info").gameObject;
             for (int j = 0; j < HistoryController.Instance.tableList[i].playerinfo_list.Count; j++)
             {
                 objInfo.transform.FindChild(j + "/name").GetComponent <Text>().text = HistoryController.Instance.tableList[i].playerinfo_list[j].name;
                 objInfo.transform.FindChild(j + "/id").GetComponent <Text>().text   = "【" + HistoryController.Instance.tableList[i].playerinfo_list[j].id.IdEx() + "】";
                 int score = HistoryController.Instance.tableList[i].playerinfo_list[j].total_score;
                 if (score >= 0)
                 {
                     objInfo.transform.FindChild(j + "/score").GetComponent <Text>().text = "<color='#e83a1b'>+" + score + "</color>";
                 }
                 else
                 {
                     objInfo.transform.FindChild(j + "/score").GetComponent <Text>().text = "<color='#825a48'>" + score + "</color>";
                 }
             }
         }
     }
 }
Esempio n. 2
0
    private void addClick()
    {
        _jsclose.onClick.AddListener(delegate
        {
            //DestoryPanel();
            ClosePanel();
            RoleController.Instance.clear();
            HallPanel.Instance.load();
            SoundMgr._instance.bgmPlay("beijing_dating" + GameConst.BGM, GameConst.musicVol);
        });
        _jsjixu.onClick.AddListener(delegate
        {
            //DestoryPanel();
            ClosePanel();
            RoleController.Instance.clear();
            HallPanel.Instance.load();
            SoundMgr._instance.bgmPlay("beijing_dating" + GameConst.BGM, GameConst.musicVol);
        });
        _jsfenxiang.onClick.AddListener(delegate
        {
            if (!_isShare)
            {
                _isShare = true;

                GameConst.driver.StartCoroutine(CaptureScreen());
            }
        });
        _jsxiangqing.onClick.AddListener(delegate
        {
            ProtoReq.historyDetailReq(index);
        });
        _jlClose.onClick.AddListener(delegate
        {
            _jiesuan.SetActive(true);
            _jilu.gameObject.SetActive(false);
        });
        _xqClose.onClick.AddListener(delegate
        {
            _xiangqing.gameObject.SetActive(false);
            _jilu.gameObject.SetActive(true);
        });
    }