Merge branch 'Cross_Server' of http://192.168.0.87:10010/r/snxxz_scripts into Cross_Server
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1109b04e0f250904a9020695cca25f1a |
| | | folderAsset: yes |
| | | timeCreated: 1545138309 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C1 01 跨服PK匹配 #tagCMCrossRealmPKMatch
|
| | |
|
| | | public class CC101_tagCMCrossRealmPKMatch : GameNetPackBasic {
|
| | | public byte Type; // 0-取消匹配; 1-进行匹配
|
| | |
|
| | | public CC101_tagCMCrossRealmPKMatch () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xC101;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Type, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: adf341f85cbb10f4fb2c235a6bc219ba |
| | | timeCreated: 1545138310 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 43380ef26adccfd40bc08a67232f823a |
| | | folderAsset: yes |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 01 跨服PK匹配成功 #tagGCCrossRealmPKMatchOK
|
| | |
|
| | | public class DTCC001_tagGCCrossRealmPKMatchOK : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HC001_tagGCCrossRealmPKMatchOK vNetData = vNetPack as HC001_tagGCCrossRealmPKMatchOK;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 752090289261d394aa797221e7b5310c |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 02 跨服PK开始匹配 #tagGCCrossRealmPKStartMatch
|
| | |
|
| | | public class DTCC002_tagGCCrossRealmPKStartMatch : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HC002_tagGCCrossRealmPKStartMatch vNetData = vNetPack as HC002_tagGCCrossRealmPKStartMatch;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f3be43d7c9cbc884184104ba61994b96 |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 03 跨服PK战斗结果 #tagGCCrossRealmPKOverInfo
|
| | |
|
| | | public class DTCC003_tagGCCrossRealmPKOverInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HC003_tagGCCrossRealmPKOverInfo vNetData = vNetPack as HC003_tagGCCrossRealmPKOverInfo;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa4846495bc78044fbd0596b31cd0c6e |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0ec3df8c4f3cda24cb3e7becacfd5fbd |
| | | folderAsset: yes |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 01 跨服PK匹配成功 #tagGCCrossRealmPKMatchOK
|
| | |
|
| | | public class HC001_tagGCCrossRealmPKMatchOK : GameNetPackBasic {
|
| | | public byte NameLen;
|
| | | public string PlayerName; // 跨服名字
|
| | | public byte TagNameLen;
|
| | | public string TagPlayerName; // 对手名字
|
| | | public byte TagJob; // 对手职业
|
| | |
|
| | | public HC001_tagGCCrossRealmPKMatchOK () {
|
| | | _cmd = (ushort)0xC001;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PlayerName, vBytes, NetDataType.Chars, NameLen);
|
| | | TransBytes (out TagNameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TagPlayerName, vBytes, NetDataType.Chars, NameLen);
|
| | | TransBytes (out TagJob, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8fd92a094d295bf49be6dcff400e5ab6 |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 02 跨服PK开始匹配 #tagGCCrossRealmPKStartMatch
|
| | |
|
| | | public class HC002_tagGCCrossRealmPKStartMatch : GameNetPackBasic {
|
| | |
|
| | | public HC002_tagGCCrossRealmPKStartMatch () {
|
| | | _cmd = (ushort)0xC002;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f97b2793d2bf5ec4ba6591b26d2ccf99 |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 03 跨服PK战斗结果 #tagGCCrossRealmPKOverInfo
|
| | |
|
| | | public class HC003_tagGCCrossRealmPKOverInfo : GameNetPackBasic {
|
| | | public string TimeStr; // 结算时间,格式 yyyy-MM-dd HH:mm:ss
|
| | | public byte OverType; // 0-正常,1-有人离线
|
| | | public uint WinnerID; // 胜方ID
|
| | | public byte RoundCount; // PK回合数
|
| | | public uint[] RoundWinnerID; // 回合获胜ID列表
|
| | | public ushort AddScore; // 本场加分
|
| | | public ushort Score; // 当前积分
|
| | | public byte DanLV; // 当前段位
|
| | | public ushort CWinCnt; // 当前连胜数
|
| | | public byte TagNameLen;
|
| | | public string TagName;
|
| | |
|
| | | public HC003_tagGCCrossRealmPKOverInfo () {
|
| | | _cmd = (ushort)0xC003;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out TimeStr, vBytes, NetDataType.Chars, 19);
|
| | | TransBytes (out OverType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out WinnerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RoundCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out RoundWinnerID, vBytes, NetDataType.DWORD, RoundCount);
|
| | | TransBytes (out AddScore, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Score, vBytes, NetDataType.WORD);
|
| | | TransBytes (out DanLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out CWinCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out TagNameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TagName, vBytes, NetDataType.Chars, TagNameLen);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7268e99f274c281439c2ab0a76401f65 |
| | | timeCreated: 1545138278 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] Text reaminNumText;
|
| | | [SerializeField] Text seasonTimeText;
|
| | | [SerializeField] Text openTimeText;
|
| | | [SerializeField] Button buyTimesBtn;
|
| | |
|
| | | CrossServerRewardModel m_CrossServerRewardModel;
|
| | | CrossServerRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerRewardModel>()); } }
|
| | | CrossServerModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerModel>(); } }
|
| | |
| | | {
|
| | | dayAwardBtn.AddListener(ClickDayAward);
|
| | | matchBtn.AddListener(ClickMatch);
|
| | | buyTimesBtn.AddListener(ClickBuyTimes);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | |
|
| | | SetDisplay();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | |
|
| | | private void UpdateMatchInfo()
|
| | | {
|
| | | reaminNumText.text = StringUtility.Contact(crossServerModel.dayMatchNum,"/",crossServerModel.dayMaxMatchNum);
|
| | | int remainNum = crossServerModel.alreadyBuyNum + crossServerModel.freeMaxMatchNum - crossServerModel.dayMatchNum;
|
| | | if (remainNum > 0)
|
| | | {
|
| | | reaminNumText.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Green,remainNum.ToString()), "/", crossServerModel.freeMaxMatchNum);
|
| | | }
|
| | | else
|
| | | {
|
| | | reaminNumText.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Red, remainNum.ToString()), "/", crossServerModel.freeMaxMatchNum);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdatePKInfo()
|
| | |
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void ClickBuyTimes()
|
| | | {
|
| | | int remainNum = crossServerModel.alreadyBuyNum + crossServerModel.freeMaxMatchNum - crossServerModel.dayMatchNum;
|
| | | if (remainNum >= crossServerModel.freeMaxMatchNum) return;
|
| | |
|
| | | WindowCenter.Instance.Open<CrossSeverBuyMatchTimesWin>();
|
| | | }
|
| | |
|
| | | private void ClickDayAward()
|
| | | {
|
| | | WindowCenter.Instance.Open<CrossServerDayAwardsWin>();
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, April 09, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class CrossServerCyclicScroll : CyclicScroll
|
| | | {
|
| | | const float fadeOutTime = 0.3f;
|
| | | const float relocationTime = 0.4f;
|
| | |
|
| | | CrossSeverDayAwardCell showAchievementBehaviour;
|
| | |
|
| | | bool m_Showing = false;
|
| | | public bool showing
|
| | | {
|
| | | get { return m_Showing; }
|
| | | private set { m_Showing = value; }
|
| | | }
|
| | |
|
| | | List<CrossServerModel.AwardType> dayAwards;
|
| | |
|
| | | CrossServerModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerModel>(); } }
|
| | |
|
| | | public void ShowTreasures(bool _stepByStep)
|
| | | {
|
| | | crossServerModel.SortDayAwardsList();
|
| | | dayAwards = crossServerModel.sortDayAwardslist;
|
| | | Init(dayAwards, _stepByStep);
|
| | | }
|
| | |
|
| | | public override void Init<T>(List<T> _datas, bool _stepByStep = false)
|
| | | {
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var item = infiniteItems[i] as CrossSeverDayAwardCell;
|
| | | item.alphaTween.SetStartState();
|
| | | item.linerMove.Stop();
|
| | | }
|
| | |
|
| | | showing = false;
|
| | | base.Init(_datas, _stepByStep);
|
| | |
|
| | | showing = true;
|
| | | this.enabled = false;
|
| | | Clock.Create(DateTime.Now + new TimeSpan((long)(0.5f * TimeSpan.TicksPerSecond)), OnUnfoldShowEnd);
|
| | | }
|
| | |
|
| | | private void OnUnfoldShowEnd()
|
| | | {
|
| | | showing = false;
|
| | | this.enabled = true;
|
| | | }
|
| | |
|
| | | public void ShowBegin(CrossSeverDayAwardCell _showItem)
|
| | | {
|
| | | this.enabled = false;
|
| | | showing = true;
|
| | | showAchievementBehaviour = _showItem;
|
| | | showAchievementBehaviour.alphaTween.from = 1f;
|
| | | showAchievementBehaviour.alphaTween.to = 0f;
|
| | | showAchievementBehaviour.alphaTween.duration = fadeOutTime;
|
| | | showAchievementBehaviour.alphaTween.SetStartState();
|
| | | showAchievementBehaviour.alphaTween.Play();
|
| | | var endTime = DateTime.Now + new TimeSpan((long)(fadeOutTime * TimeSpan.TicksPerSecond));
|
| | | Clock.Create(endTime, ReLocateItems);
|
| | | }
|
| | |
|
| | | void ReLocateItems()
|
| | | {
|
| | | showAchievementBehaviour.alphaTween.SetStartState();
|
| | | crossServerModel.SortDayAwardsList();
|
| | | dayAwards = crossServerModel.sortDayAwardslist;
|
| | | ReLocateAllItems(showAchievementBehaviour);
|
| | |
|
| | | var endTime = DateTime.Now + new TimeSpan((long)(relocationTime * TimeSpan.TicksPerSecond));
|
| | | Clock.Create(endTime, ShowEnd);
|
| | | }
|
| | |
|
| | | void ShowEnd()
|
| | | {
|
| | | this.enabled = true;
|
| | | showing = false;
|
| | | }
|
| | |
|
| | | private void ReLocateAllItems(ScrollItem _scrollItem)
|
| | | {
|
| | | var index = infiniteItems.IndexOf(_scrollItem);
|
| | | if (index != -1)
|
| | | {
|
| | | var showBehaviour = _scrollItem as CrossSeverDayAwardCell;
|
| | | var lastItem = infiniteItems[infiniteItems.Count - 1];
|
| | |
|
| | | showBehaviour.rectTransform.anchoredPosition = lastItem.rectTransform.anchoredPosition.SetY(lastItem.rectTransform.anchoredPosition.y - cellSize.y - spacing.y);
|
| | | showBehaviour.gameObject.SetActive(false);
|
| | | infiniteItems.Remove(_scrollItem);
|
| | | infiniteItems.Add(_scrollItem);
|
| | |
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var item = infiniteItems[i] as CrossSeverDayAwardCell;
|
| | | if (item != null && preIndex + i < datas.Count)
|
| | | {
|
| | | item.Display(datas[preIndex + i]);
|
| | | }
|
| | | }
|
| | |
|
| | | for (int i = index; i < infiniteItems.Count; i++)
|
| | | {
|
| | | var item = infiniteItems[i];
|
| | | var achievementBehaviour = item as CrossSeverDayAwardCell;
|
| | |
|
| | | achievementBehaviour.linerMove.from = achievementBehaviour.rectTransform.anchoredPosition;
|
| | | var toY = achievementBehaviour.rectTransform.anchoredPosition.y + cellSize.y + spacing.y;
|
| | | achievementBehaviour.linerMove.to = achievementBehaviour.rectTransform.anchoredPosition.SetY(toY);
|
| | | achievementBehaviour.linerMove.duration = relocationTime;
|
| | | if (achievementBehaviour.linerMove.gameObject.activeInHierarchy)
|
| | | {
|
| | | achievementBehaviour.linerMove.Begin();
|
| | | }
|
| | | else
|
| | | {
|
| | | achievementBehaviour.linerMove.Stop();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void ResetScrollItemName()
|
| | | {
|
| | | for (int i = 0; i < infiniteItems.Count; i++)
|
| | | {
|
| | | infiniteItems[i].name = string.Format("Achievement_{0}", i);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 61dd94121a232de4090a5c982ff406f7 |
| | | timeCreated: 1545112974 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [XLua.Hotfix]
|
| | | public class CrossServerDayAwardsWin : Window
|
| | | {
|
| | | [SerializeField] ScrollerController achieveCtrl;
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] CrossServerCyclicScroll m_AchievementScroll;
|
| | |
|
| | | CrossServerModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerModel>(); } }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | | achieveCtrl.lockType = EnhanceLockType.KeepVertical;
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | this.transform.SetAsLastSibling();
|
| | | achieveCtrl.JumpIndex(0);
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | |
|
| | | private void CreateCell()
|
| | | {
|
| | | achieveCtrl.Refresh();
|
| | | var dayAwards = crossServerModel.dayAwardTypelist;
|
| | | for(int i = 0; i < dayAwards.Count; i++)
|
| | | {
|
| | | achieveCtrl.AddCell(ScrollerDataType.Header,i);
|
| | | }
|
| | | achieveCtrl.Restart();
|
| | | crossServerModel.SortDayAwardsList();
|
| | | var dayAwards = crossServerModel.sortDayAwardslist;
|
| | | m_AchievementScroll.ShowTreasures(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | |
|
| | | ResetData();
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | | return upScore == 0;
|
| | | }
|
| | |
|
| | | public int GetBuyMatchNumPrice()
|
| | | {
|
| | | Equation.Instance.Clear();
|
| | | Equation.Instance.AddKeyValue("buyCnt",alreadyBuyNum);
|
| | | return Equation.Instance.Eval<int>(priceFormula);
|
| | | }
|
| | |
|
| | | public List<AwardType> sortDayAwardslist = new List<AwardType>();
|
| | | public void SortDayAwardsList()
|
| | | {
|
| | | sortDayAwardslist.Clear();
|
| | | sortDayAwardslist.AddRange(dayAwardTypelist);
|
| | | sortDayAwardslist.Sort(CompareByCompleteProgress);
|
| | | }
|
| | |
|
| | | public int CompareByCompleteProgress(AwardType start,AwardType end)
|
| | | {
|
| | | int x = (int)start.progress;
|
| | | int y = (int)end.progress;
|
| | | if (x.CompareTo(y) != 0) return x.CompareTo(y);
|
| | |
|
| | | x = dayAwardTypelist.IndexOf(start);
|
| | | y = dayAwardTypelist.IndexOf(end);
|
| | | if (x.CompareTo(y) != 0) return x.CompareTo(y);
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | #region 表数据
|
| | | public int dayMaxMatchNum { get; private set; } //匹配次数上限
|
| | | public int freeMaxMatchNum { get; private set; } //每日免费匹配次数
|
| | | public int buyMaxMatchNum { get; private set; } //每日可购买次数
|
| | | public string priceFormula { get;private set;} //购买匹配次数需要价格公式
|
| | | public List<AwardType> dayAwardTypelist { get; private set; }
|
| | | private void ParseFuncConfig()
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var CrossRealmPKMatchCount = Config.Instance.Get<FuncConfigConfig>("CrossRealmPKMatchCount");
|
| | | freeMaxMatchNum = int.Parse(CrossRealmPKMatchCount.Numerical1);
|
| | | buyMaxMatchNum = int.Parse(CrossRealmPKMatchCount.Numerical2);
|
| | | priceFormula = CrossRealmPKMatchCount.Numerical3;
|
| | | }
|
| | |
|
| | | public class AwardType
|
| | | {
|
| | | public int type; //1 胜利奖励 2 匹配奖励 |
| | | public int type { get; private set; } //1 胜利奖励 2 匹配奖励 |
| | | public int num { get; private set;}
|
| | | public int curCompletedNum { get; private set; }
|
| | | public CompleteProgress progress { get; private set;}
|
| | | public bool IsReceived { get; set; }
|
| | | public List<AwardItem> awardItems = new List<AwardItem>();
|
| | | public AwardType(int _num,int _type)
|
| | | {
|
| | | type = _type;
|
| | | num = _num;
|
| | | curCompletedNum = 0;
|
| | | IsReceived = false;
|
| | | progress = CompleteProgress.Completed;
|
| | | awardItems.Clear();
|
| | | }
|
| | |
|
| | | public void SetAwardItems(AwardItem awardItem)
|
| | | {
|
| | | awardItems.Add(awardItem);
|
| | | }
|
| | |
|
| | | public void SetCompletedNum(int completedNum)
|
| | | {
|
| | | curCompletedNum = completedNum;
|
| | | if(IsReceived)
|
| | | {
|
| | | curCompletedNum = num;
|
| | | progress = CompleteProgress.AlreadyReceived;
|
| | | }
|
| | | else
|
| | | {
|
| | | progress = curCompletedNum < num ? CompleteProgress.UnCompleted : CompleteProgress.Completed;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum CompleteProgress
|
| | | {
|
| | | Completed = 0, //已达成
|
| | | UnCompleted = 1, //未达成
|
| | | AlreadyReceived = 2, //已领取
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public int curWinRate { get; private set; } //当前胜率
|
| | | public int sumBattleNum { get; private set; } //对战总场数
|
| | | public int dayMatchNum { get; private set; } //今日匹配次数
|
| | | public int alreadyBuyNum { get; private set;} //今日购买匹配次数
|
| | | #endregion
|
| | |
|
| | | private void ResetData()
|
| | | {
|
| | | curRank = 0;
|
| | | curScore = 0;
|
| | | curWinRate = 0;
|
| | | sumBattleNum = 0;
|
| | | dayMatchNum = 0;
|
| | | alreadyBuyNum = 0;
|
| | | }
|
| | |
|
| | | #region 红点
|
| | | #endregion
|
| | |
|
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class CrossSeverBuyMatchTimesWin : Window
|
| | | {
|
| | | [SerializeField] Text m_TodayBuyTimes;
|
| | | [SerializeField] Text m_CostRemind;
|
| | | [SerializeField] Button m_BuyTimes;
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] RectTransform m_ContainerBuylimit;
|
| | |
|
| | | CrossServerModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerModel>(); } }
|
| | | ulong price = 0;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.AddListener(CloseClick);
|
| | | m_BuyTimes.AddListener(ClickBuyTimes);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | SetDisplay();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | |
| | | }
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void SetDisplay()
|
| | | {
|
| | | int remainBuyTimes = crossServerModel.buyMaxMatchNum - crossServerModel.alreadyBuyNum;
|
| | | price = (ulong)crossServerModel.GetBuyMatchNumPrice();
|
| | | m_CostRemind.text = Language.Get("TimesBuyLanguage3",price);
|
| | | m_ContainerBuylimit.gameObject.SetActive(remainBuyTimes <= 0);
|
| | | m_BuyTimes.gameObject.SetActive(remainBuyTimes > 0);
|
| | | if(remainBuyTimes > 0)
|
| | | {
|
| | | m_TodayBuyTimes.text = Language.Get("TimesBuyLanguage1",UIHelper.AppendStringColor(TextColType.Green,remainBuyTimes.ToString()), crossServerModel.buyMaxMatchNum);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TodayBuyTimes.text = Language.Get("TimesBuyLanguage1", UIHelper.AppendStringColor(TextColType.Red, remainBuyTimes.ToString()), crossServerModel.buyMaxMatchNum);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickBuyTimes()
|
| | | {
|
| | | ulong gold = UIHelper.GetMoneyCnt(1);
|
| | | ulong bindGold = UIHelper.GetMoneyCnt(2);
|
| | | ulong sumGold = gold + bindGold;
|
| | | if (sumGold >= price)
|
| | | {
|
| | | if (bindGold < price)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyLand_Func13",
|
| | | PlayerDatas.Instance.baseData.GoldPaper, price, price - bindGold), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | |
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | |
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: eab850ccd46bd2544a20be4ccbf1c7ad |
| | | timeCreated: 1545123082 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using EnhancedUI.EnhancedScroller;
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using DG.Tweening;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class CrossSeverDayAwardCell : ScrollerUI
|
| | | public class CrossSeverDayAwardCell : ScrollItem
|
| | | {
|
| | | [SerializeField] Text taskNameText;
|
| | | [SerializeField] Slider progressSlider;
|
| | |
| | | [SerializeField] Button recieveBtn;
|
| | | [SerializeField] Image stateImg;
|
| | | [SerializeField] List<CommonItemBaisc> itemBaiscs = new List<CommonItemBaisc>();
|
| | | [SerializeField] CrossServerCyclicScroll m_CrossServerCyclicScroll;
|
| | |
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | | public UIAlphaTween alphaTween { get { return m_AlphaTween; } }
|
| | |
|
| | | [SerializeField] UILinerMove m_LinerMove;
|
| | | public UILinerMove linerMove { get { return m_LinerMove; } }
|
| | |
|
| | | CrossServerModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | CrossServerModel.AwardType awardType;
|
| | | private void Awake()
|
| | | float height = 0;
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | | recieveBtn.AddListener(ClickRecieve);
|
| | | awardType = (CrossServerModel.AwardType)_data;
|
| | | DisplayDayAward();
|
| | | }
|
| | |
|
| | | public override void Refresh(CellView cell)
|
| | | public override void Dispose()
|
| | | {
|
| | | awardType = null;
|
| | | if (cell.index >= crossServerModel.dayAwardTypelist.Count) return;
|
| | | base.Dispose();
|
| | | recieveBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | awardType = crossServerModel.dayAwardTypelist[cell.index];
|
| | | private void DisplayDayAward()
|
| | | {
|
| | | var awardItems = awardType.awardItems;
|
| | | for(int i = 0; i < itemBaiscs.Count; i++)
|
| | | stateImg.gameObject.SetActive(awardType.progress != CrossServerModel.AwardType.CompleteProgress.Completed);
|
| | | recieveBtn.gameObject.SetActive(awardType.progress == CrossServerModel.AwardType.CompleteProgress.Completed);
|
| | | progressSlider.minValue = 0;
|
| | | progressSlider.maxValue = awardType.num;
|
| | | progressSlider.value = awardType.curCompletedNum;
|
| | | progressText.text = StringUtility.Contact(awardType.curCompletedNum, "/", awardType.num);
|
| | | for (int i = 0; i < itemBaiscs.Count; i++)
|
| | | {
|
| | | var itemBasic = itemBaiscs[i];
|
| | | itemBasic.gameObject.SetActive(i < awardItems.Count);
|
| | | if(i < awardItems.Count)
|
| | | if (i < awardItems.Count)
|
| | | {
|
| | | var awardItem = awardItems[i];
|
| | | ItemCellModel cellModel = new ItemCellModel(awardItem.itemId,true,(ulong)awardItem.itemCount,awardItem.isBind);
|
| | | ItemCellModel cellModel = new ItemCellModel(awardItem.itemId, true, (ulong)awardItem.itemCount, awardItem.isBind);
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(()=>
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(awardItem.itemId,true,(ulong)awardItem.itemCount,-1,awardItem.isBind);
|
| | | ItemAttrData attrData = new ItemAttrData(awardItem.itemId, true, (ulong)awardItem.itemCount, -1, awardItem.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | }
|
| | |
| | | private void ClickRecieve()
|
| | | {
|
| | | if (awardType == null) return;
|
| | | }
|
| | |
|
| | | m_CrossServerCyclicScroll.ShowBegin(this);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | GameNetSystem.Instance.SendInfo(gmCmd); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送CrossServer GM |
| | | /// </summary> |
| | | /// <param name="sendQuest"></param> |
| | | public void SendCrossServerGMQuest(string sendQuest) |
| | | { |
| | | DebugEx.Log("sendQuest: " + sendQuest); |
| | | C320C_tagCGMCMD gmCmd = new C320C_tagCGMCMD(); |
| | | gmCmd.Cmd = sendQuest; |
| | | gmCmd.CmdLen = (byte)(sendQuest.Length); |
| | | GameNetSystem.Instance.SendToCrossServer(gmCmd); |
| | | } |
| | | |
| | | |
| | | public void GetCmdArray() |
| | | { |
| | | recordCmdArray = LocalSave.GeStringArray(Record_CmdKey); |
| | |
| | | private Button _sendBtn;
|
| | |
|
| | | [SerializeField]
|
| | | private Button m_CrossServerSend;
|
| | |
|
| | | [SerializeField]
|
| | | private Button _gmInfoBtn;
|
| | |
|
| | | [SerializeField]
|
| | |
| | | _gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
|
| | | _clearBtn.onClick.AddListener(OnClickClearBtn);
|
| | | achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
|
| | | m_CrossServerSend.SetListener(SendCrossServerGM);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | cmdModel.SetRecordCmdlist(_inputCmd.text);
|
| | | }
|
| | |
|
| | | private void SendCrossServerGM()
|
| | | {
|
| | | if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
|
| | | return;
|
| | |
|
| | | if (_inputCmd.text == "HappyXB")
|
| | | {
|
| | | WindowCenter.Instance.Open<HappyXBWin>();
|
| | | return;
|
| | | }
|
| | | else if (_inputCmd.text == "TreasureFindHost")
|
| | | {
|
| | | WindowCenter.Instance.Open<TreasureFindHostWin>();
|
| | | return;
|
| | | }
|
| | |
|
| | | cmdModel.SendCrossServerGMQuest(_inputCmd.text.Trim());
|
| | | cmdModel.SetRecordCmdlist(_inputCmd.text);
|
| | | }
|
| | |
|
| | |
|
| | | private void OnClickClearBtn()
|
| | | {
|