Ejemplo n.º 1
0
    public void Show(string str)
    {
        print("Game info show...\n");
        gameObject.SetActive(true);

        int gameId;

        if (int.TryParse(str, out gameId))
        {
            cfgGameList = CfgCenter.Inst.m_cfgGameListMgr.FindById(gameId);

            m_title.text = cfgGameList._name;
            m_desc.text  = cfgGameList._desc;
            string iconPath = GameConst.UI_Icon_Path + cfgGameList._icon + ".png";
            m_icon.sprite = Assist.LoadSprite(iconPath, (int)m_icon.sprite.rect.width, (int)m_icon.sprite.rect.height).toSprite();
            string screenShotPath = GameConst.UI_ScreenShot_Path + cfgGameList._screenShot + ".png";
            m_screenShot.sprite = Assist.LoadSprite(screenShotPath, (int)m_screenShot.sprite.rect.width, (int)m_screenShot.sprite.rect.height).toSprite();
            m_type.text         = cfgGameList._type;
            m_type.text         = m_type.text.Replace("\\n", "\n");

            for (int i = 0; i < m_typeWordEffectScript.Count; i++)
            {
                m_typeWordEffectScript[i].PlayTypeWordEffect();
            }
        }
    }
Ejemplo n.º 2
0
        public void SetData(CfgGameList cfgGameList)
        {
            id        = cfgGameList._id;
            name.text = cfgGameList._name;
            //Self.name =cfgGameList._id.ToString();
            string iconPath = GameConst.UI_Icon_Path + cfgGameList._icon + ".png";

            icon.sprite = Assist.LoadSprite(iconPath, (int)icon.sprite.rect.width, (int)icon.sprite.rect.height).toSprite();
            Self.SetActive(false);
        }
Ejemplo n.º 3
0
    public void StartRecord(CfgGameList m_cfgGameList)
    {
        tempRecordItem = new  RecordItem();

        string date     = DateTime.Now.ToString("yyyy-MM-dd");
        string time     = DateTime.Now.ToString("hh:mm:ss");
        string gameName = m_cfgGameList._name;

        m_start = DateTime.Now;

        m_date     = date;
        m_gameId   = m_cfgGameList._id;
        m_gameName = gameName;
        tempRecordItem.m_startTime = time;
    }
Ejemplo n.º 4
0
    public void StopRecord(CfgGameList m_cfgGameList)
    {
        string date     = DateTime.Now.ToString("yyyy-MM-dd");
        string time     = DateTime.Now.ToString("hh:mm:ss");
        string gameName = m_cfgGameList._name;

        m_stop = DateTime.Now;
        TimeSpan ts  = m_stop - m_start;
        string   str = GlobalData.GetTimeSpan(ts);

        tempRecordItem.m_stopTime   = time;
        tempRecordItem.m_duringTime = str;

        ExcuteRecord();
    }
Ejemplo n.º 5
0
    private void Start()
    {
        int gameCount = CfgCenter.Inst.m_cfgGameListMgr.m_dataList.Count; //游戏列表个数

        for (int index = 0; index < gameCount; index++)
        {
            int         id          = index + 1; //id看需求
            CfgGameList cfgGameList = CfgCenter.Inst.m_cfgGameListMgr.FindById(id);

            GameItem item = new GameItem(transform.FindChild(index.ToString()).gameObject);
            item.SetData(cfgGameList);
            item.SetClicked(item.Self, () =>
            {
                if (ShowGameInfo != null)
                {
                    ShowGameInfo(item.id.ToString());
                }
            });
            itemList.Add(item);
        }
    }