Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -27,6 +27,7 @@ // 登记相应的数据体及对应的数据转逻辑类 Register(typeof(HA719_tagSCPlayerEquipCacheResult) ,typeof(DTCA719_tagSCPlayerEquipCacheResult)); Register(typeof(HB108_tagMCYinjiStartTime) ,typeof(DTCB108_tagMCYinjiStartTime)); Register(typeof(HA309_tagMCSkillElementInfo), typeof(DTCA309_tagMCSkillElementInfo)); Register(typeof(HA325_tagMCNPCAttackCountInfo), typeof(DTCA325_tagMCNPCAttackCountInfo)); Register(typeof(HB215_tagMCFBBuyBuffInfo), typeof(DTCB215_tagMCFBBuyBuffInfo)); Register(typeof(HA718_tagMCCollectAwardItemInfo), typeof(DTCA718_tagMCCollectAwardItemInfo)); @@ -205,7 +206,6 @@ Register(typeof(HA003_tagUniversalGameRecInfo), typeof(DTCA003_tagUniversalGameRecInfo)); Register(typeof(HA505_tagMCFamilyRedPacketGoldLimit), typeof(DTCA505_tagMCFamilyRedPacketGoldLimit)); Register(typeof(H0403_tagPlayerLoginLoadOK), typeof(DTC0403_tagPlayerLoginLoadOK));//数据初始化完成 Register(typeof(HA309_tagMCEquipPartSuiteLVInfo), typeof(DTCA309_tagMCEquipPartSuiteLVInfo)); //得到套装数据 Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer)); //得到合成结果回应 Register(typeof(HA317_tagMCAllEquipAttrActiveInfo), typeof(DTCA317_tagMCAllEquipAttrActiveInfo)); //得到激活全身星级和全身强化的信息 Register(typeof(HA321_tagMCPrayElixirResult), typeof(DTCA321_tagMCPrayElixirResult)); //祈福丹药结果 Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA516_tagCMMagicWeaponState.cs
File was deleted Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA516_tagCMMagicWeaponState.cs.meta
File was deleted Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA516_tagCMSelectSkillElement.cs
New file @@ -0,0 +1,18 @@ using UnityEngine; using System.Collections; // A5 16 选择技能五行专精 #tagCMSelectSkillElement public class CA516_tagCMSelectSkillElement : GameNetPackBasic { public uint SkillTypeID; // 专精技能ID public CA516_tagCMSelectSkillElement () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA516; } public override void WriteToBytes () { WriteBytes (SkillTypeID, NetDataType.DWORD); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA516_tagCMSelectSkillElement.cs.meta
File was renamed from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e480e4bafe9ec364b9268eb18d798dc6 timeCreated: 1520495140 guid: 0b5750f7339b52d45a810522f59a3c35 timeCreated: 1556262141 licenseType: Pro MonoImporter: serializedVersion: 2 Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA309_tagMCEquipPartSuiteLVInfo.cs
File was deleted Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA309_tagMCEquipPartSuiteLVInfo.cs.meta
File was deleted Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA309_tagMCSkillElementInfo.cs
New file @@ -0,0 +1,23 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, April 26, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using Snxxz.UI; public class DTCA309_tagMCSkillElementInfo : DtcBasic { public override void Done(GameNetPackBasic vNetPack) { base.Done(vNetPack); var package = vNetPack as HA309_tagMCSkillElementInfo; ModelCenter.Instance.GetModel<TreasureSkillModel>().OnReceivePackage(package); } } Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA309_tagMCSkillElementInfo.cs.metacopy from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA309_tagMCSkillElementInfo.cs.meta
File was copied from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e480e4bafe9ec364b9268eb18d798dc6 timeCreated: 1520495140 guid: a2ec01cc7e3c6574e93dcce646183874 timeCreated: 1556262100 licenseType: Pro MonoImporter: serializedVersion: 2 Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs
File was deleted Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCSkillElementInfo.cs
New file @@ -0,0 +1,29 @@ using UnityEngine; using System.Collections; // A3 09 技能五行专精信息 #tagMCSkillElementInfo public class HA309_tagMCSkillElementInfo : GameNetPackBasic { public byte Cnt; // 数量 public tagMCSkillElementData[] InfoList; public HA309_tagMCSkillElementInfo () { _cmd = (ushort)0xA309; } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out Cnt, vBytes, NetDataType.BYTE); InfoList = new tagMCSkillElementData[Cnt]; for (int i = 0; i < Cnt; i ++) { InfoList[i] = new tagMCSkillElementData(); TransBytes (out InfoList[i].MainSkillID, vBytes, NetDataType.DWORD); TransBytes (out InfoList[i].ElementSkillID, vBytes, NetDataType.DWORD); } } public struct tagMCSkillElementData { public uint MainSkillID; // 主技能ID public uint ElementSkillID; // 专精技能ID } } Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCSkillElementInfo.cs.metacopy from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta copy to Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCSkillElementInfo.cs.meta
File was copied from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e480e4bafe9ec364b9268eb18d798dc6 timeCreated: 1520495140 guid: 4b9b3842aec0ac643ac31cd4d81c0df3 timeCreated: 1556262074 licenseType: Pro MonoImporter: serializedVersion: 2 Core/NetworkPackage/ServerPack/MapServerPack/HA3_Activity/HA309_tagGoldActionBankPrizeRecord.cs
File was deleted Core/NetworkPackage/ServerPack/MapServerPack/HA3_Activity/HA309_tagGoldActionBankPrizeRecord.cs.meta
File was deleted Lua/Gen/SnxxzUITreasureSkillModelWrap.cs
@@ -30,7 +30,6 @@ Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetSkills", _m_TryGetSkills); Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetSkill", _m_TryGetSkill); Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryGetPotential", _m_TryGetPotential); Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsPotentialUnlock", _m_IsPotentialUnlock); Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnReceivePackage", _m_OnReceivePackage); Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryLevelUpTreasureSkill", _m_TryLevelUpTreasureSkill); Utils.RegisterFunc(L, Utils.METHOD_IDX, "TryLevelUpPotential", _m_TryLevelUpPotential); @@ -293,35 +292,6 @@ return 2; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_IsPotentialUnlock(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); Snxxz.UI.TreasureSkillModel gen_to_be_invoked = (Snxxz.UI.TreasureSkillModel)translator.FastGetCSObj(L, 1); { int _skillId = LuaAPI.xlua_tointeger(L, 2); bool gen_ret = gen_to_be_invoked.IsPotentialUnlock( _skillId ); LuaAPI.lua_pushboolean(L, gen_ret); return 1; } } catch(System.Exception gen_e) { System/Skill/ExpertSkillConditionCell.cs
New file @@ -0,0 +1,39 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class ExpertSkillConditionCell : CellView { [SerializeField] Text m_Condition; [SerializeField] Text m_Description; [SerializeField] Image m_Line; TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } public void Display(int skillId, int level) { var skillConfig = SkillConfig.Get(skillId + level - 1); var property = skillConfig.RequireProperty(); var propertyConfig = PlayerPropertyConfig.Get(property); m_Condition.text = string.Format("{0}灵根{1}激活", propertyConfig.Name, skillConfig.RequirePropertyValue()); m_Description.text = skillConfig.Description; m_Line.gameObject.SetActive(level < skillConfig.SkillMaxLV); var currentValue = UIHelper.GetPropertyValue((PropertyType)property); if (currentValue >= skillConfig.RequirePropertyValue()) { m_Description.color = UIHelper.s_LightYellow; } else { m_Description.color = UIHelper.s_Gray; } } } } System/Skill/ExpertSkillConditionCell.cs.metacopy from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta copy to System/Skill/ExpertSkillConditionCell.cs.meta
File was copied from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e480e4bafe9ec364b9268eb18d798dc6 timeCreated: 1520495140 guid: 03b9196771194cd4bb103743372d875c timeCreated: 1556261565 licenseType: Pro MonoImporter: serializedVersion: 2 System/Skill/ExpertSkillSelectWin.cs
New file @@ -0,0 +1,246 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, April 26, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class ExpertSkillSelectWin : Window { [SerializeField] PositionTween m_PositionTween; [SerializeField] SkillExpertWidget[] m_SkillExperts; [SerializeField] UIAlphaTween m_AlphaTween; [SerializeField] Image m_SkillIcon; [SerializeField] Text m_SkillName; [SerializeField] Text m_Reiki; [SerializeField] ScrollerController m_Controller; [SerializeField] Button m_Select; [SerializeField] Button m_Close1; [SerializeField] Button m_Close2; public static int selectSkillId = 0; bool m_OpenDetail = false; int m_SelectExpert = 0; int selectExpert { get { return m_SelectExpert; } set { if (m_SelectExpert != value) { if (!m_OpenDetail) { m_OpenDetail = true; DisplayAnimation(); } m_SelectExpert = value; DisplaySelect(); DisplayDetail(); } } } TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } #region Built-in protected override void BindController() { } protected override void AddListeners() { m_Controller.OnRefreshCell += OnRefreshCell; m_Select.AddListener(OnSelect); m_Close1.AddListener(CloseClick); m_Close2.AddListener(CloseClick); } protected override void OnPreOpen() { m_PositionTween.SetStartState(); m_AlphaTween.SetStartState(); m_OpenDetail = false; Display(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } void Display() { SetDefaultSelect(); DisplayExperts(); DisplaySelect(); DisplayDetail(); } void SetDefaultSelect() { m_SelectExpert = 0; model.TryGetExpertSkill(selectSkillId, out m_SelectExpert); } void DisplayExperts() { TreasureSkill skill; if (model.TryGetSkill(selectSkillId, out skill)) { for (int i = 0; i < m_SkillExperts.Length; i++) { var potential = skill.potentials[i]; m_SkillExperts[i].Display(potential.id, OnSelect); } } } void DisplaySelect() { for (int i = 0; i < m_SkillExperts.Length; i++) { m_SkillExperts[i].SetSelect(selectExpert == m_SkillExperts[i].skillId); } } void DisplayDetail() { if (selectExpert != 0) { var level = 0; TreasurePotential expert; if (model.TryGetPotential(selectExpert, out expert)) { level = expert.level; } SkillConfig skillConfig; if (level == 0) { skillConfig = SkillConfig.Get(selectExpert); } else { skillConfig = SkillConfig.Get(selectExpert + level - 1); } m_SkillIcon.SetSprite(skillConfig.IconName); m_SkillName.text = skillConfig.SkillName; var property = skillConfig.RequireProperty(); var propertyConfig = PlayerPropertyConfig.Get(property); m_Reiki.text = propertyConfig.Name; m_Reiki.color = UIHelper.GetPropertyColor(property); m_Controller.Refresh(); for (int i = 1; i <= skillConfig.SkillMaxLV; i++) { m_Controller.AddCell(ScrollerDataType.Header, i); } m_Controller.Restart(); } } void DisplayAnimation() { m_PositionTween.Play(); m_AlphaTween.Play(); } private void OnSelect() { if (selectExpert != 0) { var pak = new CA516_tagCMSelectSkillElement(); pak.SkillTypeID = (uint)selectExpert; GameNetSystem.Instance.SendInfo(pak); } CloseImmediately(); } private void OnSelect(int skillId) { selectExpert = skillId; } private void OnRefreshCell(ScrollerDataType type, CellView cell) { var expertCell = cell as ExpertSkillConditionCell; expertCell.Display(selectExpert, cell.index); } #endregion [Serializable] public class SkillExpertWidget { [SerializeField] Image m_Icon; [SerializeField] Text m_SkillName; [SerializeField] Text m_Reiki; [SerializeField] Transform m_ContainerSelect; [SerializeField] Text m_Use; [SerializeField] Button m_Select; public int skillId { get; private set; } TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } public void Display(int skillId, Action<int> func) { this.skillId = skillId; var skillConfig = SkillConfig.Get(skillId); m_Icon.SetSprite(skillConfig.IconName); m_SkillName.text = skillConfig.SkillName; var property = skillConfig.RequireProperty(); var propertyConfig = PlayerPropertyConfig.Get(property); m_Reiki.text = propertyConfig.Name; m_Reiki.color = UIHelper.GetPropertyColor(property); var selectExpertSkill = 0; model.TryGetExpertSkill(ExpertSkillSelectWin.selectSkillId, out selectExpertSkill); m_Use.gameObject.SetActive(selectExpertSkill == skillId); m_Select.SetListener(() => { if (func != null) { func(skillId); } }); } public void SetSelect(bool select) { m_ContainerSelect.gameObject.SetActive(select); } } } } System/Skill/ExpertSkillSelectWin.cs.metacopy from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta copy to System/Skill/ExpertSkillSelectWin.cs.meta
File was copied from Core/NetworkPackage/ServerPack/HA3_Function/HA309_tagMCEquipPartSuiteLVInfo.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e480e4bafe9ec364b9268eb18d798dc6 timeCreated: 1520495140 guid: a594ab781c4fff047b992a7bd9a9a9a9 timeCreated: 1556250942 licenseType: Pro MonoImporter: serializedVersion: 2 System/Skill/TalentModel.cs
@@ -565,7 +565,7 @@ { return 0; } return config.StateSkillLV / 10000; return config.StateSkillLV / 100000; } public static int RequirePropertyValue(this SkillConfig config) @@ -574,7 +574,7 @@ { return 0; } return config.StateSkillLV % 10000; return config.StateSkillLV % 100000; } } } System/Skill/TreasurePotentialBehaviour.cs
File was deleted System/Skill/TreasurePotentialBehaviour.cs.meta
File was deleted System/Skill/TreasureSkillModel.cs
@@ -10,6 +10,7 @@ { Dictionary<int, TreasureSkill> treasureSkills = new Dictionary<int, TreasureSkill>(); Dictionary<int, List<int>> jobTreasureSkills = new Dictionary<int, List<int>>(); Dictionary<int, int> m_ExpertSkills = new Dictionary<int, int>(); public List<int> skillLevelUpItems = new List<int>(); @@ -44,6 +45,7 @@ public event Action<int> treasureSkillRefresh; public event Action<int> skillLevelUpRefresh; public event Action<int, int> potentialLevelRefresh; public event Action expertSkillRefresh; public override void Init() { ParseConfig(); @@ -58,6 +60,7 @@ { skill.Reset(); } m_ExpertSkills.Clear(); serverInited = false; } @@ -107,8 +110,7 @@ treasureSkills.Add(config.limitSkillId, treasureSkill); index++; } treasureSkill.potentials.Add(new TreasurePotential(config.id, 0, config.limitLevel, treasureSkill.redpoint.id)); treasureSkill.potentials.Add(new TreasurePotential(config.id, 0, treasureSkill.redpoint.id)); var skillConfig = SkillConfig.Get(config.limitSkillId); List<int> skills; @@ -160,6 +162,11 @@ return treasureSkills.TryGetValue(skillId, out treasureSkill); } public bool TryGetExpertSkill(int skillId,out int _skill) { return m_ExpertSkills.TryGetValue(skillId, out _skill); } public bool TryGetPotential(int skillId, out TreasurePotential potential) { var treasureSkillId = 0; @@ -172,21 +179,6 @@ return x.id == skillId; }); return potential != null; } return false; } public bool IsPotentialUnlock(int skillId) { var treasureSkillId = 0; if (ContainsSkill(skillId, out treasureSkillId)) { var treasureSkill = treasureSkills[treasureSkillId]; TreasurePotential potential; if (TryGetPotential(skillId, out potential)) { return treasureSkill.level >= potential.openLevel; } } return false; } @@ -249,6 +241,19 @@ } UpdateRedpoint(); } } public void OnReceivePackage(HA309_tagMCSkillElementInfo package) { for (int i = 0; i < package.Cnt; i++) { var data = package.InfoList[i]; m_ExpertSkills[(int)data.MainSkillID] = (int)data.ElementSkillID; } if (expertSkillRefresh != null) { expertSkillRefresh(); } } @@ -369,20 +374,6 @@ { skill.levelUpRedpoint.state = RedPointState.None; } foreach (var potential in skill.potentials) { if (requireRemind && funcOpen && IsPotentialUnlock(potential.id) && TryLevelUpPotential(potential.id, out error) && skill.level > 0) { potential.levelUpRedpoint.state = RedPointState.Simple; } else { potential.levelUpRedpoint.state = RedPointState.None; } } } } } @@ -456,23 +447,16 @@ public class TreasurePotential { public readonly int id; public readonly int openLevel; public readonly int maxLevel; public int level { get; private set; } public Redpoint levelUpRedpoint { get; private set; } public TreasurePotential(int id, int level, int openLevel, int redpointBase) public TreasurePotential(int id, int level, int redpointBase) { this.id = id; this.level = level; this.openLevel = openLevel; var config = SkillConfig.Get(id); maxLevel = config.SkillMaxLV; levelUpRedpoint = new Redpoint(redpointBase, TreasureSkillModel.REDPOINTID_BASE + TreasureSkillModel.redpointIndex++); } public SkillConfig GetSkillConfig(int level) System/Skill/TreasureSkillWin.cs
@@ -16,23 +16,15 @@ { [SerializeField] ScrollerController m_Controller; [SerializeField] Text m_SkillName; [SerializeField] Text m_SkillLevel; [SerializeField] Text m_SkillCoolDown; [SerializeField] Transform m_ContainerNow; [SerializeField] Text m_SkillDescNow; [SerializeField] Transform m_ContainerNext; [SerializeField] Text m_SkillDescNext; [SerializeField] Transform m_ContainerLevelUp; [SerializeField] SkillWidget m_SkillNow; [SerializeField] SkillWidget m_SkillNext; [SerializeField] SkillExpertWidget m_SkillExpert; [SerializeField] Button m_ExpertSelect; [SerializeField] Transform m_ContainerMax; [SerializeField] ItemBehaviour m_Item; [SerializeField] Button m_GetWay; [SerializeField] Button m_LevelUp; [SerializeField] RedpointBehaviour m_LevelRedpoint; [SerializeField] UIEffect m_LevelUpEffect; [SerializeField] Transform m_ContainerMax; [SerializeField] TreasurePotentialBehaviour[] m_TreasurePotentials; List<Clock> clocks = new List<Clock>(); TreasureSkillModel model { @@ -53,6 +45,7 @@ { m_Controller.OnRefreshCell += OnRefreshCell; m_LevelUp.AddListener(LevelUp); m_ExpertSelect.AddListener(ExpertSelect); } protected override void OnPreOpen() @@ -75,6 +68,7 @@ model.selectRefresh += SelectRefresh; model.skillLevelUpRefresh += SkillLevelUpRefresh; packModel.refreshItemCountEvent += RefreshItemCountEvent; model.expertSkillRefresh += ExpertSkillRefresh; } protected override void OnAfterOpen() @@ -87,18 +81,8 @@ model.selectRefresh -= SelectRefresh; model.skillLevelUpRefresh -= SkillLevelUpRefresh; packModel.refreshItemCountEvent -= RefreshItemCountEvent; model.expertSkillRefresh -= ExpertSkillRefresh; model.SetAlreadyRemind(); for (int i = 0; i < m_TreasurePotentials.Length; i++) { m_TreasurePotentials[i].StopUnlock(); } foreach (var clock in clocks) { Clock.Stop(clock); } clocks.Clear(); } protected override void OnAfterClose() @@ -108,7 +92,7 @@ void SetDefaultSelect() { var selectSkill = 0; var _skill = 0; List<int> list; if (model.TryGetSkills(out list)) { @@ -117,29 +101,29 @@ TreasureSkill skill; if (model.TryGetSkill(skillId, out skill)) { if (selectSkill == 0 && skill.level > 0) if (_skill == 0 && skill.level > 0) { selectSkill = skillId; _skill = skillId; } if (skill.redpoint.state == RedPointState.Simple) { selectSkill = skillId; _skill = skillId; } } } if (selectSkill == 0) if (_skill == 0) { selectSkill = list[0]; _skill = list[0]; } } model.selectSkill = selectSkill; model.selectSkill = _skill; } private void Display() { DisplaySkills(); DisplaySkillDetial(); DisplayPotentials(); DisplayExpertSkill(); } private void DisplaySkills() @@ -159,7 +143,6 @@ void DisplaySkillDetial() { TreasureSkill skill; m_GetWay.RemoveAllListeners(); if (model.TryGetSkill(model.selectSkill, out skill)) { var config = skill.GetSkillConfig(skill.level); @@ -167,50 +150,41 @@ { return; } m_SkillName.text = config.SkillName; m_SkillLevel.text = Language.Get("SkillActLevel", skill.level); m_SkillCoolDown.text = Language.Get("L1065", config.CoolDownTime / 1000); m_SkillDescNow.text = config.Description; m_LevelRedpoint.redpointId = skill.levelUpRedpoint.id; m_SkillNow.Display(skill.skillId, skill.level); bool isMax = skill.level >= skill.maxLevel; m_ContainerNext.gameObject.SetActive(!isMax); m_ContainerLevelUp.gameObject.SetActive(!isMax); m_SkillNext.SetActive(!isMax); m_ContainerMax.gameObject.SetActive(isMax); if (!isMax) { var nextSkillConfig = SkillConfig.Get(skill.skillId + skill.level); m_SkillDescNext.text = nextSkillConfig.Description; m_Item.SetItem(nextSkillConfig.ExAttr4, nextSkillConfig.ExAttr5); m_GetWay.AddListener(() => { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.Daily_EmperorRelic); }); var upConfig = SkillConfig.Get(skill.skillId + skill.level); m_Item.SetItem(upConfig.ExAttr4, upConfig.ExAttr5); m_SkillNext.Display(skill.skillId, skill.level + 1); } } } private void DisplayPotentials() void DisplayExpertSkill() { for (int i = 0; i < m_TreasurePotentials.Length; i++) var skillId = 0; var level = 0; if (model.TryGetExpertSkill(model.selectSkill, out skillId)) { DisplayPotential(i); TreasurePotential potential; if (model.TryGetPotential(skillId, out potential)) { level = potential.level; } } m_SkillExpert.Display(skillId, level); } private void DisplayPotential(int index) private void ExpertSelect() { TreasureSkill skill; if (!model.TryGetSkill(model.selectSkill, out skill)) { return; } if (index < m_TreasurePotentials.Length) { m_TreasurePotentials[index].gameObject.SetActive(index < skill.potentials.Count); m_TreasurePotentials[index].Display(skill.potentials[index].id); } ExpertSkillSelectWin.selectSkillId = model.selectSkill; WindowCenter.Instance.Open<ExpertSkillSelectWin>(); } private void LevelUp() @@ -245,20 +219,8 @@ private void SelectRefresh() { for (int i = 0; i < m_TreasurePotentials.Length; i++) { m_TreasurePotentials[i].StopUnlock(); } foreach (var clock in clocks) { Clock.Stop(clock); } clocks.Clear(); m_Controller.m_Scorller.RefreshActiveCellViews(); DisplaySkillDetial(); DisplayPotentials(); } private void SkillLevelUpRefresh(int id) @@ -267,44 +229,12 @@ { m_Controller.m_Scorller.RefreshActiveCellViews(); DisplaySkillDetial(); m_LevelUpEffect.Play(); TreasureSkill skill; if (model.TryGetSkill(model.selectSkill, out skill)) { for (int i = 0; i < skill.potentials.Count; i++) { var index = i; if (index < m_TreasurePotentials.Length && skill.potentials[index].openLevel == skill.level) { m_TreasurePotentials[index].StartUnlock(); Clock clock = null; clock = Clock.AlarmAfter(1, () => { DisplayPotential(index); if (clock != null && clocks.Contains(clock)) { clocks.Remove(clock); } }); clocks.Add(clock); } } } } else { var skillId = 0; if (model.ContainsSkill(id, out skillId)) { if (skillId == model.selectSkill) { DisplayPotentials(); } } } } private void ExpertSkillRefresh() { DisplayExpertSkill(); } private void RefreshItemCountEvent(PackType packType, int arg2, int itemId) @@ -314,6 +244,87 @@ DisplaySkillDetial(); } } [Serializable] public class SkillWidget { [SerializeField] Transform m_Container; [SerializeField] Text m_SkillLevel; [SerializeField] Text m_SkillCoolDown; [SerializeField] Text m_SkillDesc; TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } public void Display(int skillId, int level) { m_SkillLevel.text = Language.Get("SkillActLevel", level); TreasureSkill skill; model.TryGetSkill(skillId, out skill); var skillConfig = skill.GetSkillConfig(level); m_SkillCoolDown.text = skillConfig.CoolDownTime == 0 ? string.Empty : Language.Get("L1065", skillConfig.CoolDownTime / 1000); m_SkillDesc.text = skillConfig.Description; } public void SetActive(bool active) { m_Container.gameObject.SetActive(active); } } [Serializable] public class SkillExpertWidget { [SerializeField] Image m_SkillIcon; [SerializeField] Transform m_ContainerReiki; [SerializeField] Text m_Reiki; [SerializeField] Text m_UnSelectRemind; [SerializeField] Text m_SwitchRemind; [SerializeField] Text m_Description; TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } public void Display(int skillId, int level) { m_SkillIcon.gameObject.SetActive(skillId != 0); m_UnSelectRemind.gameObject.SetActive(skillId == 0); m_SwitchRemind.gameObject.SetActive(skillId != 0); m_Description.gameObject.SetActive(skillId != 0); m_ContainerReiki.gameObject.SetActive(skillId != 0); if (skillId != 0) { SkillConfig skillConfig; if (level == 0) { skillConfig = SkillConfig.Get(skillId); } else { skillConfig = SkillConfig.Get(skillId + level - 1); } m_SkillIcon.SetSprite(skillConfig.IconName); var property = skillConfig.RequireProperty(); var propertyConfig = PlayerPropertyConfig.Get(property); m_Reiki.text = propertyConfig.Name; m_Reiki.color = UIHelper.GetPropertyColor(property); if (level == 0) { var conditionLabel = string.Format("{0}灵根{1}激活", propertyConfig.Name, skillConfig.RequirePropertyValue()); conditionLabel = UIHelper.AppendColor(TextColType.Red, conditionLabel, true); m_Description.text = StringUtility.Contact(skillConfig.Description, conditionLabel); m_Description.color = UIHelper.s_Gray; } else { m_Description.text = skillConfig.Description; m_Description.color = UIHelper.s_NavyBrown; } } } } } } Utility/UIHelper.cs
@@ -440,7 +440,7 @@ public static readonly Color s_DarkPinkColor = new Color32(255, 124, 124, 255); public static readonly Color s_DarkRedColor = new Color32(250, 1, 1, 255); public static readonly Color s_DarkPurpleColor = new Color32(236, 75, 246, 255); public static readonly Color s_DarkBlueColor = new Color32(49, 206, 251, 255); public static readonly Color s_DarkBlueColor = new Color32(49, 206, 251, 255);//31cefb public static readonly Color s_DarkOrangeColor = new Color32(248, 152, 59, 255); public static readonly Color s_DarkWhiteColor = new Color32(247, 247, 247, 255); public static readonly Color s_DarkGreenColor = new Color32(53, 225, 34, 255); //35e122 @@ -448,9 +448,11 @@ public static readonly Color s_NavyBrown = new Color32(64, 28, 6, 255);//401c06 public static readonly Color s_Black = new Color32(0, 0, 0, 255); public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255); public static readonly Color s_LightGreen = new Color32(141, 220, 17, 255); public static readonly Color s_LightGreen = new Color32(141, 220, 17, 255);//8ddc11 public static readonly Color s_LightYellow = new Color32(255, 244, 205, 255); //fff4cd public static readonly Color s_Gray = new Color32(204, 204, 204, 255); public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b public static readonly Color s_BrightDanLV0 = new Color32(102, 102, 102, 255); //666666 public static readonly Color s_BrightDanLV1 = new Color32(148, 96, 255, 255); //9460ff @@ -692,6 +694,24 @@ } return _itemColor; } public static Color GetPropertyColor(int property) { switch ((PropertyType)property) { case PropertyType.Mater: return s_Gold; case PropertyType.Wood: return s_LightGreen; case PropertyType.Water: return s_DarkBlueColor; case PropertyType.Fire: return s_GrayDanLV5; case PropertyType.Earth: return s_EarthYellow; } return s_NavyBrown; } #endregion #region 计算战斗力