Beispiel #1
0
    //--------------------------------------------------------------------------------
    //go 点击角色的 go
    public void UpdateSellText(RoleBase role, GameObject go)
    {
        sellGo.SetActive(true);
        sellPriceText.text = (role.GetPrice() - RoleShopModel.zhekou).ToString();

        //更改sell button的贩卖事件
        UIUtil.SetUIOnClick(sellGo, (g) => {
            //拿role在所在队列中的index

            int index = goItems[go].index;
            var type  = goItems[go].listType;
            playerModel.SellRole(index, type);

            sellGo.SetActive(false);
        });

        //开启监听 售卖选项 的关闭
        EventManager.RegistEvent(EventType.InputClick, CanCloseSellGo);
    }