Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -25,6 +25,7 @@ public static void Init() { // 登记相应的数据体及对应的数据转逻辑类 Register(typeof(HA327_tagMCRealmExpInfo), typeof(DTCA327_tagMCRealmExpInfo)); Register(typeof(HA40C_tagGCAllFamilyBossInfo), typeof(DTCA40C_tagGCAllFamilyBossInfo)); Register(typeof(HA3B1_tagMCEquipPartStarInfo), typeof(DTCA3B1_tagMCEquipPartStarInfo)); Register(typeof(HA816_tagMCMysticalShopInfo), typeof(DTCA816_tagMCMysticalShopInfo)); Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA521_tagCMTakeOutRealmExp.cs
New file @@ -0,0 +1,16 @@ using UnityEngine; using System.Collections; // A5 21 境界修为池提取 #tagCMTakeOutRealmExp public class CA521_tagCMTakeOutRealmExp : GameNetPackBasic { public CA521_tagCMTakeOutRealmExp () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA521; } public override void WriteToBytes () { } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA521_tagCMTakeOutRealmExp.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 60efa2ae65f837242a25ff4bbb5b456b timeCreated: 1553064966 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA327_tagMCRealmExpInfo.cs
New file @@ -0,0 +1,24 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, March 20, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCA327_tagMCRealmExpInfo : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA327_tagMCRealmExpInfo; ModelCenter.Instance.GetModel<RealmModel>().ReceivePackage(package); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA327_tagMCRealmExpInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: bbfa3dbab2a4c2b4fae460fc3830c1a6 timeCreated: 1553065107 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA327_tagMCRealmExpInfo.cs
New file @@ -0,0 +1,21 @@ using UnityEngine; using System.Collections; // A3 27 境界修为池信息 #tagMCRealmExpInfo public class HA327_tagMCRealmExpInfo : GameNetPackBasic { public uint BeginTime; //开始计时时间 public uint CurExp; //当前总经验 public uint CurExpPoint; //当前总经验点 public HA327_tagMCRealmExpInfo () { _cmd = (ushort)0xA327; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out BeginTime, vBytes, NetDataType.DWORD); TransBytes (out CurExp, vBytes, NetDataType.DWORD); TransBytes (out CurExpPoint, vBytes, NetDataType.DWORD); } } Core/NetworkPackage/ServerPack/HA3_Function/HA327_tagMCRealmExpInfo.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: cd9074b87c2c7b540b6dfa2ff01c3b0e timeCreated: 1553065068 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Realm/RealmModel.cs
@@ -15,6 +15,30 @@ List<List<int>> m_RealmStages = new List<List<int>>(); public int realmMaxLevel { get; private set; } public bool isBossPass { get; private set; } public int realmExpTime { get; private set; } public long startExp { get; private set; } public long totalExp { get { var exp = startExp; var tick = (TimeUtility.ServerNow - expStartTime).Ticks; var singleTick = realmExpTime * TimeSpan.TicksPerSecond; var times = tick / singleTick; var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); if (config != null && config.expRate != 0) { exp = times * config.expRate + startExp; exp = exp > config.expLimit ? config.expLimit : exp; } return exp; } } public DateTime expStartTime { get; private set; } public const int REALM_DUNGEON_ID = 31110; @@ -57,6 +81,7 @@ } public event Action selectRealmRefresh; public event Action realmExpRefresh; EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } @@ -73,6 +98,8 @@ public void OnBeforePlayerDataInitialize() { isBossPass = false; expStartTime = DateTime.Now; startExp = 0; SysNotifyMgr.Instance.OnSystemNotifyEvent -= OnSystemNotifyEvent; } @@ -148,6 +175,9 @@ m_RealmPreviewEquips.Add(config.Lv, dict); } } var funcConfig = FuncConfigConfig.Get("RealmExpTime"); realmExpTime = int.Parse(funcConfig.Numerical1); } public bool TryGetRealmProperty(int level, out Dictionary<int, int> propertyDict) @@ -321,6 +351,16 @@ RefreshRedpoint(); } public void ReceivePackage(HA327_tagMCRealmExpInfo package) { expStartTime = TimeUtility.GetTime(package.BeginTime); startExp = (long)package.CurExpPoint * Constants.ExpPointValue + package.CurExp; if (realmExpRefresh != null) { realmExpRefresh(); } } private void OnStageLoadFinish() { if (!(StageLoad.Instance.currentStage is DungeonStage)) System/Realm/RealmPoolBehaviour.cs
@@ -1,4 +1,5 @@ using System.Collections; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -11,12 +12,72 @@ [SerializeField] ImageEx m_Word; [SerializeField] Transform m_Lock; [SerializeField] Text m_Progress; [SerializeField] Button m_TakeExp; int realmLevel = 0; RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } private void Awake() { m_TakeExp.AddListener(TakeExp); } public void Display(int realmLevel) { this.realmLevel = realmLevel; var config = RealmConfig.Get(realmLevel); var isOpen = config.expRate != 0; m_Bottom.gray = !isOpen; m_Word.gray = !isOpen; m_Lock.gameObject.SetActive(!isOpen); m_Progress.gameObject.SetActive(isOpen); if (isOpen) { DisplayProgress(); } model.realmExpRefresh -= RealmExpRefresh; model.realmExpRefresh += RealmExpRefresh; GlobalTimeEvent.Instance.secondEvent -= PerSecond; GlobalTimeEvent.Instance.secondEvent += PerSecond; } public void DisplayProgress() { var config = RealmConfig.Get(realmLevel); var progress = Mathf.Clamp01((float)model.totalExp / config.expLimit); var progressInt = (int)(progress * 100); m_Progress.text = StringUtility.Contact(progressInt, "%"); } private void TakeExp() { var config = RealmConfig.Get(realmLevel); var isOpen = config.expRate != 0; if (isOpen) { WindowCenter.Instance.Open<RealmTakeExpWin>(); } } private void PerSecond() { DisplayProgress(); } private void RealmExpRefresh() { DisplayProgress(); } public void Dispose() { model.realmExpRefresh -= RealmExpRefresh; GlobalTimeEvent.Instance.secondEvent -= PerSecond; } } } System/Realm/RealmTakeExpWin.cs
New file @@ -0,0 +1,94 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, March 20, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class RealmTakeExpWin : Window { [SerializeField] Text m_TotalExp; [SerializeField] Text m_ExpRate; [SerializeField] Button m_TakeExp; [SerializeField] Button m_Close; RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } #region Built-in protected override void BindController() { } protected override void AddListeners() { m_TakeExp.AddListener(TakeExp); m_Close.AddListener(CloseClick); } protected override void OnPreOpen() { Display(); GlobalTimeEvent.Instance.secondEvent += PerSecond; } protected override void OnAfterOpen() { } protected override void OnPreClose() { GlobalTimeEvent.Instance.secondEvent -= PerSecond; } protected override void OnAfterClose() { } #endregion void Display() { DisplayExp(); DisplayRate(); } void DisplayExp() { var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); var expLabel = UIHelper.ReplaceLargeNum(model.totalExp); var expLimitLabel = UIHelper.ReplaceLargeNum(config.expLimit); m_TotalExp.text = StringUtility.Contact(expLabel, "/", expLimitLabel); } void DisplayRate() { var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); m_ExpRate.text = Language.Get("RealmExpRate", model.realmExpTime, UIHelper.ReplaceLargeNum(config.expRate)); } private void PerSecond() { DisplayExp(); } private void TakeExp() { CA521_tagCMTakeOutRealmExp pak = new CA521_tagCMTakeOutRealmExp(); GameNetSystem.Instance.SendInfo(pak); } } } System/Realm/RealmTakeExpWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 37d48d8cfc34fd04995fc93fbfdaf43a timeCreated: 1553067471 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Realm/RealmWin.cs
@@ -17,6 +17,7 @@ [SerializeField] Transform m_ContainerRealmUp; [SerializeField] RealmBriefBehaviour m_RealmBrief; [SerializeField] RealmLevelUpBehaviour m_RealmLevelUp; [SerializeField] RealmPoolBehaviour m_RealmPool; [SerializeField] RealmAnimationBehaviour m_RealmAnimation; [SerializeField] RealmStageBehaviour[] m_RealmStages; [SerializeField] Transform m_ContainerUnlockEquip; @@ -171,6 +172,7 @@ DisplayRealmLevelUp(); DisplayRealmStages(); DisplayRealmBrief(); DisplayRealmPool(); DisplayUnlockEquip(); DisplayCover(); @@ -196,6 +198,7 @@ m_RealmBriefTween.SetEndState(); m_RealmLevelUpTween.Stop(); m_RealmLevelUpTween.SetEndState(); m_RealmPool.Dispose(); model.displayRealms.Clear(); foreach (var item in m_RealmStages) { @@ -251,6 +254,11 @@ void DisplayRealmBrief() { m_RealmBrief.Display(model.selectRealm); } void DisplayRealmPool() { m_RealmPool.Display(model.displayRealmLevel); } void DisplayUnlockEquip() @@ -402,6 +410,7 @@ model.displayRealms.Clear(); model.selectRealm = PlayerDatas.Instance.baseData.realmLevel + 1; DisplayRealmStages(); DisplayRealmPool(); DisplayCover(); DisplayEffectBoss(); } @@ -445,6 +454,8 @@ { TryStartAnimation(); } DisplayRealmPool(); } private void OnLevelUpComplete() @@ -473,6 +484,8 @@ } } DisplayRealmPool(); if (customUpPower > 0) { mainDateModel.CustomPowerUp((int)customUpPower);