IEnumerator TimingSkip() { while (!TwFinished) { yield return(null); } PositionTweener.onFinished.Clear(); PositionTweener2.SetOnFinished(delegate() { FusionAudio.PostEvent("UI/Battle/StartBattle"); GlobalMenuManager.Instance.Open("LTHeroBattleMenu", LTHeroBattleModel.GetInstance().choiceData); Container.CustomSetActive(false); }); PositionTweener.from.x = TP1FromX[1]; PositionTweener.to.x = TP1FromX[2]; PositionTweener2.from.x = TP2FromX[1]; PositionTweener2.to.x = TP2FromX[2]; while (LTHeroBattleModel.GetInstance().choiceData.choiceState != 1) { yield return(null); } PositionTweener.ResetToBeginning(); PositionTweener.PlayForward(); PositionTweener2.ResetToBeginning(); PositionTweener2.PlayForward(); }
public override IEnumerator OnRemoveFromStack() { isPVPSelectPartner = false; LTHeroBattleModel.GetInstance().F_ClearData(); LTHeroBattleEvent.NotifyHeroBattleHudFinish -= OnNotifyHeroBattleFinish; return(base.OnRemoveFromStack()); }
void OnConfirmChoiceHero() { int choiceHeroTplID = LTHeroBattleModel.GetInstance().choiceData.choiceHeroTplID; int suitIndex = LTHeroBattleModel.GetInstance().choiceData.choiceSuitIndex; int suitID = LTHeroBattleModel.GetInstance().choiceData.choiceHeroCellData.suits[suitIndex]; //LTHeroBattleModel.GetInstance().c PostChoiceHero(choiceHeroTplID, suitID); }
IEnumerator TestOpen() { while (true) { if (Input.GetKeyDown(KeyCode.K)) { GlobalMenuManager.Instance.Open("LTHeroBattleMatch", LTHeroBattleModel.GetInstance().matchData); } yield return(null); } }
public void OnUpdate(object obj) { VictoryCount = EB.Dot.Integer("win", obj, VictoryCount); DefeatCount = EB.Dot.Integer("lost", obj, DefeatCount); IsGetReward = EB.Dot.Bool("isGetReward", obj, IsGetReward); FreeHeros = Hotfix_LT.EBCore.Dot.Array("freeHeroes", obj, FreeHeros); BaseHeroes = Hotfix_LT.EBCore.Dot.Array("baseHeroes", obj, BaseHeroes); if (BaseHeroes != null) { LTHeroBattleModel.GetInstance().SetMatchBase(this); } }
private bool HeroInTeam(int herotpid) { for (int i = 0; i < m_TeamCard.Length; i++) { HeroBattleChoiceCellData partnerData = m_TeamCard[i].F_GetCurrentPartnerData(); if (partnerData != null && LTHeroBattleModel.GetInstance().choiceData != null && LTHeroBattleModel.GetInstance().choiceData.choiceState != 0 && herotpid == partnerData.heroTplID) { return(true); } } return(false); }
void NotifyRefreshChoiceState(HeroBattleChoiceData data) { if (LTHeroBattleModel.GetInstance().isWaitingMatch) //如果是匹配后第一次收到数据 需要打开vs数据并2秒后打开 { LTHeroBattleModel.GetInstance().isWaitingMatch = false; LTHeroBattleModel.GetInstance().matchData.isWaiting = false; LadderMatchSuccessUIController.InfoData info = new LadderMatchSuccessUIController.InfoData(); info.type = 1; info.info = data; GlobalMenuManager.Instance.CloseMenu("LTHeroBattleMatch"); GlobalMenuManager.Instance.Open("LTMatchSuccessUI", info); } }
/// <summary> /// 点击按钮 /// </summary> /// <param name="go"></param> private void OnClickCard(GameObject go) { //判断当前的操作执行是否可以点击 if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 1 && LTHeroBattleModel.GetInstance().choiceData.openUid == LTHeroBattleModel.GetInstance().choiceData.selfInfo.uid && !m_Data.isUsed) { FusionAudio.PostEvent("UI/General/ButtonClick", true); if (m_Data != null) { LTHeroBattleEvent.ChoiceHero(m_Data.heroTplID); } } }
public void OnUpdate(object obj) { ArrayList sides = Hotfix_LT.EBCore.Dot.Array("sides", obj, null); if (sides != null) { Sides = new ClientSideData[sides.Count]; for (int i = 0; i < sides.Count; i++) { Sides[i] = new ClientSideData(); Sides[i].Uid = EB.Dot.Integer("uid", sides[i], Sides[i].Uid); Sides[i].Name = EB.Dot.String("name", sides[i], Sides[i].Name); Sides[i].Level = EB.Dot.Integer("level", sides[i], Sides[i].Level); Sides[i].Portrait = EB.Dot.String("portrait", sides[i], Sides[i].Portrait); if (string.IsNullOrEmpty(Sides[i].Portrait)) { Sides[i].Portrait = "Partner_Head_Sidatuila"; } string frameStr = EB.Dot.String("headFrame", sides[i], null); Sides[i].Frame = EconemyTemplateManager.Instance.GetHeadFrame(frameStr).iconId; ArrayList arraySelects = Johny.ArrayListPool.Claim(); ArrayList arraybands = Johny.ArrayListPool.Claim(); arraybands = Hotfix_LT.EBCore.Dot.Array("bandTplIds", sides[i], arraybands); arraySelects = Hotfix_LT.EBCore.Dot.Array("selectedTplIds", sides[i], arraySelects); Sides[i].BandTplIds = new string[arraybands.Count]; Sides[i].SelectHeroIds = new List <Hashtable>(); for (int j = 0; j < arraybands.Count; j++) { Sides[i].BandTplIds[j] = arraybands[j] as string; } for (var k = 0; k < arraySelects.Count; k++) { Hashtable v = arraySelects[k] as Hashtable; Sides[i].SelectHeroIds.Add(v as Hashtable); } } } else { EB.Debug.Log("sides == null"); } Status = EB.Dot.String("status", obj, Status); OpenUid = EB.Dot.Integer("opUid", obj, OpenUid); NextTS = EB.Dot.Integer("nextTs", obj, NextTS); LTHeroBattleModel.GetInstance().SetChoiceData(this); }
protected override void UpdateTimeLabelContent(ref float time) { float buff = Time.unscaledTime - time; if (Mathf.RoundToInt(buff) >= 1) { time = time + 1; _lessTime -= 1; //等功能完成后在此后加入放大缩小的动画 LTUIUtil.SetText(timeLabel, _lessTime.ToString()); if (m_ConfirmBtn.activeSelf) { if (LadderManager.Instance.IsTrusteeship && _lessTime < 7 && LadderManager.Instance.IsTrusteeship && _lessTime > 0)//托管 { switch (m_HeroBattleChoiceData.choiceState) { case 0: if (LTHeroBattleEvent.ConfirmBanHero != null) { FusionAudio.PostEvent("UI/New/JinRen", true); int heroTplID = m_TeamPlane[1].GetAutoSelectHero(); LTHeroBattleModel.GetInstance().SetChoiceHero(heroTplID); LTHeroBattleEvent.ConfirmBanHero(); } break; case 1: if (LTHeroBattleEvent.ConfirmChoiceHero != null) { int heroTplID = m_TeamPlane[0].GetAutoSelectHero(); LTHeroBattleModel.GetInstance().SetChoiceHero(heroTplID); LTHeroBattleEvent.ConfirmChoiceHero(); } break; default: EB.Debug.LogError("不应该存在其他情况下的,点击确认按钮情况存在的"); break; } } } if (_lessTime < 10) { FusionAudio.PostEvent("UI/New/DaoShu", true); } } }
public void PostQuitMatch() { api.QuitMatchOther((EB.Sparx.Response response) => { if (response.sucessful) { LTHeroBattleModel.GetInstance().isWaitingMatch = false; LTHeroBattleModel.GetInstance().matchData.isWaiting = false; // if (LTHeroBattleEvent.NotifyQuitMatchOther != null) // { // LTHeroBattleEvent.NotifyQuitMatchOther(); // } return(true); } return(false); }); }
/// <summary> /// 点击确认按钮 /// </summary> /// <param name="btn">按钮对象</param> private void OnClickConformBtn(GameObject btn) { if (m_HeroBattleChoiceData == null) { EB.Debug.LogError("不应该这个时间没有数据,请检验"); return; } if (LadderManager.Instance.IsTrusteeshiping()) { return; } //判断当前的操作状态 switch (m_HeroBattleChoiceData.choiceState) { case 0: if (LTHeroBattleModel.GetInstance().choiceData.choiceHeroCellData == null) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_Tips")); return; } if (LTHeroBattleEvent.ConfirmBanHero != null) { FusionAudio.PostEvent("UI/New/JinRen", true); LTHeroBattleEvent.ConfirmBanHero(); } break; case 1: if (LTHeroBattleModel.GetInstance().choiceData.choiceHeroCellData == null) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_14889")); return; } if (LTHeroBattleEvent.ConfirmChoiceHero != null) { LTHeroBattleEvent.ConfirmChoiceHero(); } break; default: EB.Debug.LogError("不应该存在其他情况下的,点击确认按钮情况存在的"); break; } }
public void PoseQuitMatchAndClose() { api.QuitMatchOther((EB.Sparx.Response response) => { if (response.sucessful) { LTHeroBattleModel.GetInstance().isWaitingMatch = false; LTHeroBattleModel.GetInstance().matchData.isWaiting = false; // if (LTHeroBattleEvent.NotifyQuitMatchOther != null) // { // LTHeroBattleEvent.NotifyQuitMatchOther(); // } GlobalMenuManager.Instance.CloseMenu("LTHeroBattleMatch"); return(true); } return(false); }); }
/// <summary> /// 点击阵型里的伙伴 /// </summary> /// <param name="cardItem">点击的卡片item</param> private void OnClickPartnerItem(LTPVPTeamCardInfo cardItem) { HeroBattleChoiceCellData partnerData = cardItem.F_GetCurrentPartnerData(); if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 && LTHeroBattleModel.GetInstance().choiceData.openUid == LTHeroBattleModel.GetInstance().choiceData.selfInfo.uid && !m_IsSelfTeam && partnerData != null) { //通知选中的人 FusionAudio.PostEvent("UI/General/ButtonClick", true); LTHeroBattleEvent.ChoiceHero(partnerData.heroTplID); // for (int i = 0; i < m_TeamCard.Length; i++) { m_TeamCard[i].F_SetLockState(m_TeamCard[i] == cardItem); } } }
public void SetChoiceHero(int heroTplID) { choiceData.choiceHeroTplID = heroTplID; HeroBattleChoiceCellData data = null; //禁用情况的判断 if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 && LTHeroBattleModel.GetInstance().choiceData.otherInfo.uid == 0) { data = GetMonsterInfo(heroTplID, 0); } else if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 && LTHeroBattleModel.GetInstance().choiceData.otherInfo.uid != 0) { List <HeroBattleChoiceCellData> templist = LTHeroBattleModel.GetInstance().choiceData.otherChoices; for (int i = 0; i < templist.Count; i++) { if (templist[i].heroTplID == heroTplID) { data = templist[i]; break; } } if (data == null) { data = GetHeroCellCommon(heroTplID); } } else { data = GetHeroCellCommon(heroTplID); } choiceData.choiceHeroCellData = data; // if (LTHeroBattleEvent.NotifyChangeChoiceHeroTplID != null) // { // LTHeroBattleEvent.NotifyChangeChoiceHeroTplID(heroTplID); // } if (LTHeroBattleEvent.NotifyChangeChoiceHero != null) { LTHeroBattleEvent.NotifyChangeChoiceHero(choiceData.choiceHeroCellData); } }
public void PostStartMatch() { LTHeroBattleModel.GetInstance().isWaitingMatch = true; LTHeroBattleModel.GetInstance().matchData.isWaiting = true; api.StartMatchOther((EB.Sparx.Response response) => { if (response.sucessful) { // if (LTHeroBattleEvent.NotifyMatchOtherWaiting != null) // { // LTHeroBattleEvent.NotifyMatchOtherWaiting(); // } return(true); } else if (response.error.ToString().Equals("Error: no server found") || response.error.ToString().Equals("Error: service not found")) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleMatchHudController_10973")); LTHeroBattleModel.GetInstance().isWaitingMatch = false; LTHeroBattleModel.GetInstance().matchData.isWaiting = false; return(true); } return(false); }); }
void OnChoiceHero(int heroTplID) { LTHeroBattleModel.GetInstance().SetChoiceHero(heroTplID); }
HeroBattleMatchData OnGetMatchData() { PostGetMatchBaseInfo(); //申请最新数据 return(LTHeroBattleModel.GetInstance().matchData); }
void OnConfirmBanHero() { int banHeroTplID = LTHeroBattleModel.GetInstance().choiceData.choiceHeroTplID; PostBanHero(banHeroTplID); }
void OnChoiceSuitIndex(int suitIndex) { LTHeroBattleModel.GetInstance().choiceData.choiceSuitIndex = suitIndex; }
void OnChangeHeroType(Hotfix_LT.Data.eRoleAttr type) { LTHeroBattleModel.GetInstance().SetChoiceHeroType(type); }
/// <summary> /// 刷新全部需要的数据(通过简单数据后使用) /// </summary> public void Refresh() { lessPoint = 10; for (int i = 0; i < selfChoices.Count; i++) { lessPoint -= selfChoices[i].choiceSpend; } //foreach (var baseCellData in LTHeroBattleModel.GetInstance().matchData.listBaseHeroCell) //{ // if (FindChoicePoolData(baseCellData.heroTplID) == null) // { // dicHeroChoiceData[baseCellData.type].Add(baseCellData); // } //} //foreach (var freeCellData in LTHeroBattleModel.GetInstance().matchData.listLimitFreeCell) //{ // if (FindChoicePoolData(freeCellData.heroTplID)==null) // { // dicHeroChoiceData[freeCellData.type].Add(freeCellData); // } //} foreach (var type in dicHeroChoiceData.Keys) { List <HeroBattleChoiceCellData> list = dicHeroChoiceData[type]; for (int j = 0; j < list.Count; j++) { list[j].isBan = false; list[j].isUsed = false; list[j].isFree = LTHeroBattleModel.GetInstance().IsFreeHero(list[j].heroTplID); list[j].isSpend = list[j].choiceSpend <= lessPoint; //list[j].isUnLock = generalPL[i].HeroId > 0; } } //List<LTPartnerData> generalPL = LTPartnerDataManager.Instance.GetGeneralPartnerList(); //for (int i = 0; i < generalPL.Count; i++) //{ // Hotfix_LT.Data.eRoleAttr type = generalPL[i].HeroInfo.char_type; // if (!dicHeroChoiceData.ContainsKey(type)) // { // EB.Debug.LogError("Dont find Hotfix_LT.Data.eRoleAttr " + type + " or Not InitAllHero"); // break; // } // List<HeroBattleChoiceCellData> list = dicHeroChoiceData[type]; // for (int j = 0; j < list.Count; j++) // { // if (list[j].heroTplID == generalPL[i].StatId) // { // list[j].isBan = false; // list[j].isUsed = false; // list[j].isFree = LTHeroBattleModel.GetInstance().IsFreeHero(list[j].heroTplID); // list[j].isSpend = list[j].choiceSpend <= lessPoint; // list[j].isUnLock = generalPL[i].HeroId > 0; // break; // } // } //} lessPoint = 10; for (int i = 0; i < selfChoices.Count; i++) { selfChoices[i].isUsed = true; lessPoint -= selfChoices[i].choiceSpend; } otherLessPoint = 10; for (int i = 0; i < otherChoices.Count; i++) { otherChoices[i].isUsed = true; otherLessPoint -= otherChoices[i].choiceSpend; } for (int i = 0; i < selfBans.Count; i++) { selfBans[i].isBan = true; var choicePoolData = FindChoicePoolData(selfBans[i].heroTplID); if (choicePoolData != null) { choicePoolData.isBan = true; } } for (int i = 0; i < otherBans.Count; i++) { otherBans[i].isBan = true; var choicePoolData = FindChoicePoolData(otherBans[i].heroTplID); if (choicePoolData != null) { choicePoolData.isBan = true; } } }
public void ShowUI(object info) { Container.CustomSetActive(true); FusionAudio.PostEvent("UI/New/JueDou", true); InfoData data = info as InfoData; string myName; if (data == null) { if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString()); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; string playerName = EB.Dot.String("ladder.match_result.playerName", info, ""); int score = EB.Dot.Integer("ladder.match_result.point", info, 0); string portrait = EB.Dot.String("ladder.match_result.portrait", info, ""); int skin = EB.Dot.Integer("ladder.match_result.skin", info, 0); string frame = EB.Dot.String("ladder.match_result.headFrame", info, null); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName)); LTUIUtil.SetText(YourScoreLabel, score.ToString()); //记录天梯分值 LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point; LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score; // if (!string.IsNullOrEmpty(portrait)) { YourPortrait.spriteName = portrait; } else { YourPortrait.spriteName = "Partner_Head_Sidatuila"; } YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId; StartCoroutine(TimingSkip()); } else { switch (data.type) { case 0: if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString()); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; string playerName = EB.Dot.String("ladder.match_result.playerName", data.info, ""); int score = EB.Dot.Integer("ladder.match_result.point", data.info, 0); string portrait = EB.Dot.String("ladder.match_result.portrait", data.info, ""); int skin = EB.Dot.Integer("ladder.match_result.skin", data.info, 0); string frame = EB.Dot.String("ladder.match_result.headFrame", data.info, null); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName)); LTUIUtil.SetText(YourScoreLabel, score.ToString()); //记录天梯分值 LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point; LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score; // if (!string.IsNullOrEmpty(portrait)) { YourPortrait.spriteName = portrait; } else { YourPortrait.spriteName = "Partner_Head_Sidatuila"; } YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId; StartCoroutine(TimingSkip()); break; case 1: HeroBattleChoiceData choiceData = data.info as HeroBattleChoiceData; LTUIUtil.SetText(TypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473")); LTUIUtil.SetText(YourTypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473")); StartCoroutine(OpenHeroBattleHud()); if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; LTUIUtil.SetText(MyScoreLabel, BalanceResourceUtil.GetUserLevel().ToString()); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(choiceData.otherInfo.name)); YourPortrait.spriteName = choiceData.otherInfo.portrait; YourFrame.spriteName = choiceData.otherInfo.frame; LTUIUtil.SetText(YourScoreLabel, choiceData.otherInfo.level.ToString()); break; } } }