private void SetItemReward(stage.StageResource Res) { if (Res == null) { return; } if (Res.rewards == null || Res.rewards.Count == 0) { return; } if (MyHead.Rewardtable == null) { return; } Dictionary <int, int> l = new Dictionary <int, int>(); for (int i = 0; i < Res.rewards.Count; i++) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(Res.rewards[i].itemtypeid); if (Info == null) { continue; } if (l.ContainsKey(Res.rewards[i].itemtypeid) == false) { l.Add(Res.rewards[i].itemtypeid, Res.rewards[i].superpose); } else { l[Res.rewards[i].itemtypeid] = l[Res.rewards[i].itemtypeid] + Res.rewards[i].superpose; } } // foreach (int key in l.Keys) { GameObject go = NDLoad.LoadWndItem("RewardItem", MyHead.Rewardtable.transform); if (go != null) { RewardItem item = go.GetComponent <RewardItem>(); if (item != null) { item.SetRewardItem(key, l[key]); } } } MyHead.Rewardtable.enabled = true; MyHead.Rewardtable.Reposition(); }
public void GetTrophies(stage.StageResource Res) { if (Res != null && Res.rewards != null) { for (int i = 0; i < Res.rewards.Count; i++) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(Res.rewards[i].itemtypeid); if (Info == null) { continue; } if (Info.gtype == 1 || Info.gtype == 2 || Info.gtype == 3) { m_lRewardInfo.Add(Info); } } } }
/// <summary> /// 设置战役奖励 /// </summary> private void SetteamReward(stage.StageUserSettle user, stage.StageResource Res) { if (user == null || Res == null) { return; } if (MyHead.lv != null) { MyHead.lv.text = "[ffffff]LV:" + UserDC.GetLevel() + "[-]"; } if (MyHead.exp != null) { MyHead.exp.text = "[ffffff]+" + user.exp + "[-]"; } if (MyHead.gold != null) { MyHead.gold.text = "[ffffff]+" + Res.coin + "[-]"; } }
/// <summary> /// 0718 领取副本扫荡奖励 /// </summary> /// <returns></returns> public static bool RespStageSweepResponse(object obj) { if (obj == null) { return(false); } mStageSweepRewards.Clear(); stage.StageSweepResponse sweepResponse = obj as stage.StageSweepResponse; foreach (stage.StageSweepResponse.StageSweepReward sweepReward in sweepResponse.sweep_reward) { StageSweepReward stageSweepReward = new StageSweepReward(); stage.StageResource stageResource = sweepReward.resource; foreach (stage.StageResource.ItemInfo itemInfo in stageResource.rewards) { StageSweepReward.ItemInfo item = new StageSweepReward.ItemInfo(); item.mItemTypeID = itemInfo.itemtypeid; item.mCount = itemInfo.superpose; stageSweepReward.mSweepItems.Add(item); } foreach (stage.StageSoldierSettle soldierinfo in sweepReward.soldierinfos) { stageSweepReward.mExp += soldierinfo.exp; } stageSweepReward.mCoin = stageResource.coin; foreach (stage.StageSweepResponse.StageSweepReward.SweepExtraReward sweepExtraReward in sweepReward.extra_reward) { StageSweepReward.ItemInfo item = new StageSweepReward.ItemInfo(); item.mItemTypeID = sweepExtraReward.itemid; item.mCount = sweepExtraReward.number; stageSweepReward.mExtraRewards.Add(item); } mStageSweepRewards.Add(stageSweepReward); } return(true); }