Exemplo n.º 1
0
    private void initData()
    {
        uiRole = new List <roleInfo>();
        int nCount = 0;

        gameDataMgr.bossTag tmpTag = gameDataMgr.gameData().m_bossTag;
        for (int i = 0; i < tmpTag.bossUse.Length; i++)
        {
            if (tmpTag.bossUse[i] == true)
            {
                roleInfo tmpInfo = new roleInfo();

                tmpInfo.hp = gameDataMgr.gameData().m_roleData.bosshp[i];

                RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(i);
                tmpInfo.maxHp  = tmpPro.MaxHp;
                tmpInfo.roleID = tmpPro.ID;

                ShopItemTable.shopElements tmpEle = ShopItemTable.Get(i);
                //RoleInfoTable.roleElements tmpEle = RoleInfoTable.Get(i+1);
                tmpInfo.picName = tmpEle.Pic;

                uiRole.Add(tmpInfo);
                nCount++;
            }
        }

        //OKBtnClick
        btnOK.onClick.AddListener(delegate()
        {
            this.OKBtnClick();
        });
    }
Exemplo n.º 2
0
    //加载显示UI
    public void initData()
    {
        /*
         * using (var stream = new MemoryStream(bossTab.bytes))
         * {
         *  BossInfoTable.Load(stream);
         * }
         */
        Object bossInfoObj = Resources.Load("Prefab/UI/" + csShopInfo);

        int           nCount    = ShopItemTable.GetTableLength();
        float         csPosY    = -140.0f;
        float         allHeight = csPosY * (-1) * nCount;
        RectTransform tmpTrans  = viewPortLst.GetComponent <RectTransform>();

        tmpTrans.sizeDelta = new Vector2(tmpTrans.sizeDelta.x, allHeight);

        for (int i = 0; i < nCount; i++)
        {
            ShopItemTable.shopElements tmpBoss = ShopItemTable.m_elements[i];
            int roleID = tmpBoss.ID;
            //  CSVRow roleEle = RoleInfoTable.GetRowFromID(roleID);
            float      posY   = csPosY * (i - 1);
            GameObject tmpObj = GameObject.Instantiate(bossInfoObj, viewPortLst) as GameObject;

            RectTransform tmp = tmpObj.GetComponent <RectTransform>();
            tmp.anchoredPosition3D = new Vector3(0, posY, 0);

            shopInfoUI tmpUI   = tmpObj.GetComponent <shopInfoUI>();
            int        tmpcost = 0;
            bool       isUse   = gameDataMgr.gameData().m_bossTag.bossUse[i];
            if (isUse)
            {
                tmpcost = 0;
            }
            else
            {
                tmpcost = tmpBoss.Cost;
            }

            // tmpUI.initData(tmpBoss.Pic, roleEle.Name, roleEle.Des, tmpcost);
            tmpUI.initData(tmpBoss.Pic, tmpcost, roleID, onClick);

            if (i == 0) //给个默认选项
            {
                onClick(roleID, tmpUI);
            }
        }
    }
Exemplo n.º 3
0
        public IEnumerable <IShopItemTable> Execute(ShopID shopID)
        {
            var ret = new List <IShopItemTable>();

            using (var r = ExecuteReader(shopID))
            {
                while (r.Read())
                {
                    var tableValues = new ShopItemTable();
                    tableValues.ReadValues(r);
                    ret.Add(tableValues);
                }
            }

            return(ret);
        }
Exemplo n.º 4
0
    public void initData()
    {
        using (var stream = new MemoryStream(roleItem.bytes))
        {
            RoleInfoTable.Load(stream);
            //StoneTable.CsdTTable<string>.Load(stream);
        }

        using (var stream = new MemoryStream(roleProperty.bytes))
        {
            RoleProTable.Load(stream);
        }

        using (var stream = new MemoryStream(shopItemTab.bytes))
        {
            ShopItemTable.Load(stream);
        }

        using (var stream = new MemoryStream(levMonsterTab.bytes))
        {
            LevMonsterTab.Load(stream);
        }
    }