public void TeamData(CopySceneTeamPlayerInfo player, CopyInItemDataInfo _data) //int _copyGroupID) { data = _data; if (player == null) { teamData = null; if (isAvatar != null) { isAvatar.SetActive(false); } } else { OtherPlayerInfo info = GameCenter.duplicateMng.GetInvitationPlayerData(player.pId); if (info != null) { st.net.NetBase.team_member_list baseInfo = new st.net.NetBase.team_member_list(); baseInfo.uid = (uint)info.ServerInstanceID; baseInfo.name = info.Name; baseInfo.prof = (uint)info.Prof; baseInfo.fighting = (uint)info.FightValue; baseInfo.lev = (uint)info.Level; teamData = new TeamMenberInfo(baseInfo); if (isAvatar != null) { isAvatar.SetActive(player.isAvatar); } } else { if (player.pId == GameCenter.teamMng.LeaderId && GameCenter.teamMng.isLeader) { st.net.NetBase.team_member_list mPlayer = new st.net.NetBase.team_member_list(); mPlayer.uid = (uint)GameCenter.mainPlayerMng.MainPlayerInfo.ServerInstanceID; mPlayer.prof = (uint)GameCenter.mainPlayerMng.MainPlayerInfo.Prof; mPlayer.fighting = (uint)GameCenter.mainPlayerMng.MainPlayerInfo.FightValue; mPlayer.lev = (uint)GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel; mPlayer.name = GameCenter.mainPlayerMng.MainPlayerInfo.Name; teamData = new TeamMenberInfo(mPlayer); } else { if (GameCenter.teamMng.TeammatesDic.ContainsKey(player.pId)) { teamData = GameCenter.teamMng.TeammatesDic[player.pId] as TeamMenberInfo; } } if (isAvatar != null) { isAvatar.SetActive(false); } } } ShowData(); }
/// <summary> /// 单人副本再次挑战 /// </summary> public void AgainToCopyItem() { if (copyDic.ContainsKey(againCopyID) && copyDic[againCopyID].num > 0) { C2S_ToCopyItem(againCopyID, againSceneID); } else if (copyDic.ContainsKey(againCopyID)) { CopyInItemDataInfo _serData = copyDic[againCopyID]; CopyGroupRef refdata = ConfigMng.Instance.GetCopyGroupRef(_serData.id); if (_serData.buyNum > 0)//可购买次数大于0,弹出快捷购买次数 { //Debug.Log("快捷购买"); //CopyGroupRef copyGroupRef = int needGold = GetDiamoNum(_serData.buyNum, refdata); MessageST msg = new MessageST(); msg.messID = 530; msg.words = new string[1] { needGold.ToString() }; msg.delYes = delegate { //Debug.Log("lcopyGroupRef.id" + GameCenter.duplicateMng.lcopyGroupRef.id); //元宝是否充足 if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount >= (ulong)needGold) { C2S_BuyCopyInItem(refdata.id, 1); C2S_ToCopyItem(againCopyID, againSceneID); } else { MessageST mst = new MessageST(); mst.messID = 137; mst.delYes = delegate { // 跳转到充值界面 GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(mst); } }; GameCenter.messageMng.AddClientMsg(msg); } else { GameCenter.messageMng.AddClientMsg(167); } } else { Debug.Log("副本字典中不包含ID为:" + againCopyID + "副本数据"); } }
public void SetStar(int copyGID) { CopyInItemDataInfo serData = null; if (GameCenter.duplicateMng.CopyDic.TryGetValue(copyGID, out serData)) { int curStar = serData.copyScenes.ContainsKey(CopyRefID) ? serData.copyScenes[CopyRefID].star : 0; for (int i = 0, len = star.Length; i < len; i++) { if (star[i] != null) { if (i < curStar) { star[i].gameObject.GetComponent <UISpriteEx>().IsGray = UISpriteEx.ColorGray.normal; } else { star[i].gameObject.GetComponent <UISpriteEx>().IsGray = UISpriteEx.ColorGray.Gray; } } } return; } else { Debug.LogError("升级后没有服务端数据过来,找小唔知!"); } for (int i = 0, len = star.Length; i < len; i++) { if (star[i] != null) { star[i].gameObject.SetActive(false); } } }
void SendMsg(GameObject _go) { CopyInItemDataInfo serData = null; if (GameCenter.duplicateMng.lcopyGroupRef != null) { if (GameCenter.duplicateMng.CopyDic.TryGetValue(GameCenter.duplicateMng.lcopyGroupRef.id, out serData)) { if (GameCenter.endLessTrialsMng.sweepType == EndLessTrialsMng.SweepType.EndLess && !GameCenter.endLessTrialsMng.IsSweepingEndless) { return; } if (serData.num <= 0) { GameCenter.duplicateMng.PopTip(serData, GameCenter.duplicateMng.lcopyGroupRef, GameCenter.endLessTrialsMng.sweepCopyID, true, GameCenter.endLessTrialsMng.sweepType == EndLessTrialsMng.SweepType.COPY); return; } if (GameCenter.endLessTrialsMng.sweepType == EndLessTrialsMng.SweepType.COPY) { if (GameCenter.duplicateMng.isShowBuySweepItem) { if (GameCenter.inventoryMng.GetNumberByType(2210001) <= 0)//新增扫荡卷轴消耗 { EquipmentInfo eqinfo = new EquipmentInfo(2210001, EquipmentBelongTo.PREVIEW); MessageST mst = new MessageST(); object[] pa = { 1 }; mst.pars = pa; mst.delPars = delegate(object[] ob) { if (ob.Length > 0) { bool b = (bool)ob[0]; if (b) { GameCenter.duplicateMng.isShowBuySweepItem = false; } } }; mst.messID = 543; mst.words = new string[1] { eqinfo.DiamondPrice.ToString() }; mst.delYes = delegate { if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount >= eqinfo.DiamondPrice) { GameCenter.endLessTrialsMng.C2S_SweepReward((int)GameCenter.endLessTrialsMng.sweepType, GameCenter.endLessTrialsMng.sweepCopyID);//点击确定进入扫荡后台判断是否购买 } else { MessageST mst1 = new MessageST(); mst1.messID = 137; mst1.delYes = delegate { GameCenter.uIMng.ReleaseGUI(GUIType.SWEEPCARBON); GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(mst1); } }; GameCenter.messageMng.AddClientMsg(mst); return; } } } } } GameCenter.endLessTrialsMng.C2S_SweepReward((int)GameCenter.endLessTrialsMng.sweepType, GameCenter.endLessTrialsMng.sweepCopyID); }
/// <summary> /// 弹出快捷购买提示 /// </summary> public void PopTip(CopyInItemDataInfo _serData, CopyGroupRef _data, int _type, bool _isSweep, bool _isUseSweepItem) { if (_serData == null || _data == null) { return; } bool isShowTip = true; if (_serData.buyNum > 0)//可购买次数大于0,弹出快捷购买次数 { if (GameCenter.endLessTrialsMng.sweepType == EndLessTrialsMng.SweepType.COPY) { isShowTip = isShowBuyCopyTip; } if (isShowTip) { int needGold = GetDiamoNum(_serData.buyNum, _data); MessageST msg = new MessageST(); object[] pa = { 1 }; msg.pars = pa; msg.delPars = delegate(object[] ob) { if (ob.Length > 0) { bool b = (bool)ob[0]; if (b) { isShowBuyCopyTip = false; } } }; msg.messID = 499; msg.words = new string[1] { needGold.ToString() }; msg.delYes = delegate { //元宝是否充足 if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount >= (ulong)needGold) { if (_isSweep && _isUseSweepItem)//是否是扫荡 { ShowBuySweepItemPop(_data.id, _type); } else { GameCenter.duplicateMng.C2S_BuyCopyInItem(_data.id, 1); GameCenter.duplicateMng.C2S_ToCopyItem(_data.id, _type); } } else { MessageST mst = new MessageST(); mst.messID = 137; mst.delYes = delegate { GameCenter.uIMng.ReleaseGUI(GUIType.SWEEPCARBON); // 跳转到充值界面 GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(mst); } }; GameCenter.messageMng.AddClientMsg(msg); } else//不用弹购买提示 { if (_isUseSweepItem && isShowBuySweepItem) { ShowBuySweepItemPop(_data.id, _type); } else { GameCenter.duplicateMng.C2S_BuyCopyInItem(_data.id, 1); GameCenter.duplicateMng.C2S_ToCopyItem(_data.id, _type); } } } else//可购买次数小于0跳转到充值界面 { MessageST msg = new MessageST(); msg.messID = 500; msg.delYes = delegate { GameCenter.uIMng.ReleaseGUI(GUIType.SWEEPCARBON); GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(msg); } }
void Init() { if (data == null) { return; } int curCopyRefID = InCopy(); UIToggle tog = null; tog = copyChilds[curCopyRefID].GetComponent <UIToggle>(); //if(tog != null)tog.startsActive = true;注释掉解决选中难度的BUG CopyRef copy = ConfigMng.Instance.GetCopyRef(data.copy[curCopyRefID]); if (fight != null && copy != null) { fight.text = copy.fighting.ToString(); } if (GameCenter.duplicateMng.CopyType == DuplicateMng.CopysType.ONESCOPY) { if (btnOK != null) { UIEventListener.Get(btnOK).onClick = delegate { for (int i = 0, len = copyChilds.Length; i < len; i++) { tog = copyChilds[i].GetComponent <UIToggle>(); if (copyChilds[i] != null && tog != null && tog.value) { CopyInItemDataInfo serData = null; // Debug.logger.Log("data.id = " + data.id + " , " + GameCenter.endLessTrialsMng.CopyDic.Count); if (GameCenter.duplicateMng.CopyDic.TryGetValue(data.id, out serData)) { if (serData.num > 0) { GameCenter.duplicateMng.C2S_ToCopyItem(data.id, copyChilds[i].CopyRefID); } else { GameCenter.duplicateMng.PopTip(serData, data, copyChilds[i].CopyRefID, false, false); } return; } else { Debug.LogError("升级后没有服务端数据过来,找小唔知!"); } } } } } ; } if (btnSweep != null) { UIEventListener.Get(btnSweep).onClick = OnClickSweep; } if (btnInNumUI != null) { UIEventListener.Get(btnInNum).onClick = delegate { CopyInNumBuyUI numbuy = btnInNumUI.GetComponent <CopyInNumBuyUI>(); if (numbuy != null) { numbuy.SetToBuyShow(data); } if (!diamoInNum.text.Equals("0")) { btnInNumUI.SetActive(true); } else { GameCenter.messageMng.AddClientMsg(242); } } } ; bool isAtk = data.id == GameCenter.duplicateMng.copyGroupID; if (GameCenter.duplicateMng.CopyType == DuplicateMng.CopysType.TWOSCOPY) { if (btnToTeam != null) { UIEventListener.Get(btnToTeam).onClick = delegate { if (!GameCenter.teamMng.isInTeam) { for (int i = 0, len = copyChilds.Length; i < len; i++) { if (copyChilds[i] == null) { continue; } tog = copyChilds[i].GetComponent <UIToggle>(); if (tog != null && tog.value) { GameCenter.duplicateMng.C2S_ReqCopyInTeamData(data.id, copyChilds[i].CopyRefID); return; } } } else { if (GameCenter.teamMng.isLeader) { for (int i = 0, len = copyChilds.Length; i < len; i++) { if (copyChilds[i] == null) { continue; } tog = copyChilds[i].GetComponent <UIToggle>(); if (tog != null && tog.value) { GameCenter.duplicateMng.C2S_ReqCopyInTeamData(data.id, copyChilds[i].CopyRefID); return; } } } else { //新加个判断解决多人组队进入一次后,队员可以开启多人副本开启界面 //(一旦多人副本组队挑战次数大于一次,此判断失效,正确做法应清空GameCenter.endLessTrialsMng.copyGroupID这个数据) if (GameCenter.duplicateMng.CopyTeams.Count > 0 && isAtk && twoCoppyNum > 0) { GameCenter.uIMng.SwitchToUI(GUIType.COPYMULTIPLEWND, GUIType.COPYINWND); return; } GameCenter.messageMng.AddClientMsg(165); } } } } ; } if (GameCenter.duplicateMng.copyGroupID > 0 && isAtk) { tog = gameObject.GetComponent <UIToggle>(); if (tog != null) { tog.startsActive = true; } if (!GameCenter.teamMng.isInTeam) { GameCenter.duplicateMng.copyGroupID = 0; } } else { tog = gameObject.GetComponent <UIToggle>(); if (tog != null) { tog.startsActive = false; } } } void OnDisable() { UIToggle tog = null; GameCenter.duplicateMng.OnCopyItemChange -= ShowCopyItem; for (int i = 0, len = copyChilds.Length; i < len; i++) { if (copyChilds[i] == null) { continue; } tog = copyChilds[i].GetComponent <UIToggle>(); if (tog != null) { EventDelegate.Remove(tog.onChange, OnCopyChilds); } } ConfigMng.Instance.RemoveBigUIIcon(data.icon); twoCoppyNum = 0; } /// <summary> /// 点击扫荡副本 /// </summary> void OnClickSweep(GameObject go) { if (GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel < 51 && GameCenter.vipMng.VipData != null && GameCenter.vipMng.VipData.vLev < 2) { GameCenter.messageMng.AddClientMsg(396);//1转45以上或VIP2以上 return; } for (int i = 0, len = copyChilds.Length; i < len; i++) { CopyInItemChildUI copyInItemChildUI = copyChilds[i]; if (copyInItemChildUI != null && copyInItemChildUI.TogValue) { CopyInItemDataInfo CopyInItemDataInfo = null; if (GameCenter.duplicateMng.CopyDic.TryGetValue(data.id, out CopyInItemDataInfo)) { // GameCenter.endLessTrialsMng.CopyDic[data.id]; if (CopyInItemDataInfo != null) { int curStar = CopyInItemDataInfo.copyScenes.ContainsKey(copyInItemChildUI.CopyRefID) ? CopyInItemDataInfo.copyScenes[copyInItemChildUI.CopyRefID].star : 0; //if (curStar >= 3)//改为只需通关即可无需3星 if (curStar > 0) { GameCenter.duplicateMng.lcopyGroupRef = data; if (CopyInItemDataInfo.num <= 0) { //GameCenter.messageMng.AddClientMsg(244); GameCenter.duplicateMng.PopTip(CopyInItemDataInfo, data, copyInItemChildUI.CopyRefID, true, true); } else { if (GameCenter.duplicateMng.isShowBuySweepItem) { if (GameCenter.inventoryMng.GetNumberByType(2210001) > 0)//新增扫荡卷轴消耗 { GameCenter.endLessTrialsMng.C2S_SweepReward(1, copyInItemChildUI.CopyRefID); } else { EquipmentInfo eqinfo = new EquipmentInfo(2210001, EquipmentBelongTo.PREVIEW); MessageST mst = new MessageST(); object[] pa = { 1 }; mst.pars = pa; mst.delPars = delegate(object[] ob) { if (ob.Length > 0) { bool b = (bool)ob[0]; if (b) { GameCenter.duplicateMng.isShowBuySweepItem = false; } } }; mst.messID = 543; mst.words = new string[1] { eqinfo.DiamondPrice.ToString() }; mst.delYes = delegate { if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount >= eqinfo.DiamondPrice) { //GameCenter.inventoryMng.C2S_AskBlessWeapon(2210001);//暂用祝福油的快捷购买协议 GameCenter.endLessTrialsMng.C2S_SweepReward(1, copyInItemChildUI.CopyRefID);//点击确定进入扫荡后台判断是否购买 } else { MessageST mst1 = new MessageST(); mst1.messID = 137; mst1.delYes = delegate { GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE); }; GameCenter.messageMng.AddClientMsg(mst1); } }; GameCenter.messageMng.AddClientMsg(mst); } } else { GameCenter.endLessTrialsMng.C2S_SweepReward(1, copyInItemChildUI.CopyRefID); } } } else { GameCenter.messageMng.AddClientMsg(127);//243提示改为127 } } } else { Debug.LogError("升级后没有服务端数据过来,找小唔知!"); } } } } }
void ShowCopyItem() { // if(icon != null)icon.spriteName = data.icon; if (oneShow != null) { oneShow.SetActive(GameCenter.duplicateMng.CopyType == DuplicateMng.CopysType.ONESCOPY); } if (btnSweep != null) { btnSweep.SetActive(GameCenter.duplicateMng.CopyType == DuplicateMng.CopysType.ONESCOPY); } if (juanZhouNum != null) { juanZhouNum.gameObject.SetActive(GameCenter.duplicateMng.CopyType == DuplicateMng.CopysType.ONESCOPY); juanZhouNum.text = GameHelper.GetStringWithBagNumber(2210001, 1); } CopyInItemDataInfo serData = null; if (GameCenter.duplicateMng.CopyDic.TryGetValue(data.id, out serData)) { twoCoppyNum = serData.num; if (inNum != null) { inNum.text = serData.num > 0 ? serData.num.ToString() : "0"; } if (diamoInNum != null) { diamoInNum.text = serData.buyNum > 0 ? serData.buyNum.ToString() : "0"; } if (redShow != null) { redShow.SetActive(serData.num > 0); } } for (int i = 0, len = copyChilds.Length; i < len; i++) { if (copyChilds[i] == null) { continue; } if (i < data.copy.Count) { copyChilds[i].CopyRefID = data.copy[i]; copyChilds[i].SetStar(data.id); copyChilds[i].gameObject.SetActive(true); } else { copyChilds[i].gameObject.SetActive(false); } } ConfigMng.Instance.GetBigUIIcon(data.icon, delegate(Texture2D texture){ if (textIcon != null) { textIcon.mainTexture = texture; } }); if (name != null) { name.text = data.name; } if (btnInNumUI != null) { btnInNumUI.SetActive(false); } }