public void GainAllPlant() { List <int> allIndexList = canGainLandList; //此处必须用一个变量缓存收获列表 因为在收获成功后 会删除canGainLandList 造成数据混乱 for (int i = 0; i < allIndexList.Count; i++) { stGainFramHomeUserCmd_CS cmd = new stGainFramHomeUserCmd_CS(); cmd.land_id = (uint)allIndexList[i]; NetService.Instance.Send(cmd); } }
public void OnGainPlant(stGainFramHomeUserCmd_CS cmd) { ItemDataBase db = GameTableManager.Instance.GetTableItem <ItemDataBase>((uint)cmd.fruit_id); if (db != null) { TipsManager.Instance.ShowTipsById(114502, db.itemName, cmd.num); int seedID = (int)cmd.seed_id; int landIndex = (int)cmd.land_id; long entityID = 0; SetLandEntityState(landIndex, (int)LandState.Idle); HomeEntityInfo info = GetHomeEntityByIndex(EntityType.EntityType_Plant, landIndex, out entityID); if (entityID != 0) { DeleteHomeEntity(entityID); } DeleteCanCainLand(landIndex); DeletePlantAndAnimalRemainTime(landIndex); } RefreshLandUI(); }
public void GainOnePlant(int index = 0) { if (canGainLandList.Count > 0) { stGainFramHomeUserCmd_CS cmd = new stGainFramHomeUserCmd_CS(); if (index != 0) { cmd.land_id = (uint)index; } else { cmd.land_id = (uint)canGainLandList[0]; } NetService.Instance.Send(cmd); } else { TipsManager.Instance.ShowTips("没有东西可收获"); } }
public void OnGainPlant(stGainFramHomeUserCmd_CS cmd) { DataManager.Manager <HomeDataManager>().OnGainPlant(cmd); }