Beispiel #1
0
    protected override void OnRespond(respond_shop_op respond, object userdata)
    {
        ShopModule module = ModuleManager.Instance.FindModule <ShopModule>();

        if (module == null)
        {
            GameDebug.LogError("没有找到shopmodule");
            return;
        }

        if (respond.result != (int)Message.ERROR_CODE.ERR_SHOP_OK)
        {
            switch ((Message.ERROR_CODE)respond.result)
            {
            case ERROR_CODE.ERR_SHOP_FAILED:
                break;

            //case ERROR_CODE.ERR_MALL_BUY_NO_TIMES:
            //    break;
            //case ERROR_CODE.ERR_MALL_FAILED:
            //    break;
            default:
                break;
            }
            return;
        }

        if (userdata is ShopBuyItemAction)
        {
            module.BuyShopItem(respond.shopid);
        }

        //改到人物shop物品属性改变后再刷新;
        //if (userdata is ShopRefreshAction)
        //{
        //    module.RefreshShop();
        //}

        //if (userdata is ShopFreeRefreshAction)
        //{
        //    module.RefreshShop();
        //}
    }