public override void Init(ChatInfoSelectLinkLogic.Data data, int index) { base.Init(data, index); this.name = index.ToString(); FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container == null) { return; } Fellow fellow = container.GetFellowByGuid(data.guid); if (null == fellow) { return; } m_fellowIcon.spriteName = fellow.GetIcon(); m_fellowName.text = fellow.Name; m_level.text = fellow.Level.ToString(); m_combatValue.text = fellow.GetCombatValue().ToString(); m_fellowQuality.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality); this.m_fellowGuid = data.guid; }
public uint Execute(PacketDistributed ipacket) { GC_CALL_FELLOW_RET packet = (GC_CALL_FELLOW_RET)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } UInt64 fellowGuid = packet.Guid; int fellowObjId = packet.Objid; if (fellowGuid == GlobeVar.INVALID_GUID) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(fellowGuid); if (fellow != null) { //设置为召出 fellow.Called = true; if (PartnerFrameLogic.Instance() != null) { if (PartnerFrameLogic_Info.Instance() != null) { PartnerFrameLogic_Info.Instance().UpdateFellowInfo(fellow, false); } if (PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 1) { if (MenuBarLogic.Instance()) { //MenuBarLogic.Instance().NewPlayerGuide(101); } //PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step = -1; } //UIManager.CloseUI(UIInfo.PartnerFrameRoot); } } } Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjId = fellowObjId; Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid = fellowGuid; //播放召出特效 GameManager.gameManager.PlayerDataPool.FellowPlayerEffect = true; //enter your logic return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
void InitMaterialPartnerGrid() { Utils.CleanGrid(m_MaterialPartnerGrid); // 先加载个加宠物按钮 靠前显示 if (false == CreateAddMaterialBtn()) { return; } //m_MaterialPartnerLabel.SetActive(m_ChoosePartnerGuid.Count <= 0); FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container == null) { return; } for (int i = 0; i < m_ChoosePartnerGuid.Count; i++) { if (m_ChoosePartnerGuid[i] == GlobeVar.INVALID_GUID) { break; } Fellow fellow = container.GetFellowByGuid(m_ChoosePartnerGuid[i]); if (fellow == null || false == fellow.IsValid() || fellow.Guid == m_Fellow.Guid || fellow.Locked) { break; } string objectName = i + 1 < 10 ? "0" + (i + 1).ToString() : (i + 1).ToString(); GameObject fellowobject = Utils.BindObjToParent(m_MaterialPartnerItem, m_MaterialPartnerGrid, objectName); if (fellowobject == null || fellowobject.GetComponent <MaterialPartnerItemLogic>() == null) { break; } fellowobject.GetComponent <MaterialPartnerItemLogic>().Init(fellow); } if (m_MaterialPartnerGrid.GetComponent <UIGrid>() != null) { m_MaterialPartnerGrid.GetComponent <UIGrid>().Reposition(); } //UpdateFellowInfo_NextStar(m_Fellow, m_ChoosePartnerExp); }
int GetCurBattleFellowExp() { int nFexp = 0; FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid); if (fellow != null) { nFexp = fellow.Exp; } } return(nFexp); }
void UpdateSweepAwardFellowExp() { m_nFellowExpCurStep = 0; int nCurLevel = -1; FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid); if (fellow != null) { nCurLevel = fellow.Level; } } if (m_nFellowLevelBeforeSweep == nCurLevel) { MyTweenNum tw = new MyTweenNum(); tw.From = m_FellowExpSlider.value; tw.To = CalFellowExpSliderValue(); m_FellowExpTweenNumList.Add(tw); } else if (m_nFellowLevelBeforeSweep < nCurLevel) { for (int i = m_nFellowLevelBeforeSweep; i <= nCurLevel; ++i) { MyTweenNum tw = new MyTweenNum(); if (i == m_nFellowLevelBeforeSweep) { tw.From = m_FellowExpSlider.value; tw.To = 1f; m_FellowExpTweenNumList.Add(tw); } else if (i > m_nFellowLevelBeforeSweep && i < nCurLevel) { tw.From = 0f; tw.To = 1f; m_FellowExpTweenNumList.Add(tw); } else if (i == nCurLevel) { tw.From = 0; tw.To = CalFellowExpSliderValue(); m_FellowExpTweenNumList.Add(tw); } } } }
int GetCurLevelBattleFellowTotalExp() { int nCurLevelTotalFexp = 0; FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid); if (fellow != null) { Tab_LevelUp curTabLevelup = TableManager.GetLevelUpByID(fellow.Level, 0); nCurLevelTotalFexp = curTabLevelup.FellowExpNeed; } } return(nCurLevelTotalFexp); }
public uint Execute(PacketDistributed ipacket) { GC_UNCALL_FELLOW_RET packet = (GC_UNCALL_FELLOW_RET)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } UInt64 fellowGuid = packet.Guid; if (fellowGuid == GlobeVar.INVALID_GUID) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(fellowGuid); if (fellow != null) { //ÉèÖÃΪÕÙ»Ø fellow.Called = false; if (PartnerFrameLogic_Info.Instance() != null) { PartnerFrameLogic_Info.Instance().UpdateFellowInfo(fellow, false); } } } Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjId = -1; Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid = GlobeVar.INVALID_GUID; //enter your logic return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
private void Sweep(int nCount) { ClearSweepAwardInfo(); // 扫荡前人物等级 Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (null != mainPlayer) { m_nLevelBeforeSweep = mainPlayer.BaseAttr.Level; } // 扫荡前宠物等级 FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container != null) { Fellow fellow = container.GetFellowByGuid(Singleton <ObjManager> .GetInstance().MainPlayer.CurFellowObjGuid); if (fellow != null) { m_nFellowLevelBeforeSweep = fellow.Level; } } // 扫荡前经验条 m_ExpSlider.value = (float)CalExpSliderValue(); // 扫荡前宠物经验条 m_FellowExpSlider.value = (float)CalFellowExpSliderValue(); // 请求扫荡 if (null != GameManager.gameManager.PlayerDataPool.JuQingCopySceneData) { GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.ReqSweepStoryCopyScene(m_nStoryCopySceneID, nCount); } }