示例#1
0
    public void OnUnlockLand(stUnlockFarmHomeUserCmd_CS cmd)
    {
        TipsManager.Instance.ShowTipsById(114504);
        int index = cmd.unlock_index;

        LandUnlockNum = landunlockNum + 1;
        SetLandEntityState(index, (int)LandState.Idle);
        RefreshLandUI();
    }
示例#2
0
    void OnClickLand(HomeEntityInfo info)
    {
        if (info.state == (int)LandState.Idle)
        {
            object data = EntityType.EntityType_Plant;
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PlantingPanel, data: data);
        }
        else if (info.state == (int)LandState.LockCanBuy)
        {
            if (info.index == LandUnlockNum + 1)
            {
                LandAndFarmDataBase db = GameTableManager.Instance.GetTableItem <LandAndFarmDataBase>(landID, info.index);
                if (db != null)
                {
                    uint   money = db.needMoneyNum;
                    string str   = MainPlayerHelper.GetMoneyNameByType(db.costType);
                    if (!MainPlayerHelper.IsHasEnoughMoney(db.costType, money))
                    {
                        return;
                    }
                    if (!MainPlayerHelper.HasEnoughVipLevel(db.vipLimitLevel))
                    {
                        TipsManager.Instance.ShowTipsById(114503, db.vipLimitLevel);
                        return;
                    }

                    string tips = DataManager.Manager <TextManager>().GetLocalFormatText(114532, str, money);
                    TipsManager.Instance.ShowTipWindow(TipWindowType.CancelOk, tips, () =>
                    {
                        stUnlockFarmHomeUserCmd_CS cmd = new stUnlockFarmHomeUserCmd_CS();
                        cmd.unlock_index = info.index;
                        NetService.Instance.Send(cmd);
                    });
                }
            }
        }
    }
示例#3
0
 public void OnUnlockLand(stUnlockFarmHomeUserCmd_CS cmd)
 {
     DataManager.Manager <HomeDataManager>().OnUnlockLand(cmd);
 }