private void SetBatttleData(BattleRoundData round_data, List <LogicObject.DropBag> drop_bags) { m_BattleRoundData = round_data; if (m_BattleRoundData.isLastBattle) { m_RoundCounter = m_BattleRoundData.roundCount; int main_id = TableManager.GetCopydetailByID(m_BattleRoundData.missionID).Copyfather; MainCopy main_copy = new MainCopy(main_id); SubCopy sub_copy = new SubCopy(m_BattleRoundData.missionID); Obj_MyselfPlayer.GetMe().curMainCopy = main_copy; Obj_MyselfPlayer.GetMe().curSubcopy = sub_copy; string log = "setBattleData(), isLastBattle = true, roundCount = " + m_RoundCounter; log += ", main_copy = " + main_id; log += ", sub_copy = " + m_BattleRoundData.missionID; Debug.Log(log); InitCopys(); Obj_MyselfPlayer.GetMe().UpdateCopyList(CopyType.NORMAL); //记录当前小副本的大副本是否已经开启 by 王明磊 foreach (MainCopy main in Obj_MyselfPlayer.GetMe().normalMainCopys) { if (main.copyId == sub_copy.tblCopyDetail.Copyfather && main.copyState == CopyState.PASSED) { Debug.Log("Next Main Copy Already Opened"); Obj_MyselfPlayer.GetMe().isNextMainOpened = true; break; } } foreach (DropBag drop_bag in drop_bags) { if (drop_bag.type == DropType.CARD) { m_BattleTopUI.GetComponent <BattleTopUI>().AddCard(1); Debug.Log("Add card"); } else if (drop_bag.type == DropType.TIEM) { m_BattleTopUI.GetComponent <BattleTopUI>().AddItem(1); Debug.Log("Add AddItem"); } else if (drop_bag.type == DropType.MONEY) { m_BattleTopUI.GetComponent <BattleTopUI>().AddMoney(drop_bag.val); Debug.Log("Add AddMoney"); } } } }
//排序算法 static public int CompareTo(MainCopy copyA, MainCopy copyB) { if (copyB.startTime != copyA.startTime) { //开始时间 return(-1 * copyB.startTime.CompareTo(copyA.startTime)); } else if (copyB.tblCopy.PlayerLevel != copyA.tblCopy.PlayerLevel) { //副本等级 return(-1 * copyB.tblCopy.PlayerLevel.CompareTo(copyA.tblCopy.PlayerLevel)); } else { //副本id return(-1 * copyB.copyId.CompareTo(copyA.copyId)); } }
void InitCopys() { Obj_MyselfPlayer.GetMe().normalMainCopys.Clear(); Obj_MyselfPlayer.GetMe().activityMainCopys.Clear(); Hashtable copy_table = TableManager.GetCopy(); foreach (DictionaryEntry pair in copy_table) { MainCopy copy = new MainCopy((int)pair.Key); if (copy.tblCopy.GetCopyTypebyIndex(0) == (int)CopyType.NORMAL) { Obj_MyselfPlayer.GetMe().normalMainCopys.Add(copy); } else { Obj_MyselfPlayer.GetMe().activityMainCopys.Add(copy); } } }
void Refresh() { subCopyCount = 0; Obj_MyselfPlayer.GetMe().UpdateCopyList(CopyType.NORMAL); Obj_MyselfPlayer.GetMe().UpdateCopyList(CopyType.ACTIVITY); for (int i = 0; i < Obj_MyselfPlayer.GetMe().normalMainCopys.Count; i++) { if (Obj_MyselfPlayer.GetMe().curMainCopy.copyId == Obj_MyselfPlayer.GetMe().normalMainCopys[i].copyId) { Obj_MyselfPlayer.GetMe().curMainCopy = Obj_MyselfPlayer.GetMe().normalMainCopys[i]; //title.spriteName = "选择副本"; //title.MakePixelPerfect(); break; } } for (int i = 0; i < Obj_MyselfPlayer.GetMe().activityMainCopys.Count; i++) { if (Obj_MyselfPlayer.GetMe().curMainCopy.copyId == Obj_MyselfPlayer.GetMe().activityMainCopys[i].copyId) { Obj_MyselfPlayer.GetMe().curMainCopy = Obj_MyselfPlayer.GetMe().activityMainCopys[i]; //title.spriteName = "选择活动"; //title.MakePixelPerfect(); break; } } mainCopy = Obj_MyselfPlayer.GetMe().curMainCopy; if (mainCopy != null) { CreateList(); StartCoroutine(SetScrollValue()); } else { Debug.LogError("main copy is null !"); } }
public void OnSelectMainCopy(GameObject go) { switch (GuideManager.Instance.currentStep) { case GuideManager.GUIDE_STEP.COPY1_1: GuideCopy1_1.Instance.NextStep(); //新手战斗引导 SELECT_2 break; case GuideManager.GUIDE_STEP.COPY1_2: GuideCopy1_2.Instance.NextStep(); //新手战斗引导 SELECT_2 break; case GuideManager.GUIDE_STEP.COPY1_3: GuideCopy1_3.Instance.NextStep(); //新手战斗引导 SELECT_2 break; case GuideManager.GUIDE_STEP.COPY1_4: GuideCopy1_4.Instance.NextStep(); //新手战斗引导 SELECT_2 break; case GuideManager.GUIDE_STEP.COPY1_5: GuideCopy1_5.Instance.NextStep(); //新手战斗引导 SELECT_2 break; case GuideManager.GUIDE_STEP.COPY2_1: GuideCopy2_1.Instance.NextStep(); //新手战斗引导 SELECT_2 break; default: break; } int order = int.Parse(go.name); MainCopy mcopy = null; if (curActive == CopyType.NORMAL) { foreach (MainCopy copy in normalCopys) { if (copy.listOrder == order) { mcopy = copy; break; } } } else { foreach (MainCopy copy in activityCopys) { if (copy.listOrder == order) { mcopy = copy; break; } } } if (mcopy != null) { Obj_MyselfPlayer.GetMe().curMainCopy = mcopy; logicTarget.SendMessage("LoadPveBossList"); } else { Debug.LogError("OnSelectMainCopy(), copy is null"); } //点击后清除小副本记录位置 ScrollData scDatasub1 = new ScrollData(0); Obj_MyselfPlayer.GetMe().SetScrollValue(SubCopy_Key, scDatasub1); }