public void NewPlayerGuide(int index) { if (index < 0) { return; } m_NewPlayerGuideFlag_Step = index; switch (index) { case 1: //NewPlayerGuidLogic.OpenWindow(m_CloseButton, 200, 80, StrDictionary.GetClientDictionaryString("#{2867}"), "bottomleft", 0, true, true); NewPlayerGuidLogic.OpenWindow_Circle(m_GuidePoint, 100, "", "left", 0, true, true); break; case 2: // 召唤 case 15: // 升星点击宠物 { Transform itemTrans = m_PartnerListGrid.transform.FindChild("00"); if (itemTrans) { PartnerFrameItemLogic FellowItem = itemTrans.GetComponent <PartnerFrameItemLogic>(); if (FellowItem) { NewPlayerGuidLogic.OpenWindow(FellowItem.gameObject, 270, 110, Utils.GetDicByID(10420), "right", 0, true, true); } } } break; case 3: if (MenuBarLogic.Instance()) { MenuBarLogic.Instance().NewPlayerGuide(101); } m_NewPlayerGuideFlag_Step = -1; break; case 4: // 强制点击画面中心空格 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Skill.Instance().m_LearnSkillAddSkillBook.gameObject, 70, 80, "", "left", 0, true, true); break; case 5: // 强制选中第一本技能书(任务需要) Transform skillbookItem = PartnerFrameLogic_Skill.Instance().m_SkillChooseGrid.transform.FindChild("00"); if (skillbookItem != null) { NewPlayerGuidLogic.OpenWindow(skillbookItem.FindChild("ChooseButton").gameObject, 145, 50, "", "left", 0, true, true); } else { NewPlayerGuideFlag_Step = -1; } break; case 6: // 点击学习 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Skill.Instance().m_LearnSkillWindow.transform.FindChild("LearnSkillButton").gameObject, 160, 65, "", "left", 0, true, true); break; case 7: // 学习成功,关闭界面 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Skill.Instance().m_LearnSkillCloseButton, 50, 50, "", "left", 0, true, true); NewPlayerGuideFlag_Step = -1; break; case 12: // 学习技能引导,点击技能分页 NewPlayerGuidLogic.OpenWindow(m_TabController.GetTabButtonObj("Button3-Skill"), 160, 70, Utils.GetDicByID(11425), "left", 0, true, true); break; case 13: // 强制点击【学习技能】,后接4 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Skill.Instance().m_LearnSkillOpenButton.gameObject, 160, 65, "", "left", 0, true, true); break; case 14: // 伙伴升星,强制点开升星分页,加提示文字(字典号11425) NewPlayerGuidLogic.OpenWindow(m_TabController.GetTabButtonObj("Button2-Develop"), 160, 70, Utils.GetDicByID(11425), "left", 0, true, true); break; case 16: // 引导点击升星按钮 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Star.Instance().m_StarButton, 160, 65, "", "left", 0, true, true); break; case 17: // 引导点击狗粮宠物(狗粮宠物默认放在最左侧第一个宠物格位置)(字典号11426) GameObject FTEFellow = PartnerFrameLogic_Star.Instance().m_ChooseMaterialGrid.transform.FindChild("a41").gameObject; if (FTEFellow != null) { NewPlayerGuidLogic.OpenWindow(FTEFellow, 68, 78, Utils.GetDicByID(11426), "left", 0, true, true); } break; case 18: // 引导点击升星确认按钮 GameObject OKBtn = PartnerFrameLogic_Star.Instance().m_ChooseMaterialWindow.transform.FindChild("OkButon").gameObject; if (OKBtn != null) { NewPlayerGuidLogic.OpenWindow(OKBtn, 160, 65, "", "left", 0, true, true, false, null, () => { m_NewPlayerGuideFlag_Step = -1; }); } break; case 20: // 1.指向左侧标签中的宠物宝宝11454; GameObject babyItem = null; foreach (Transform item in m_PartnerListGrid.GetComponent <UIGrid>().GetChildList()) { if (item.GetComponent <PartnerFrameItemLogic>().FellowInfo.GetFellowType() == (int)FELLOWTYPE.BABY) { babyItem = item.gameObject; break; } } if (babyItem != null) { NewPlayerGuidLogic.OpenWindow(babyItem, 270, 110, Utils.GetDicByID(11454), "right", 2); } NewPlayerGuideFlag_Step = -1; break; case 21: // 2.指向宝宝属性中的“繁殖次数”位置,说明升级到15级之后,宝宝拥有克隆次数11455 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Info.Instance().m_ProCreateLabel.gameObject, 150, 40, Utils.GetDicByID(11455), "left", -1, true, true, false, null, null, 0, 0, true, false, () => { NewPlayerGuidLogic.CloseWindow(); }); NewPlayerGuideFlag_Step = -1; break; case 22: //完成1次宠物克隆(任务描述中说明步骤,且当玩家带有这个任务打开宠物界面的时候,1.指向【克隆】分页,2,指向加号,说明需要组队完成 NewPlayerGuidLogic.OpenWindow(m_TabController.GetTabButtonObj("Button4-Bleeding"), 160, 70, Utils.GetDicByID(11456), "left", 2); NewPlayerGuideFlag_Step = -1; break; case 23: //2,指向加号,说明需要组队完成 NewPlayerGuidLogic.OpenWindow(PartnerFrameLogic_Breeding.Instance().m_PushPartnerButton, 310, 300, Utils.GetDicByID(11457), "left", 2); NewPlayerGuideFlag_Step = -1; break; default: break; } }
public void InitPartnerList(UInt64 defaultGuid = GlobeVar.INVALID_GUID, Predicate <Fellow> filter = null) { if (m_PartnerListGrid != null) { //先清空 Utils.CleanGrid(m_PartnerListGrid); m_PartnerList.SetActive(true); FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container == null) { return; } //遍历伙伴容器 bool bFirst = true; List <Fellow> fellowList = FellowTool.FellowSort(container); PartnerFrameItemLogic firstOneCache = null; bool needReSelect = false; bool needToTopReset = false; int firstOneCacheIndex = 0; for (int i = 0; i < fellowList.Count; ++i) { //有效槽位 Fellow fellow = fellowList[i]; if (fellow.IsValid()) { if (filter != null && !filter(fellow)) { if (firstOneCache == null) { firstOneCacheIndex += 1; } if (fellow.Guid == defaultGuid) { needReSelect = true; } continue; } string objectName = ""; if (i < 10) { objectName += "0"; } objectName += i.ToString(); GameObject fellowobject = Utils.BindObjToParent(m_PartnerListItem, m_PartnerListGrid, objectName); if (fellowobject != null && fellowobject.GetComponent <PartnerFrameItemLogic>() != null) { fellowobject.GetComponent <PartnerFrameItemLogic>().UpdateFellowInfo(fellow); if (i == firstOneCacheIndex) { firstOneCache = fellowobject.GetComponent <PartnerFrameItemLogic>(); } if (defaultGuid == GlobeVar.INVALID_GUID) { if (bFirst) { fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick(); bFirst = false; needToTopReset = true; } } else { if (fellow.Guid == defaultGuid) { fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick(); } } } } } if (needReSelect && firstOneCache != null) { needToTopReset = true; firstOneCache.OnFellowClick(); } // add cloning fellow in info view if (filter == null && GameManager.gameManager.PlayerDataPool.IsProcreateGoing()) { GameObject fellowobject = Utils.BindObjToParent(m_PartnerListItem, m_PartnerListGrid, "z00"); if (fellowobject != null && fellowobject.GetComponent <PartnerFrameItemLogic>() != null) { fellowobject.GetComponent <PartnerFrameItemLogic>().ShowCloningInfo(); if (fellowList.Count == 0) { fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick(); } } } m_PartnerListGrid.GetComponent <UIGrid>().Reposition(); if (needToTopReset) { m_PartnerListGrid.GetComponent <UITopGrid>().Recenter(true); } m_PartnerCapacity.text = container.GetCapacityStr(); } UpdateFellowTip(); }