Beispiel #1
0
    public override void Execute(object data)
    {
        GameModel   gm   = GetModel <GameModel>();
        UIShop      shop = GetView <UIShop>();
        BuySkinArgs e    = data as BuySkinArgs;

        gm.TakeonSkin = e.ID;
        //更新UI
        shop.UpdateUI();
        shop.UpdateClothBuyBtn(e.ID.ClothID);

        //更新GIzmo
        shop.UpdateClothGizmo();
    }
Beispiel #2
0
    public override void Execute(object data)
    {
        GameModel   gm   = GetModel <GameModel>();
        UIShop      shop = GetView <UIShop>();
        BuySkinArgs e    = data as BuySkinArgs;

        if (gm.PayCoin(e.Coin))
        {
            //把当前id加入已购买列表
            gm.BuySkin.Add(e.ID);
            foreach (var item in gm.BuySkin)
            {
                Debug.Log("买了" + item.SkinID + "号皮肤" + item.ClothID + "号衣服");
            }
            //更新UI
            shop.UpdateUI();
            shop.UpdateClothBuyBtn(e.ID.ClothID);

            //更新GIzmo
            shop.UpdateClothGizmo();
        }
    }