Core/GameEngine/Model/Config/RealmConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: 2024年12月16日 // [ Date ]: 2024年12月30日 //-------------------------------------------------------- using System.Collections.Generic; @@ -16,6 +16,7 @@ public readonly int Lv; public readonly int LvLarge; public readonly string Name; public readonly string NameEx; public readonly int LVMax; public readonly int[] AddAttrType; public readonly int[] AddAttrNum; @@ -24,13 +25,11 @@ public readonly string Img; public readonly int Quality; public readonly int FightPower; public readonly string equipNameIcon; public readonly string equips; public readonly int effectId; public readonly int requireIconEffect; public readonly string recommandEquips; public readonly string LearnSkillIDInfo; public readonly Dictionary<int, int[]> LearnSkillIDInfo; public readonly int AddFreePoint; public readonly int EquipLV; public RealmConfig() { @@ -48,15 +47,17 @@ Name = tables[2]; int.TryParse(tables[3],out LVMax); NameEx = tables[3]; if (tables[4].Contains("[")) int.TryParse(tables[4],out LVMax); if (tables[5].Contains("[")) { AddAttrType = JsonMapper.ToObject<int[]>(tables[4]); AddAttrType = JsonMapper.ToObject<int[]>(tables[5]); } else { string[] AddAttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] AddAttrTypeStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); AddAttrType = new int[AddAttrTypeStringArray.Length]; for (int i=0;i<AddAttrTypeStringArray.Length;i++) { @@ -64,13 +65,13 @@ } } if (tables[5].Contains("[")) if (tables[6].Contains("[")) { AddAttrNum = JsonMapper.ToObject<int[]>(tables[5]); AddAttrNum = JsonMapper.ToObject<int[]>(tables[6]); } else { string[] AddAttrNumStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] AddAttrNumStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); AddAttrNum = new int[AddAttrNumStringArray.Length]; for (int i=0;i<AddAttrNumStringArray.Length;i++) { @@ -78,29 +79,25 @@ } } long.TryParse(tables[6],out expRate); long.TryParse(tables[7],out expRate); long.TryParse(tables[7],out expLimit); long.TryParse(tables[8],out expLimit); Img = tables[8]; Img = tables[9]; int.TryParse(tables[9],out Quality); int.TryParse(tables[10],out Quality); int.TryParse(tables[10],out FightPower); int.TryParse(tables[11],out FightPower); equipNameIcon = tables[11]; int.TryParse(tables[12],out effectId); equips = tables[12]; int.TryParse(tables[13],out requireIconEffect); int.TryParse(tables[13],out effectId); LearnSkillIDInfo = ConfigParse.ParseIntArrayDict(tables[14]); int.TryParse(tables[14],out requireIconEffect); int.TryParse(tables[15],out AddFreePoint); recommandEquips = tables[15]; LearnSkillIDInfo = tables[16]; int.TryParse(tables[17],out AddFreePoint); int.TryParse(tables[16],out EquipLV); } catch (Exception ex) { Core/GameEngine/Model/Config/RealmLVUPTaskConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: 2024年12月16日 // [ Date ]: 2024年12月30日 //-------------------------------------------------------- using System.Collections.Generic; @@ -13,11 +13,12 @@ public partial class RealmLVUPTaskConfig { public readonly int Lv; public readonly int ID; public readonly int Lv; public readonly int TaskID; public readonly int TaskType; public readonly int[] NeedValueList; public readonly string AwardItemList; public readonly int[][] AwardItemList; public RealmLVUPTaskConfig() { @@ -29,19 +30,21 @@ { var tables = input.Split('\t'); int.TryParse(tables[0],out Lv); int.TryParse(tables[0],out ID); int.TryParse(tables[1],out TaskID); int.TryParse(tables[1],out Lv); int.TryParse(tables[2],out TaskType); int.TryParse(tables[2],out TaskID); if (tables[3].Contains("[")) int.TryParse(tables[3],out TaskType); if (tables[4].Contains("[")) { NeedValueList = JsonMapper.ToObject<int[]>(tables[3]); NeedValueList = JsonMapper.ToObject<int[]>(tables[4]); } else { string[] NeedValueListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); string[] NeedValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); NeedValueList = new int[NeedValueListStringArray.Length]; for (int i=0;i<NeedValueListStringArray.Length;i++) { @@ -49,7 +52,7 @@ } } AwardItemList = tables[4]; AwardItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]")); } catch (Exception ex) { Core/GameEngine/Model/ConfigParse.cs
@@ -202,12 +202,50 @@ public static Dictionary<int, List<int>> ParseJsonDict(string jsonStr) { if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr)) { return new Dictionary<int, List<int>>(); } var dict = JsonMapper.ToObject<Dictionary<string, List<int>>>(jsonStr); Dictionary<int, List<int>> result = new Dictionary<int, List<int>>(); foreach (var key in dict.Keys) foreach (var item in dict) { result[int.Parse(key)] = dict[key]; result[int.Parse(item.Key)] = item.Value; } return result; } public static Dictionary<int, int> ParseIntDict(string jsonStr) { if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr)) { return new Dictionary<int, int>(); } var dict = JsonMapper.ToObject<Dictionary<string, int>>(jsonStr); Dictionary<int, int> result = new Dictionary<int, int>(); foreach (var item in dict) { result[int.Parse(item.Key)] = item.Value; } return result; } public static Dictionary<int, int[]> ParseIntArrayDict(string jsonStr) { if (jsonStr == "{}" || string.IsNullOrEmpty(jsonStr)) { return new Dictionary<int, int[]>(); } var dict = JsonMapper.ToObject<Dictionary<string, int[]>>(jsonStr); Dictionary<int, int[]> result = new Dictionary<int, int[]>(); foreach (var item in dict) { result[int.Parse(item.Key)] = item.Value; } return result; Core/GameEngine/Model/TelPartialConfig/RealmLVUPTaskConfig.cs
New file @@ -0,0 +1,40 @@ using System; using System.Collections.Generic; using System.Linq; public partial class RealmLVUPTaskConfig : IConfigPostProcess { //境界:任务ID:索引id private static Dictionary<int, Dictionary<int, int>> missionDict = new Dictionary<int, Dictionary<int, int>>(); public void OnConfigParseCompleted() { if (!missionDict.ContainsKey(Lv)) { missionDict.Add(Lv, new Dictionary<int, int>()); } missionDict[Lv][TaskID] = ID; } public static int GetID(int realmLV, int taskID) { if (missionDict.ContainsKey(realmLV) && missionDict[realmLV].ContainsKey(taskID)) { return missionDict[realmLV][taskID]; } return -1; } public static List<int> GetMissionIDs(int lv) { List<int> list = new List<int>(); if (missionDict.ContainsKey(lv)) { list = missionDict[lv].Keys.ToList(); list.Sort(); return list; } return list; } } Core/GameEngine/Model/TelPartialConfig/RealmLVUPTaskConfig.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 0097ad98e1e43954a8c060d2b6146a06 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/GameEngine/Model/TelPartialConfig/tagChinItemConfig.cs
@@ -1,10 +1,52 @@ using System.Collections.Generic; using System.Text; public partial class ItemConfig public partial class ItemConfig : IConfigPostProcess { private static Dictionary<int, ItemConfig> m_GemCfgs = new Dictionary<int, ItemConfig>(); //因为加载顺序的原因 这里写死需要缓存的装备类型数据 //筛选条件 装备位,阶级,颜色(品质),职业限制 //该逻辑表格还有个问题,比如展示用的物品莲台合并和GM装备 也会被搜索到,服务端是用是否掉落做区分的, 客户端暂时用ID大小屏蔽 static List<int> equipPlaceArr = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 }; //阶级+装备位:【物品ID】 static Dictionary<Int2, List<int>> itemIDsDict = new Dictionary<Int2, List<int>>(); public void OnConfigParseCompleted() { //暂只有筛选装备位1-8 if (ID < 1000000) return; if (equipPlaceArr.Contains(EquipPlace)) { Int2 key = new Int2(LV, EquipPlace); if (!itemIDsDict.ContainsKey(key)) { itemIDsDict[key] = new List<int>(); } itemIDsDict[key].Add(ID); } } //筛选条件 装备位,阶级,颜色(品质),职业限制 //获得装备物品表数据 public static ItemConfig GetEquipConfig(int lv, int place, int itemColor, int jobLimit) { List<int> itemIDs = null; if (itemIDsDict.TryGetValue(new Int2(lv, place), out itemIDs)) { for (int i = 0; i < itemIDs.Count; i++) { var config = Get(itemIDs[i]); if (config.ItemColor == itemColor && config.JobLimit == jobLimit) { return config; } } } return null; } public static void GemItemInit() { GemItemConfig.Init(true); Core/GameEngine/Model/TelPartialConfig/tagFuncConfigConfig.cs
@@ -21,14 +21,7 @@ private static List<FuncConfigConfig> fastReplay = new List<FuncConfigConfig>(); #endregion #region 装备名称 private static Dictionary<int, string> _equipAreaDict = new Dictionary<int, string>(); #endregion #region 装备弹框名称 private static Dictionary<int, string> _equipTipsAreaDict = new Dictionary<int, string>(); #endregion public void OnConfigParseCompleted() { @@ -61,31 +54,7 @@ } #endregion #region 得到装备位和对应名称 if (KEY == "EquipArea") { int[] arealist = ConfigParse.GetMultipleStr<int>(Numerical1); string[] namelist = ConfigParse.GetMultipleStr(Numerical2); for (int i = 0; i < arealist.Length; i++) { _equipAreaDict.Add(arealist[i], namelist[i]); } } #endregion #region 得到装备位和对应装备弹框名称 if (KEY== "EquipWinArea") { int[] arealist = ConfigParse.GetMultipleStr<int>(Numerical1); string[] namelist = ConfigParse.GetMultipleStr(Numerical2); for (int i = 0; i < arealist.Length; i++) { _equipTipsAreaDict.Add(arealist[i], namelist[i]); } } #endregion } #region 宝石数据 @@ -139,28 +108,5 @@ return fastReplay; } public static string GetEquipAreaName(int equipArea) { if (_equipAreaDict.ContainsKey(equipArea)) { return _equipAreaDict[equipArea]; } else { return ""; } } public static string GetEquipTipsAreaName(int equipArea) { if (_equipTipsAreaDict.ContainsKey(equipArea)) { return _equipTipsAreaDict[equipArea]; } else { return ""; } } } Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs
@@ -1,22 +1,31 @@ using UnityEngine; using System.Collections; using UnityEngine; using System.Collections; // A3 11 通知玩家境界信息 #tagMCSyncRealmInfo // A3 11 通知玩家境界信息 #tagMCSyncRealmInfo public class HA311_tagMCSyncRealmInfo : GameNetPackBasic { public uint TaskAwardState; //进阶任务领奖状态;按任务ID二进制位存储是否已领取 public byte TaskValueCount; public tagMCSyncRealmTask[] TaskValueList; //进阶任务值列表,仅有需要记录的任务才会通知 public class HA311_tagMCSyncRealmInfo : GameNetPackBasic { public byte IsPass; //是否通关副本 public uint XXZLAwardState; //修仙之路领奖状态;按二进制位存储每个任务ID是否已领取 public HA311_tagMCSyncRealmInfo() { public HA311_tagMCSyncRealmInfo () { _cmd = (ushort)0xA311; } public override void ReadFromBytes(byte[] vBytes) { TransBytes(out IsPass, vBytes, NetDataType.BYTE); TransBytes(out XXZLAwardState, vBytes, NetDataType.DWORD); public override void ReadFromBytes (byte[] vBytes) { TransBytes (out TaskAwardState, vBytes, NetDataType.DWORD); TransBytes (out TaskValueCount, vBytes, NetDataType.BYTE); TaskValueList = new tagMCSyncRealmTask[TaskValueCount]; for (int i = 0; i < TaskValueCount; i ++) { TaskValueList[i] = new tagMCSyncRealmTask(); TransBytes (out TaskValueList[i].TaskID, vBytes, NetDataType.BYTE); TransBytes (out TaskValueList[i].TaskValue, vBytes, NetDataType.DWORD); } } } public struct tagMCSyncRealmTask { public byte TaskID; public uint TaskValue; } } LogicProject/Protocol/ClientPack/ClientToMapServer/CA2_Interaction/IL_CA235_tagCMSelectRealmDifficulty.cs
@@ -4,7 +4,7 @@ // A2 35 选择境界难度层级 #tagCMSelectRealmDifficulty public class IL_CA235_tagCMSelectRealmDifficulty : GameNetPackBasic { public byte RealmDifficulty; //境界难度 = 100 + 所选境界等级,如境界13,则发113 public byte RealmDifficulty; //境界难度 = 1000 + 所选境界等级,如境界13,则发1013 public IL_CA235_tagCMSelectRealmDifficulty () { combineCmd = (ushort)0x03FE; LogicProject/System/MapLevelMode/MapLevelSelectWin.cs
@@ -155,7 +155,7 @@ } else { pack.RealmDifficulty = (byte)(100 + realm); pack.RealmDifficulty = (byte)(1000 + realm); } GameNetSystem.Instance.SendInfo(pack); System/Equip/EquipModel.cs
@@ -10,7 +10,7 @@ public class EquipModel : Model, IAfterPlayerDataInitialize, IPlayerLoginOk { public static readonly List<int> realmEquipTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; public static readonly int[] equipShowPlaces = new int[] { 1, 2, 4}; //展示外观的装备位 public int showedUnLockLevel { get { return LocalSave.GetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSetUnLockHasShowed"), 1); } set { LocalSave.SetInt(StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "EquipSetUnLockHasShowed"), value); } System/FindPrecious/FindPreciousModel.cs
@@ -269,6 +269,12 @@ { var myRealmLevel = PlayerDatas.Instance.baseData.realmLevel; var config = NPCConfig.Get(bossId); var realmConfig = RealmConfig.Get(config.Realm); if (realmConfig == null) { Debug.LogErrorFormat("需策划修改 NPCID:{0} RealmID:{1} 不存在", bossId, config.Realm); return false; } return myRealmLevel >= RealmConfig.Get(config.Realm).LvLarge; } System/MainInterfacePanel/FunctionForecastTip.cs
@@ -22,9 +22,6 @@ [SerializeField] Text _NameText;//标题名 [SerializeField] Text _Information;//信息内容 [SerializeField] Text m_Information_reward;//有奖励可领取 [SerializeField] ButtonEx xxzlBtn;//修仙之路按钮 [SerializeField] Text xxzlTxt;//修仙之路进度 [SerializeField] UIEffect xxzlEffect;//修仙之路特效 public static Action<int> FunctionOpenTagEvent; FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } } RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } @@ -69,24 +66,6 @@ List<FunctionForecastConfig> configs = new List<FunctionForecastConfig>(); void DataAssignment() { if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Realm) || realmModel.IsRealmXXZLOver()) { xxzlBtn.SetActive(false); } else { xxzlBtn.SetActive(true); xxzlBtn.AddListener(() => { WindowCenter.Instance.Open<RealmWin>(); }); xxzlTxt.text = realmModel.GetXXZLProcess() + "/" + RealmXXZLConfig.GetKeys().Count; if (realmModel.xxzlRedpoint.state == RedPointState.Simple) xxzlEffect.Play(); else xxzlEffect.Stop(); } if (FuncOpen.Instance.IsFuncOpen(OpenTag)) { _FunctionForecastPanel.SetActive(false); System/Realm/RealmBriefBehaviour.cs
@@ -9,164 +9,96 @@ { public class RealmBriefBehaviour : MonoBehaviour { [SerializeField] Image m_Icon; [SerializeField] PropertyBehaviour m_ClonePropertyBeha; [SerializeField] Transform m_PropertyRoot; [SerializeField] List<PropertyBehaviour> m_Properties; [SerializeField] Transform m_ContainerReiki; [SerializeField] Text m_ReikiPoint; [SerializeField] Text m_OnHookMaxTime; [SerializeField] Transform m_ContainerSkill; [SerializeField] Text m_SkillName; [SerializeField] Button m_ViewDetail; [SerializeField] Image m_SkillIcon; [SerializeField] Image nowRealmImg; [SerializeField] Image nextRealmImg; [SerializeField] Text nowLVLimitText; [SerializeField] Text nextLVLimitText; [SerializeField] List<Text> m_Properties; [SerializeField] List<Text> m_NextProperties; [SerializeField] Text unLockEffect; //境界解锁效果:技能,装备,灵根等 [SerializeField] Button unLockEffectBtn; [SerializeField] Button unLockEffectShowAllBtn; [SerializeField] List<RealmMissionCell> missionObjs; [SerializeField] Transform m_ContainerUnlockEquip; [SerializeField] Image m_UnlockEquip; [SerializeField] Button m_Preview; int realmLevel = 0; RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } OffLineOnHookModel onHookModel { get { return ModelCenter.Instance.GetModel<OffLineOnHookModel>(); } } private void Awake() { m_Preview.AddListener(OnEquipPreview); } public void Display(int realmLevel) public void Display() { this.realmLevel = realmLevel; CreatePropertyBehaviour(); DisplayBase(); DisplayProperty(); DisplayEquip(); DisplaySkill(); DisplayReiki(); } var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); var nextConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel + 1); nextConfig = nextConfig == null ? config : nextConfig; nowRealmImg.SetSprite(config.Img); nextRealmImg.SetSprite(nextConfig.Img); nowLVLimitText.text = Language.Get("LoadIconLV", config.LVMax); nextLVLimitText.text = Language.Get("LoadIconLV", nextConfig.LVMax); void DisplayBase() { if (realmLevel > 0 && RealmConfig.Has(realmLevel)) for (int i = 0; i < m_Properties.Count; i++) { if (config.AddAttrType.Length > i) { m_Properties[i].text = PlayerPropertyConfig.GetFullDescription(config.AddAttrType[i], config.AddAttrNum[i]); } else { m_Properties[i].text = ""; } } for (int i = 0; i < m_NextProperties.Count; i++) { if (nextConfig.AddAttrType.Length > i) { m_NextProperties[i].text = PlayerPropertyConfig.GetFullDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]); } else { m_NextProperties[i].text = ""; } } if (nextConfig.LearnSkillIDInfo.Count > 0) { var skillID = nextConfig.LearnSkillIDInfo[PlayerDatas.Instance.baseData.Job][0]; var skillConfig = SkillConfig.Get(skillID); unLockEffect.text = Language.Get("RealmUnLockSkill", skillConfig.SkillName); unLockEffectBtn.SetListener(() => { SkillDetails.ShowSkillDetails(skillID, SkillDetails.SkillSourceType.PlayerSkill, skillConfig.FightPower); }); } else if (nextConfig.AddFreePoint > 0) { var config = RealmConfig.Get(realmLevel); m_Icon.SetActive(true); m_Icon.SetSprite(config.Img); unLockEffect.text = Language.Get("RealmUnLockLG", nextConfig.AddFreePoint); unLockEffectBtn.RemoveAllListeners(); } else if (nextConfig.EquipLV > 0) { unLockEffect.text = Language.Get("RealmUnLockEquip", Language.Get("RealmEquipName", nextConfig.NameEx)); unLockEffectBtn.SetListener(() => { WindowCenter.Instance.Open<RealmEquipPreviewWin>(false, nextConfig.EquipLV); }); } else { m_Icon.SetActive(false); unLockEffect.text = ""; unLockEffectBtn.gameObject.SetActive(false); } } void DisplayProperty() { var index = 0; Dictionary<int, int> propertyDict; if (model.TryGetRealmProperty(realmLevel, out propertyDict)) //unLockEffectShowAllBtn.AddListener(); var missions = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel); for (int i = 0; i < missionObjs.Count; i++) { var keys = propertyDict.Keys; foreach (var property in keys) { m_Properties[index].SetActive(true); m_Properties[index].Display(property, propertyDict[property]); index++; } } for (int i = index; i < m_Properties.Count; i++) { m_Properties[i].SetActive(false); missionObjs[i].Display(missions[i]); } } void DisplayEquip() { var level = 0; if (model.IsUnlockEquipRealm(realmLevel, out level) && model.displayRealmLevel >= model.realmEquipDisplayLevel) { m_ContainerUnlockEquip.SetActive(true); var config = RealmConfig.Get(realmLevel); m_UnlockEquip.SetSprite(config.equipNameIcon); } else { m_ContainerUnlockEquip.SetActive(false); } } void DisplayReiki() { var config = RealmConfig.Get(realmLevel); if (config.AddFreePoint == 0) { m_ContainerReiki.SetActive(false); return; } m_ContainerReiki.SetActive(true); m_ReikiPoint.text = config.AddFreePoint.ToString(); int addTime = onHookModel.GetAddMaxOnHookTime(realmLevel); m_OnHookMaxTime.text = addTime == 0 ? string.Empty : Language.Get("GameOnHook8", addTime); } void DisplaySkill() { var config = RealmConfig.Get(realmLevel); if (config.LearnSkillIDInfo.Length < 4) { //json 字符串 可能会配置{} m_ContainerSkill.SetActive(false); return; } m_ContainerSkill.SetActive(true); var json = JsonMapper.ToObject(config.LearnSkillIDInfo); var array = JsonMapper.ToObject<int[]>(json[PlayerDatas.Instance.baseData.Job.ToString()].ToJson()); var skillID = array[0]; //约定规则只显示第一个,普攻相关有多个 var skillConfig = SkillConfig.Get(skillID); m_SkillIcon.SetSprite(skillConfig.IconName); m_SkillName.text = skillConfig.SkillName; m_ViewDetail.SetListener(() => { SkillDetails.ShowSkillDetails(skillID, SkillDetails.SkillSourceType.PlayerSkill, skillConfig.FightPower); }); } void CreatePropertyBehaviour() { Dictionary<int, int> propertyDict; var requireBehaCount = 0; if (model.TryGetRealmProperty(realmLevel, out propertyDict)) { requireBehaCount = propertyDict.Count; } if (requireBehaCount > m_Properties.Count) { var start = m_Properties.Count; for (int i = start; i < requireBehaCount; i++) { var clone = GameObject.Instantiate<PropertyBehaviour>(m_ClonePropertyBeha, Vector3.zero, Quaternion.identity); clone.transform.SetParent(m_PropertyRoot); clone.transform.localScale = Vector3.one; clone.SetActive(false); m_Properties.Add(clone); } } } private void OnEquipPreview() { RealmEquipPreviewWin.selectRealmLevel = realmLevel; WindowCenter.Instance.Open<RealmEquipPreviewWin>(); } } } System/Realm/RealmEquipPreviewWin.cs
@@ -18,8 +18,6 @@ [SerializeField] Image m_EquipName; [SerializeField] Button m_Close; public static int selectRealmLevel = 0; RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } #region Built-in protected override void BindController() @@ -52,20 +50,16 @@ void Display() { var config = RealmConfig.Get(selectRealmLevel); m_EquipName.SetSprite(config.equipNameIcon); var job = PlayerDatas.Instance.baseData.Job; int[] equips = null; model.TryGetRealmPreviewEquips(selectRealmLevel, job, out equips); model.TryGetRealmPreviewEquips(functionOrder, job, out equips); UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, new UI3DPlayerExhibitionData() { job = job, clothesId = equips != null && equips.Length > 0 ? equips[0] : 0, weaponId = equips != null && equips.Length > 1 ? equips[1] : 0, secondaryId = equips != null && equips.Length > 2 ? equips[2] : 0, weaponId = equips != null && equips.Length > 1 ? equips[0] : 0, secondaryId = equips != null && equips.Length > 2 ? equips[1] : 0, clothesId = equips != null && equips.Length > 0 ? equips[2] : 0, suitLevel = 1, }); } System/Realm/RealmLevelUpBehaviour.cs
@@ -171,7 +171,7 @@ } List<int> notSatisfyPlaces; model.SatisfyEquipCondition(realmLevel, out notSatisfyPlaces); model.SatisfyEquipCondition(model.equipNeedConfig, out notSatisfyPlaces); var progress = 8 - notSatisfyPlaces.Count; for (int i = 0; i < m_EquipPlaceNames.Length; i++) System/Realm/RealmMissionCell.cs
New file @@ -0,0 +1,129 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using LitJson; namespace vnxbqy.UI { public class RealmMissionCell : MonoBehaviour { [SerializeField] Image missionTabImg; [SerializeField] Image missionBGImg; [SerializeField] Text missionStateText; [SerializeField] Text missionNameText; [SerializeField] IntensifySmoothSlider expSlider; [SerializeField] Text processText; [SerializeField] ItemCell itemCell; [SerializeField] Image awardStateImg; [SerializeField] Button receiveBtn; RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } public void Display(int missionID) { var state = model.GetMissionState(PlayerDatas.Instance.baseData.realmLevel, missionID); var id = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, missionID); var config = RealmLVUPTaskConfig.Get(id); missionTabImg.SetSprite(StringUtility.Contact("RealmMissionTab", state)); missionBGImg.SetSprite(StringUtility.Contact("RealmMissionBG", state)); missionStateText.text = Language.Get(StringUtility.Contact("RealmMissionState", state)); int type = config.TaskType; int curValue = 0; int maxValue = 0; switch (type) { case 1: missionNameText.text = Language.Get("RealmMissionName1", config.NeedValueList[0]); expSlider.value = (float)PlayerDatas.Instance.baseData.LV / config.NeedValueList[0]; processText.text = StringUtility.Contact(PlayerDatas.Instance.baseData.LV, "/", config.NeedValueList[0]); break; case 2: if (config.NeedValueList[0] == SkyTowerModel.DATA_MAPID) { curValue = ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor; maxValue = config.NeedValueList[1]; } expSlider.value = (float)curValue / maxValue; processText.text = StringUtility.Contact(curValue, "/", maxValue); missionNameText.text = Language.Get("RealmMissionName2", MapConfig.Get(config.NeedValueList[0]).Name, config.NeedValueList[1]); break; case 3: curValue = model.GetMissionProcess(id); expSlider.value = (float)curValue / config.NeedValueList[0]; processText.text = StringUtility.Contact(curValue, "/", config.NeedValueList[0]); missionNameText.text = Language.Get("RealmMissionName3", config.NeedValueList[0]); break; case 4: curValue = packModel.GetItemCountByID(PackType.Item, RealmModel.BreakRealmPill); expSlider.value = (float)curValue / config.NeedValueList[0]; processText.text = StringUtility.Contact(curValue, "/", config.NeedValueList[0]); missionNameText.text = Language.Get("RealmMissionName4", config.NeedValueList[0]); break; case 5: RealmLevelUpEquipCondition equipCondition = new RealmLevelUpEquipCondition() { level = config.NeedValueList[0], starLevel = config.NeedValueList[1], isSuit = config.NeedValueList[2] == 1, itemColor = config.NeedValueList[3], }; var equipSet = equipModel.GetEquipSet(equipCondition.level); var realmConfig = RealmConfig.Get(equipSet.realm); if (!equipCondition.isSuit) { var colorName = UIHelper.GetColorNameByItemColor(equipCondition.itemColor); missionNameText.text = Language.Get("RealmNeedEquipCondition_1", realmConfig.NameEx, colorName, equipCondition.starLevel, 8); } else { missionNameText.text = Language.Get("RealmNeedEquipCondition_2", realmConfig.NameEx, equipCondition.starLevel, 8); } List<int> notSatisfyPlaces; model.SatisfyEquipCondition(model.equipNeedConfig, out notSatisfyPlaces); curValue = 8 - notSatisfyPlaces.Count; expSlider.value = (float)curValue / 8; processText.text = StringUtility.Contact(curValue, "/", 8); break; case 6: missionNameText.text = Language.Get("RealmMissionName6"); curValue = model.GetMissionProcess(id); expSlider.value = (float)curValue / 1; processText.text = StringUtility.Contact(curValue, "/", 1); break; } itemCell.Init(new ItemCellModel(config.AwardItemList[0][0], false, (ulong)config.AwardItemList[0][1])); awardStateImg.SetActive(state == 2); receiveBtn.AddListener(() => { if (state == 1) { CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward(); pak.RewardType = 68; pak.DataEx = (uint)missionID; GameNetSystem.Instance.SendInfo(pak); } else if (state == 0) { WindowCenter.Instance.Close<RealmWin>(); if (model.realMissionGuides.ContainsKey(type)) { NewBieCenter.Instance.StartNewBieGuideEx(model.realMissionGuides[type]); } } }); } } } System/Realm/RealmMissionCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 9bb2043787734bb409dd67edf02072f1 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Realm/RealmModel.cs
@@ -1,7 +1,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; using LitJson; using UnityEngine; namespace vnxbqy.UI { @@ -14,10 +15,7 @@ //List<List<int>> m_RealmStages = new List<List<int>>(); public int realmMaxLevel { get; private set; } public int realmPoolOpenLevel { get; private set; } public int realmEquipDisplayLevel { get; private set; } public int realmLevelUpReikiPoint { get; private set; } public bool isBossPass { get; private set; } public int xxzlAwardState { get; private set; } public int realmExpTime { get; private set; } public long startExp { get; private set; } @@ -75,8 +73,6 @@ } public DateTime expStartTime { get; private set; } int realmPoolRedpointPercent = 100; UIEffect realmEffect; int realmEffectCount = 0; @@ -141,7 +137,6 @@ public event Action selectRealmRefresh; public event Action realmExpRefresh; public event Action<bool> xxzlStateRefresh; public event Action<int> OnFlashOverEvent; public void OnFlashOver(int state) @@ -164,7 +159,6 @@ GlobalTimeEvent.Instance.secondEvent += PerSecond; packModel.refreshItemCountEvent += RefreshItemCountEvent; FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; WindowCenter.Instance.windowBeforeOpenEvent += OnBeforeWindowOpen; ParseConfig(); } @@ -177,7 +171,8 @@ buffSeconds = 0; buffAddRate = 0; realmEffectCount = 0; xxzlAwardState = 0; taskAwardState = 0; taskValues.Clear(); SysNotifyMgr.Instance.OnSystemNotifyEvent -= OnSystemNotifyEvent; } @@ -259,31 +254,31 @@ // } // } if (!string.IsNullOrEmpty(config.equips)) { var json = LitJson.JsonMapper.ToObject(config.equips); Dictionary<int, int[]> dict = new Dictionary<int, int[]>(); foreach (var jobKey in json.Keys) { var job = int.Parse(jobKey); var equipArray = LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson()); dict.Add(job, equipArray); } m_RealmPreviewEquips.Add(config.Lv, dict); } //if (!string.IsNullOrEmpty(config.equips)) //{ // var json = LitJson.JsonMapper.ToObject(config.equips); // Dictionary<int, int[]> dict = new Dictionary<int, int[]>(); // foreach (var jobKey in json.Keys) // { // var job = int.Parse(jobKey); // var equipArray = LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson()); // dict.Add(job, equipArray); // } // m_RealmPreviewEquips.Add(config.Lv, dict); //} if (!string.IsNullOrEmpty(config.recommandEquips)) { var json = LitJson.JsonMapper.ToObject(config.recommandEquips); Dictionary<int, int[]> dict = new Dictionary<int, int[]>(); foreach (var jobKey in json.Keys) { var job = int.Parse(jobKey); var equipArray = LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson()); dict.Add(job, equipArray); } m_RecommandEquips.Add(config.Lv, dict); } //if (!string.IsNullOrEmpty(config.recommandEquips)) //{ // var json = LitJson.JsonMapper.ToObject(config.recommandEquips); // Dictionary<int, int[]> dict = new Dictionary<int, int[]>(); // foreach (var jobKey in json.Keys) // { // var job = int.Parse(jobKey); // var equipArray = LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson()); // dict.Add(job, equipArray); // } // m_RecommandEquips.Add(config.Lv, dict); //} if (realmPoolOpenLevel == 0 && config.expRate != 0) { @@ -305,9 +300,8 @@ var funcConfig = FuncConfigConfig.Get("RealmExpTime"); realmExpTime = int.Parse(funcConfig.Numerical1); funcConfig = FuncConfigConfig.Get("RealmEqiupDisplayLevel"); realmEquipDisplayLevel = int.Parse(funcConfig.Numerical1); realmPoolRedpointPercent = int.Parse(funcConfig.Numerical2); funcConfig = FuncConfigConfig.Get("RealmMission"); realMissionGuides = ConfigParse.ParseIntDict(funcConfig.Numerical1); } @@ -327,14 +321,35 @@ return false; } //level 装备阶 public bool TryGetRealmPreviewEquips(int level, int job, out int[] equips) { equips = null; if (m_RealmPreviewEquips.ContainsKey(level)) if (m_RealmPreviewEquips.ContainsKey(level) && m_RealmPreviewEquips[level].ContainsKey(job)) { return m_RealmPreviewEquips[level].TryGetValue(job, out equips); } return false; if (!m_RealmPreviewEquips.ContainsKey(level)) { m_RealmPreviewEquips[level] = new Dictionary<int, int[]>(); } if (!m_RealmPreviewEquips[level].ContainsKey(job)) { m_RealmPreviewEquips[level].Add(job, new int[3]); } for (int i = 0; i < EquipModel.equipShowPlaces.Length; i++) { int place = EquipModel.equipShowPlaces[i]; var config = ItemConfig.GetEquipConfig(level, place, 5, job); if (config != null) { m_RealmPreviewEquips[level][job][i] = config.ID; } } equips = m_RealmPreviewEquips[level][job]; return true; } public bool TryGetRecommandEquips(int level, int job, out int[] equips) @@ -375,12 +390,12 @@ // error = 2; // return false; //} int equipError = 0; if (!SatisfyEquipCondition(realmLevel, out equipError)) { error = equipError; return false; } //int equipError = 0; //if (!SatisfyEquipCondition(realmLevel, out equipError)) //{ // error = equipError; // return false; //} //if (config.NeedGood != 0) //{ // var count = packModel.GetItemCountByID(PackType.Item, config.NeedGood); @@ -420,19 +435,10 @@ public bool IsUnlockEquipRealm(int realmLevel, out int level) { level = 0; var equipSets = equipModel.GetAllEquipSets(); var index = equipSets.FindIndex((x) => var config = RealmConfig.Get(realmLevel); if (config.EquipLV > 0) { var equipSet = equipModel.GetEquipSet(x); if (equipSet != null) { return equipSet.realm == realmLevel; } return false; }); if (index != -1) { level = equipSets[index]; level = config.EquipLV; return true; } return false; @@ -444,14 +450,17 @@ && expStartTime.AddTicks(TimeSpan.TicksPerSecond * buffSeconds) > time; } public bool SatisfyEquipCondition(int realmLevel, out List<int> notSatisfyPlaces) public bool SatisfyEquipCondition(RealmLVUPTaskConfig config, out List<int> notSatisfyPlaces) { notSatisfyPlaces = null; RealmLevelUpEquipCondition equipCondition; if (!TryGetRealmEquipCondition(realmLevel, out equipCondition)) { return true; } RealmLevelUpEquipCondition equipCondition = new RealmLevelUpEquipCondition() { level = config.NeedValueList[0], starLevel = config.NeedValueList[1], isSuit = config.NeedValueList[2] == 1, itemColor = config.NeedValueList[3], }; notSatisfyPlaces = new List<int>(); for (int i = 1; i <= 8; i++) { @@ -491,14 +500,17 @@ return notSatisfyPlaces.Count == 0; } public bool SatisfyEquipCondition(int realmLevel, out int error) public bool SatisfyEquipCondition(RealmLVUPTaskConfig config, out int error) { error = 0; RealmLevelUpEquipCondition equipCondition; if (!TryGetRealmEquipCondition(realmLevel, out equipCondition)) { return true; } RealmLevelUpEquipCondition equipCondition = new RealmLevelUpEquipCondition() { level = config.NeedValueList[0], starLevel = config.NeedValueList[1], isSuit = config.NeedValueList[2] == 1, itemColor = config.NeedValueList[3], }; for (int i = 1; i <= 8; i++) { var equipGuid = equipModel.GetEquip(new Int2(equipCondition.level, i)); @@ -694,17 +706,16 @@ } } public void ReceivePackage(HA311_tagMCSyncRealmInfo package) { int beforeAwardState = xxzlAwardState; isBossPass = package.IsPass == 1; xxzlAwardState = (int)package.XXZLAwardState; bool isOver = false; if (beforeAwardState != 0 && beforeAwardState != xxzlAwardState && IsRealmXXZLOver()) taskAwardState = (int)package.TaskAwardState; for (int i = 0; i < package.TaskValueCount; i++) { isOver = true; taskValues.Add(package.TaskValueList[i].TaskID, (int)package.TaskValueList[i].TaskValue); } xxzlStateRefresh?.Invoke(isOver); RealmMissionRefreshEvent?.Invoke(); RefreshRedpoint(); } @@ -787,6 +798,8 @@ { selectFloorID = passedFloor; } taskValues.Clear(); } } @@ -851,8 +864,6 @@ realmDailyRedpoint.state = RedPointState.None; towerRedpoint.state = RedPointState.None; if (!IsRealmXXZLOver()) return; if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Realm)) { @@ -912,129 +923,99 @@ // realmPoolRedpoint.state = isPoolFull ? RedPointState.Simple : RedPointState.None; //} #region 修仙之路 //#region 修仙之路 public int selectXXZL; //public int selectXXZL; //任务完成进度 public bool IsRealmXXZLMissionFinish(int missionID, out int process) { var config = RealmXXZLConfig.Get(missionID); bool isFinish = false; process = 0; switch (config.TaskType) { case 1: isFinish = treasureModel.IsTreasureCollected(config.NeedValue); process = isFinish ? 1 : 0; break; case 2: process = ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor; isFinish = process >= config.NeedValue; break; case 3: process = ModelCenter.Instance.GetModel<WorldBossModel>().killCntTotal; isFinish = process >= config.NeedValue; break; case 4: process = (int)ModelCenter.Instance.GetModel<DailyQuestModel>().ActivityPlaceInfo.TotalCount; isFinish = process >= config.NeedValue; break; case 5: isFinish = ModelCenter.Instance.GetModel<PersonalBossModel>().IsFBPass(config.NeedValue); process = isFinish ? 1 : 0; break; case 6: process = ModelCenter.Instance.GetModel<DungeonModel>().GetAllEnterTimes(60010); isFinish = process >= config.NeedValue; break; case 7: process = ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiRootTotalPointWithFree(); isFinish = process >= config.NeedValue; break; } ////任务完成进度 //public bool IsRealmXXZLMissionFinish(int missionID, out int process) //{ // var config = RealmXXZLConfig.Get(missionID); // bool isFinish = false; // process = 0; // switch (config.TaskType) // { // case 1: // isFinish = treasureModel.IsTreasureCollected(config.NeedValue); // process = isFinish ? 1 : 0; // break; // case 2: // process = ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor; // isFinish = process >= config.NeedValue; // break; // case 3: // process = ModelCenter.Instance.GetModel<WorldBossModel>().killCntTotal; // isFinish = process >= config.NeedValue; // break; // case 4: // process = (int)ModelCenter.Instance.GetModel<DailyQuestModel>().ActivityPlaceInfo.TotalCount; // isFinish = process >= config.NeedValue; // break; // case 5: // isFinish = ModelCenter.Instance.GetModel<PersonalBossModel>().IsFBPass(config.NeedValue); // process = isFinish ? 1 : 0; // break; // case 6: // process = ModelCenter.Instance.GetModel<DungeonModel>().GetAllEnterTimes(60010); // isFinish = process >= config.NeedValue; // break; // case 7: // process = ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiRootTotalPointWithFree(); // isFinish = process >= config.NeedValue; // break; // } return isFinish; } // return isFinish; //} public bool IsRealmXXZLOver() { var count = RealmXXZLConfig.GetKeys().Count; return xxzlAwardState == (Math.Pow(2, count + 1) - 2); } public int GetXXZLProcess() { var ids = RealmXXZLConfig.GetKeys(); int process = 0; foreach (var id in ids) { if (IsGetAward(int.Parse(id))) { process++; } } return process; } public bool IsGetAward(int missionID) { return (xxzlAwardState & (int)Math.Pow(2, missionID)) != 0; } //public int GetXXZLProcess() //{ // var ids = RealmXXZLConfig.GetKeys(); // int process = 0; // foreach (var id in ids) // { // if (IsGetAward(int.Parse(id))) // { // process++; // } // } // return process; //} void RefreshXXZLRedpoint() { xxzlRedpoint.state = RedPointState.None; if (IsRealmXXZLOver()) { WindowCenter.Instance.windowBeforeOpenEvent -= OnBeforeWindowOpen; return; } var ids = RealmXXZLConfig.GetKeys(); foreach (var id in ids) { int process; if (!IsGetAward(int.Parse(id)) && IsRealmXXZLMissionFinish(int.Parse(id), out process)) { xxzlRedpoint.state = RedPointState.Simple; return; } } } //public bool IsGetAward(int missionID) //{ // return (xxzlAwardState & (int)Math.Pow(2, missionID)) != 0; //} void OnBeforeWindowOpen(Window window) { if (window.name == "MainInterfaceWin") { RefreshXXZLRedpoint(); } } public void FocusSelectIndex() { var ids = RealmXXZLConfig.GetKeys(); int index = -1; foreach (var id in ids) { int missionID = int.Parse(id); int process; var state = IsGetAward(missionID); bool isFinish = IsRealmXXZLMissionFinish(missionID, out process); if (!state && isFinish) { selectXXZL = missionID - 1; return; } else if (!state && !isFinish && index == -1) { index = missionID - 1; } } selectXXZL = index; } #endregion //public void FocusSelectIndex() //{ // var ids = RealmXXZLConfig.GetKeys(); // int index = -1; // foreach (var id in ids) // { // int missionID = int.Parse(id); // int process; // var state = IsGetAward(missionID); // bool isFinish = IsRealmXXZLMissionFinish(missionID, out process); // if (!state && isFinish) // { // selectXXZL = missionID - 1; // return; // } // else if (!state && !isFinish && index == -1) // { // index = missionID - 1; // } // } // selectXXZL = index; //} //#endregion #region 境界塔 public void RequestChallenge() @@ -1110,6 +1091,88 @@ GameNetSystem.Instance.SendInfo(sendInfo); } #endregion #region 境界任务 //当前境界的任务状态 int taskAwardState; Dictionary<int, int> taskValues = new Dictionary<int, int>(); public const int BreakRealmPill = 4501; //破境丹ID public RealmLVUPTaskConfig equipNeedConfig; public Dictionary<int, int> realMissionGuides = new Dictionary<int, int>(); public event Action RealmMissionRefreshEvent; //public uint TaskAwardState; //进阶任务领奖状态;按任务ID二进制位存储是否已领取 // 返回服务端的记录任务奖励状态 0未领取 1已领取 public int GetMissionAwardState(int id) { return (taskAwardState & (int)Math.Pow(2, id)) != 0 ? 1 : 0; } //任务类型 任务说明 所需值1 所需值2 所需值3 所需值4 //1 等级达到x级 x级 //2 通关x地图x层 地图ID 层 //3 杀怪x只 x只 //4 需要境界丹 x个 //5 装备条件 阶级 星数 是否套装 颜色 //6 挑战心魔 NPCID //客户端显示的任务状态 0 代表进行中 1 代表可领取 2 代表已领取 public int GetMissionState(int realm, int missionID) { var id = RealmLVUPTaskConfig.GetID(realm, missionID); var config = RealmLVUPTaskConfig.Get(id); if (GetMissionAwardState(missionID) == 1) { return 2; } var type = config.TaskType; switch (type) { case 1: return PlayerDatas.Instance.baseData.LV >= config.NeedValueList[0] ? 1 : 0; case 2: if (config.NeedValueList[0] == SkyTowerModel.DATA_MAPID) { return ModelCenter.Instance.GetModel<SkyTowerModel>().highestPassFloor >= config.NeedValueList[1] ? 1 : 0; } return 0; case 3: return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0; case 4: return packModel.GetItemCountByID(PackType.Item, BreakRealmPill) >= config.NeedValueList[0] ? 1 : 0; case 5: equipNeedConfig = config; int error; if (SatisfyEquipCondition(config, out error)) { return 1; } return 0; case 6: return taskValues.ContainsKey(missionID) && taskValues[missionID] >= 1 ? 1 : 0; default: return 0; } } public int GetMissionProcess(int id) { if (taskValues.ContainsKey(id)) { return taskValues[id]; } return 0; } //public int GetMissionType(int realm, int missionID) //{ // var id = RealmLVUPTaskConfig.GetID(realm, missionID); // var config = RealmLVUPTaskConfig.Get(id); // return config.TaskType; //} #endregion } public struct RealmLevelUpEquipCondition @@ -1119,4 +1182,5 @@ public bool isSuit; public int itemColor; } } System/Realm/RealmNewEquipWin.cs
@@ -19,7 +19,6 @@ [SerializeField] Text m_CloseRemind; [SerializeField] Button m_Close; public static int realmLevel = 0; float timer = 0f; @@ -70,21 +69,17 @@ void Display() { var config = RealmConfig.Get(realmLevel); m_EquipName.SetSprite(config.equipNameIcon); var job = PlayerDatas.Instance.baseData.Job; int[] equips = null; model.TryGetRealmPreviewEquips(realmLevel, job, out equips); model.TryGetRealmPreviewEquips(functionOrder, job, out equips); m_RawPlayer.SetActive(true); UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, new UI3DPlayerExhibitionData() { job = job, clothesId = equips != null && equips.Length > 0 ? equips[0] : 0, weaponId = equips != null && equips.Length > 1 ? equips[1] : 0, secondaryId = equips != null && equips.Length > 2 ? equips[2] : 0, weaponId = equips != null && equips.Length > 1 ? equips[0] : 0, secondaryId = equips != null && equips.Length > 2 ? equips[1] : 0, clothesId = equips != null && equips.Length > 0 ? equips[2] : 0, suitLevel = 1, }); } System/Realm/RealmPromoteWin.cs
@@ -131,10 +131,9 @@ } var config = RealmConfig.Get(realmLevel); if (config.LearnSkillIDInfo.Length > 4) if (config.LearnSkillIDInfo.Count > 0) { var json = JsonMapper.ToObject(config.LearnSkillIDInfo); var array = JsonMapper.ToObject<int[]>(json[PlayerDatas.Instance.baseData.Job.ToString()].ToJson()); var array = config.LearnSkillIDInfo[PlayerDatas.Instance.baseData.Job]; var skillConfig = SkillConfig.Get(array[0]); m_SkillName.text = skillConfig.SkillName; System/Realm/RealmRecommandEquipWin.cs
@@ -72,7 +72,7 @@ var realmLevel = PlayerDatas.Instance.baseData.realmLevel; List<int> notSatisfyPlaces; int[] recommandEquips; if (!model.SatisfyEquipCondition(realmLevel, out notSatisfyPlaces) if (!model.SatisfyEquipCondition(model.equipNeedConfig, out notSatisfyPlaces) && model.TryGetRecommandEquips(realmLevel, PlayerDatas.Instance.baseData.Job, out recommandEquips)) { for (int i = 0; i < m_Items.Length; i++) @@ -157,7 +157,7 @@ RealmLevelUpEquipCondition equipCondition; model.TryGetRealmEquipCondition(realmLevel, out equipCondition); List<int> notSatisfyPlaces; model.SatisfyEquipCondition(realmLevel, out notSatisfyPlaces); model.SatisfyEquipCondition(model.equipNeedConfig, out notSatisfyPlaces); var config = EquipControlConfig.Get(equipCondition.level, notSatisfyPlaces[0]); RealmRecommandEquipGetWayWin.equipGetWays.Clear(); RealmRecommandEquipGetWayWin.equipGetWays.AddRange(config.getWays); System/Realm/RealmWin.cs
@@ -16,43 +16,24 @@ { [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; [SerializeField] Image m_EquipName; [SerializeField] Transform m_ContainerBoss; [SerializeField] RealmHeartMagicBehaviour m_RealmHeartMagic; [SerializeField] Button m_RealmRestraint; [SerializeField] Button m_GotoBoss; [SerializeField] Button m_Close; [SerializeField] PositionTween m_RealmBriefTween; [SerializeField] PositionTween m_RealmLevelUpTween; [SerializeField] UIEffect m_EffectCover; [SerializeField] UIEffect m_EffectBoss; [SerializeField] UIEffect m_EffectBase; [SerializeField] Transform m_RealmContainer; [SerializeField] Transform m_XxzlContainer; [SerializeField] List<ButtonEx> juanImgs; [SerializeField] List<UIEffect> juanEffects; [SerializeField] List<ItemCell> items; [SerializeField] Text xxzlMission; [SerializeField] IntensifySmoothSlider ExpSlider; [SerializeField] Text processTxt; [SerializeField] Button activeBtn; [SerializeField] Image activedImg; [SerializeField] Button leftBtn; [SerializeField] Button rightBtn; [SerializeField] UIEffect xxzlOverEffect; [SerializeField] Button towerBtn; [SerializeField] Transform m_RealmContainer; [SerializeField] IntensifySmoothSlider ExpSlider; int cacheRealmLevel = 0; ulong cacheFightPower = 0; ulong customUpPower = 0; bool tweenOnStart = false; const int REALM_STAGE_COUNT = 5; @@ -108,28 +89,6 @@ m_Close.onClick.AddListener(OnBack); m_GotoBoss.AddListener(GotoBoss); m_RealmRestraint.AddListener(RealmRestraint); for (int i = 0; i < juanImgs.Count; i++) { int index = i; juanImgs[i].AddListener(() => { model.selectXXZL = index; DisplayXXZL(); juanEffects[index].Play(); }); } leftBtn.AddListener(() => { if (model.selectXXZL == 0) return; model.selectXXZL--; juanImgs[model.selectXXZL].onClick.Invoke(); }); rightBtn.AddListener(() => { if (model.selectXXZL == juanImgs.Count - 1) return; model.selectXXZL++; juanImgs[model.selectXXZL].onClick.Invoke(); }); towerBtn.AddListener(() => { WindowCenter.Instance.Open<RealmTowerWin>(); @@ -146,41 +105,30 @@ m_RealmAnimation.onCoverChange += OnCoverChange; mainDateModel.customDisplayPower += CustomDisplayPower; WindowCenter.Instance.windowAfterCloseEvent += WindowAfterCloseEvent; model.xxzlStateRefresh += Model_xxzlStateRefresh; model.RealmMissionRefreshEvent += Model_RealmMissionRefreshEvent; cacheRealmLevel = PlayerDatas.Instance.baseData.realmLevel; cacheFightPower = PlayerDatas.Instance.baseData.FightPoint; customUpPower = 0; model.SetDayRemind(); model.FocusSelectIndex(); } private void Model_RealmMissionRefreshEvent() { m_RealmBrief.Display(); } protected override void OnActived() { var isOver = model.IsRealmXXZLOver(); m_RealmContainer.SetActive(isOver); m_XxzlContainer.SetActive(!isOver); m_RealmState = RealmState.LevelUp; HideRealmBoss(); DisplayRealmUp(); tweenOnStart = true; m_RealmBriefTween.SetStartState(); m_RealmLevelUpTween.SetStartState(); if (!m_RealmAnimation.isPlayingBossEffect) { StartTween(); } } protected override void OnAfterOpen() { DisplayXXZL(); } protected override void OnPreClose() @@ -193,7 +141,7 @@ mainDateModel.customDisplayPower -= CustomDisplayPower; m_RealmAnimation.onCoverChange -= OnCoverChange; WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent; model.xxzlStateRefresh -= Model_xxzlStateRefresh; model.RealmMissionRefreshEvent -= Model_RealmMissionRefreshEvent; HideRealmUp(); } @@ -225,8 +173,6 @@ DisplayRealmLevelUp(); DisplayRealmStages(); DisplayRealmBrief(); DisplayRealmPool(); DisplayUnlockEquip(); DisplayCover(); if (model.SatisfyChallengeBoss(model.displayRealmLevel)) @@ -247,11 +193,7 @@ { m_ContainerRealmUp.SetActive(false); m_RealmAnimation.Dispose(); m_RealmBriefTween.Stop(); m_RealmBriefTween.SetEndState(); m_RealmLevelUpTween.Stop(); m_RealmLevelUpTween.SetEndState(); //m_RealmPool.Dispose(); model.displayRealms.Clear(); foreach (var item in m_RealmStages) { @@ -293,75 +235,48 @@ void DisplayRealmLevelUp() { var requireLevelUp = model.displayRealmLevel < model.realmMaxLevel && model.selectRealm > model.displayRealmLevel; m_RealmLevelUp.SetActive(requireLevelUp); if (requireLevelUp) { m_RealmLevelUp.Display(model.selectRealm); } m_GotoBoss.SetActive(model.SatisfyChallengeBoss(model.displayRealmLevel)); } void DisplayRealmBrief() { m_RealmBrief.Display(model.selectRealm); m_RealmBrief.Display(); } void DisplayRealmPool() { m_RealmPool.SetActive(false); //if (model.displayRealmLevel >= model.realmPoolOpenLevel - 1) //{ // m_RealmPool.SetActive(true); // m_RealmPool.Display(model.displayRealmLevel); //} //else //{ // m_RealmPool.SetActive(false); //} } //void DisplayUnlockEquip() //{ // if (model.displayRealmLevel < model.realmEquipDisplayLevel) // { // return; // } void DisplayUnlockEquip() { m_ContainerUnlockEquip.SetActive(false); if (model.displayRealmLevel < model.realmEquipDisplayLevel) { return; } var stage = model.GetRealmStage(model.displayRealmLevel); List<int> realms = null; if (model.TryGetRealmStages(stage, out realms)) { for (int i = 0; i < REALM_STAGE_COUNT; i++) { var level = realms[0] + i; var equipSet = 0; if (model.displayRealmLevel < level && model.selectRealm != level && model.IsUnlockEquipRealm(level, out equipSet)) { var index = i; m_ContainerUnlockEquip.SetActive(true); foreach (var realmStage in m_RealmStages) { if (realmStage.animIndex == index) { var worldpos = realmStage.transform.TransformPoint(Vector2.zero + Vector2.down * 60); var localpos = m_ContainerRealmUp.InverseTransformPoint(worldpos); m_ContainerUnlockEquip.localPosition = localpos; break; } } var config = RealmConfig.Get(level); m_EquipName.SetSprite(config.equipNameIcon); break; } } } } // var stage = model.GetRealmStage(model.displayRealmLevel); // List<int> realms = null; // if (model.TryGetRealmStages(stage, out realms)) // { // for (int i = 0; i < REALM_STAGE_COUNT; i++) // { // var level = realms[0] + i; // var equipSet = 0; // if (model.displayRealmLevel < level && model.selectRealm != level // && model.IsUnlockEquipRealm(level, out equipSet)) // { // var index = i; // foreach (var realmStage in m_RealmStages) // { // if (realmStage.animIndex == index) // { // var worldpos = realmStage.transform.TransformPoint(Vector2.zero + Vector2.down * 60); // var localpos = m_ContainerRealmUp.InverseTransformPoint(worldpos); // break; // } // } // var config = RealmConfig.Get(level); // break; // } // } // } //} void DisplayCover() { @@ -417,21 +332,6 @@ } } void StartTween() { if (!model.IsRealmXXZLOver()) return; m_RealmBriefTween.Play(); var realmLevel = PlayerDatas.Instance.baseData.realmLevel; var requireLevelUp = realmLevel < model.realmMaxLevel && model.selectRealm > realmLevel; if (requireLevelUp) { m_RealmLevelUpTween.Play(); } tweenOnStart = false; } private void PlayerDataRefreshEvent(PlayerDataType dataType) { @@ -447,17 +347,8 @@ } } } else if (dataType == PlayerDataType.FightPower) { if (CustomDisplayPower() && PlayerDatas.Instance.baseData.FightPoint > cacheFightPower) { customUpPower += (PlayerDatas.Instance.baseData.FightPoint - cacheFightPower); } cacheFightPower = PlayerDatas.Instance.baseData.FightPoint; } else if (dataType == PlayerDataType.LV) { m_RealmLevelUp.DisplayCondition(); if (m_RealmAnimation.isPlayingAnimation || m_RealmAnimation.rotating) { return; @@ -480,7 +371,6 @@ model.displayRealms.Clear(); model.selectRealm = PlayerDatas.Instance.baseData.realmLevel + 1; DisplayRealmStages(); DisplayRealmPool(); DisplayCover(); DisplayEffectBoss(); } @@ -514,7 +404,6 @@ } } } DisplayUnlockEquip(); RealmPromoteWin.realmLevel = model.displayRealmLevel; WindowCenter.Instance.Open<RealmPromoteWin>(); @@ -522,12 +411,7 @@ { model.displayRealms.RemoveAt(0); } //if (model.displayRealms.Count > 0) //{ // TryStartAnimation(); //} DisplayRealmPool(); } private void OnLevelUpComplete() @@ -553,19 +437,7 @@ model.displayRealms.RemoveAt(0); } //if (model.displayRealms.Count > 0) //{ // TryStartAnimation(); //} } DisplayRealmPool(); if (customUpPower > 0) { mainDateModel.CustomPowerUp(customUpPower); } customUpPower = 0; } private void WindowAfterCloseEvent(Window window) @@ -573,11 +445,9 @@ if (window is RealmPromoteWin) { var equipLevel = 0; if (RealmPromoteWin.realmLevel >= model.realmEquipDisplayLevel && model.IsUnlockEquipRealm(RealmPromoteWin.realmLevel, out equipLevel)) if (model.IsUnlockEquipRealm(RealmPromoteWin.realmLevel, out equipLevel)) { RealmNewEquipWin.realmLevel = RealmPromoteWin.realmLevel; WindowCenter.Instance.Open<RealmNewEquipWin>(); WindowCenter.Instance.Open<RealmNewEquipWin>(false, equipLevel); } else { @@ -599,11 +469,6 @@ public void OnBossAppearComplete() { m_GotoBoss.SetActive(true); if (tweenOnStart) { StartTween(); } if (m_EffectCover.IsPlaying) { @@ -628,10 +493,6 @@ { DisplayRealmBrief(); DisplayRealmLevelUp(); if (!m_RealmAnimation.rotating) { DisplayUnlockEquip(); } } private void OnBack() @@ -663,88 +524,7 @@ Boss, } public void DisplayXXZL() { var isOver = model.IsRealmXXZLOver(); m_RealmContainer.SetActive(isOver); m_XxzlContainer.SetActive(!isOver); if (isOver) return; int process; for (int i = 0; i < juanImgs.Count; i++) { juanImgs[i].SetColorful(null, model.IsGetAward(i+1)); var alphaObj = juanImgs[i].GetComponent<UIAlphaTween>(); if (i == model.selectXXZL) { alphaObj.Play(); } else { alphaObj.Stop(); } } int missionID = model.selectXXZL + 1; var config = RealmXXZLConfig.Get(missionID); xxzlMission.text = config.Desc; process = 0; bool isMissionFinish = model.IsRealmXXZLMissionFinish(missionID, out process); var needValue = config.NeedValue; if (config.TaskType == 1 || config.TaskType == 5) needValue = 1; ExpSlider.value = Math.Min(1, (float)process/needValue); processTxt.text = process + "/" + needValue; var awards = JsonMapper.ToObject<int[][]>(config.AwardItemList); for (int i = 0; i < items.Count; i++) { if (i < awards.Length) { items[i].SetActive(true); int itemID = awards[i][0]; items[i].Init(new ItemCellModel(itemID, false, (ulong)awards[i][1])); items[i].button.AddListener(() => { ItemTipUtility.Show(itemID); }); } else { items[i].SetActive(false); } } bool awardState = model.IsGetAward(missionID); activeBtn.SetActive(!awardState); activeBtn.interactable = isMissionFinish; activeBtn.SetColorful(null, isMissionFinish); activeBtn.AddListener(() => { CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward(); pak.RewardType = 62; pak.DataEx = (uint)missionID; GameNetSystem.Instance.SendInfo(pak); juanImgs[missionID - 1].SetColorful(null, true); juanImgs[missionID - 1].GetComponent<ScaleTween>().Play(); juanEffects[missionID - 1].Play(); }); activedImg.SetActive(awardState); juanEffects[model.selectXXZL].Play(); } private void Model_xxzlStateRefresh(bool obj) { DisplayXXZL(); if (obj) { xxzlOverEffect.Play(); OnActived(); } } } }