public void ToBuild(int buildId) { MBuilding mBuilding = BuildingCacher.Instance.GetBuilding(buildId); App.Model.Master.MBuilding buildingMaster = mBuilding.Master; VBaseMap vBaseMap = (App.Util.SceneManager.CurrentScene as CTop).GetVBaseMap(); App.Model.MTile[] tiles = vBaseMap.ViewModel.Tiles.Value; int currentNum = System.Array.FindAll(tiles, _ => _.tile_id == buildingMaster.tile_id).Length; if (currentNum < buildingMaster.sum) { if (BuyManager.CanBuy(buildingMaster.price, buildingMaster.price_type)) { this.StartCoroutine(Build(mBuilding.TileId, vBaseMap, buildingMaster)); } else { //Confirm dialog } } else { //Confirm dialog CAlertDialog.Show("已经达到了购买的上限了!"); } }
public void CharacterIconClick(VCharacterIcon vCharacterIcon) { if (!vCharacterIcon.isSelected && selectCharacterContent.childCount >= selectShadowContent.childCount) { CAlertDialog.Show("人数满了"); return; } ToSelectCharacter(vCharacterIcon.ViewModel.CharacterId.Value, !vCharacterIcon.isSelected); vCharacterIcon.isSelected = !vCharacterIcon.isSelected; }
public void BattleStart() { if (battleFieldMaster.ap > Global.SUser.self.GetCurrentAp(App.Service.HttpClient.Now)) { CAlertDialog.Show("Ap不足"); return; } VCharacterIcon[] icons = selectCharacterContent.GetComponentsInChildren <VCharacterIcon>(); if (icons.Length == 0) { CAlertDialog.Show("请选择出战人员"); return; } this.StartCoroutine(BattleStartRun(icons)); }