Core/GameEngine/Model/Config/FashionDressConfig.cs
New file @@ -0,0 +1,63 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, January 07, 2019 //-------------------------------------------------------- using UnityEngine; using System; namespace TableConfig { public partial class FashionDressConfig : ConfigBase { public int CoatID { get ; private set ; } public int[] EquipItemID; public int UnlockItemID { get ; private set ; } public int MaxLV { get ; private set ; } public int[] CostItemCnt; public string StarAttr { get ; private set; } public override string getKey() { return CoatID.ToString(); } public override void Parse() { try { CoatID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; string[] EquipItemIDStringArray = rawContents[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); EquipItemID = new int[EquipItemIDStringArray.Length]; for (int i=0;i<EquipItemIDStringArray.Length;i++) { int.TryParse(EquipItemIDStringArray[i],out EquipItemID[i]); } UnlockItemID=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; MaxLV=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; string[] CostItemCntStringArray = rawContents[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); CostItemCnt = new int[CostItemCntStringArray.Length]; for (int i=0;i<CostItemCntStringArray.Length;i++) { int.TryParse(CostItemCntStringArray[i],out CostItemCnt[i]); } StarAttr = rawContents[5].Trim(); } catch (Exception ex) { DebugEx.Log(ex); } } } } Core/GameEngine/Model/Config/FashionDressConfig.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 5ac2a701b6eaba844b1082c87758125e timeCreated: 1546853269 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/GameEngine/Model/Config/FashionDressLevelUpConfig.cs
New file @@ -0,0 +1,49 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, January 07, 2019 //-------------------------------------------------------- using UnityEngine; using System; namespace TableConfig { public partial class FashionDressLevelUpConfig : ConfigBase { public int LV { get ; private set ; } public int NeedExp { get ; private set ; } public int[] AttrType; public override string getKey() { return LV.ToString(); } public override void Parse() { try { LV=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; NeedExp=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; string[] AttrTypeStringArray = rawContents[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); AttrType = new int[AttrTypeStringArray.Length]; for (int i=0;i<AttrTypeStringArray.Length;i++) { int.TryParse(AttrTypeStringArray[i],out AttrType[i]); } } catch (Exception ex) { DebugEx.Log(ex); } } } } Core/GameEngine/Model/Config/FashionDressLevelUpConfig.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 780afd3c2aae26346a489721491894e5 timeCreated: 1546853266 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/GameEngine/Model/ConfigManager.cs
@@ -219,6 +219,8 @@ AddAsyncTask<GatherSoulComposeConfig>(); AddAsyncTask<KingTreasureConfig>(); AddAsyncTask<KingTreasureItemConfig>(); AddAsyncTask<FashionDressLevelUpConfig>(); AddAsyncTask<FashionDressConfig>(); while (!AllCompleted()) { Lua/Gen/Resources.meta
File was deleted System/FashionDress/FashionDressModel.cs
New file @@ -0,0 +1,128 @@ using System; using System.Collections; using System.Collections.Generic; using TableConfig; using UnityEngine; namespace Snxxz.UI { public class FashionDressModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk { Dictionary<int, FashionDress> fashionDressDict = new Dictionary<int, FashionDress>(); Dictionary<int, int> fashionDressLevelDict = new Dictionary<int, int>(); int m_SelectType = 0; public int selectType { get { return m_SelectType; } set { if (m_SelectType != value) { m_SelectType = value; if (selectTypeRefresh != null) { selectTypeRefresh(); } } } } public event Action selectTypeRefresh; public override void Init() { ParseConfig(); } public void OnBeforePlayerDataInitialize() { fashionDressLevelDict.Clear(); } public void OnPlayerLoginOk() { } public override void UnInit() { } void ParseConfig() { var configs = Config.Instance.GetAllValues<FashionDressConfig>(); foreach (var config in configs) { fashionDressDict[config.CoatID] = new FashionDress(config); } } public bool TryGetFashionDress(int id, out FashionDress fashionDress) { return fashionDressDict.TryGetValue(id, out fashionDress); } public bool TryGetFashionDressProperty(int id, int star, out Dictionary<int, int> dict) { dict = null; if (fashionDressDict.ContainsKey(id)) { return fashionDressDict[id].TryGetProperty(star, out dict); } return false; } } public class FashionDress { public int id { get; private set; } public int requireLevelUpItem { get; private set; } public int maxLevel { get; private set; } public int equipPlace { get; private set; } List<int> equipItems = new List<int>(); List<int> requireLevelUpCounts = new List<int>(); Dictionary<int, Dictionary<int, int>> propertys = new Dictionary<int, Dictionary<int, int>>(); public FashionDress(FashionDressConfig config) { id = config.CoatID; requireLevelUpItem = config.UnlockItemID; maxLevel = config.MaxLV; requireLevelUpCounts.AddRange(config.CostItemCnt); var json = LitJson.JsonMapper.ToObject(config.StarAttr); foreach (var starKey in json.Keys) { var star = int.Parse(starKey); Dictionary<int, int> dict = new Dictionary<int, int>(); propertys.Add(star, dict); foreach (var propertyKey in json[starKey].Keys) { var property = int.Parse(propertyKey); dict.Add(property, int.Parse(json[starKey][propertyKey].ToString())); } } equipItems.AddRange(config.EquipItemID); var equipItemConfig = Config.Instance.Get<ItemConfig>(equipItems[0]); equipPlace = equipItemConfig.EquipPlace; } public int GetEquipItemId(int job = 0) { if (job == 0) { job = PlayerDatas.Instance.baseData.Job; } var index = job - 1; if (index < equipItems.Count) { return equipItems[index]; } return 0; } public bool TryGetProperty(int star, out Dictionary<int, int> dict) { return propertys.TryGetValue(star, out dict); } } } System/FashionDress/FashionDressModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 0a0e33f1957b1724ba147992931bd7f9 timeCreated: 1546852997 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/FashionDress/FashionDressTypeBehaviour.cs
New file @@ -0,0 +1,50 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class FashionDressTypeBehaviour : MonoBehaviour { [SerializeField] int m_FashionDressType; [SerializeField] Button m_Select; [SerializeField] RectTransform m_ContainerSelect; [SerializeField] RectTransform m_ContainerNormal; FashionDressModel model { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } } private void Awake() { m_Select.onClick.AddListener(OnSelect); } public void Display() { model.selectTypeRefresh -= SelectEquipPlaceRefresh; model.selectTypeRefresh += SelectEquipPlaceRefresh; } public void Dispose() { model.selectTypeRefresh -= SelectEquipPlaceRefresh; } private void SelectEquipPlaceRefresh() { m_ContainerSelect.gameObject.SetActive(m_FashionDressType == model.selectType); m_ContainerNormal.gameObject.SetActive(m_FashionDressType != model.selectType); } private void OnSelect() { model.selectType = m_FashionDressType; } } } System/FashionDress/FashionDressTypeBehaviour.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: ac86cee78491407418892b9b745e2b1c timeCreated: 1546862460 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/FashionDress/FashionDressWin.cs
New file @@ -0,0 +1,55 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, January 07, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class FashionDressWin : Window { [SerializeField] FashionDressTypeBehaviour[] m_FashionDressTypes; FashionDressModel model { get { return ModelCenter.Instance.GetModel<FashionDressModel>(); } } #region Built-in protected override void BindController() { } protected override void AddListeners() { } protected override void OnPreOpen() { } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } #endregion } } System/FashionDress/FashionDressWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: aa3feb2eec13a714da4c9c6522acc0a3 timeCreated: 1546859809 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/GatheringSoul/GatheringSoulModel.cs
@@ -85,15 +85,15 @@ public const int RARA_GATHERSOUL_QUALITY = 3; const int GATHERSOUL_REDPOINT_BASE = 10102; const int GATHERSOUL_REDPOINT_DEEP = 1010200; const int GATHERSOUL_REDPOINT_BASE = 10104; const int GATHERSOUL_REDPOINT_DEEP = 1010400; static int redpointIndex = 5; public readonly Redpoint redpoint = new Redpoint(101, GATHERSOUL_REDPOINT_BASE); public readonly Redpoint equipRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010201); public readonly Redpoint replaceRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010202); public readonly Redpoint resolveRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010203); public readonly Redpoint levelUpRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010204); public readonly Redpoint equipRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010401); public readonly Redpoint replaceRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010402); public readonly Redpoint resolveRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010403); public readonly Redpoint levelUpRedpoint = new Redpoint(GATHERSOUL_REDPOINT_BASE, 1010404); static readonly IComparer<int> soulPackSort = new GatherSoulPackSort(); static readonly IEqualityComparer<int> holeItemTypeDistinct = new HoleItemTypeDistinct(); System/Role/RolePanel.cs
@@ -16,6 +16,7 @@ [SerializeField] FunctionButton functionButtonRole; [SerializeField] FunctionButton functionButtonMagician; [SerializeField] FunctionButton m_GatherSoul; [SerializeField] FunctionButton m_FashionDress; [SerializeField] RectTransform m_RoleInfoRt; [SerializeField] Text m_PropertyAtk; @@ -267,6 +268,7 @@ functionButtonMagician.onClick.AddListener(OnFuncMagician); m_AddPoint.onClick.AddListener(OnPromoteClick); m_GatherSoul.onClick.AddListener(GatherSoul); m_FashionDress.onClick.AddListener(OpenFashionDress); m_PlayerPropertyBtn.onClick.AddListener(OnAttrExplainClick); m_TitleBtn.onClick.AddListener(OnDesignationClick); m_RenameBtn.onClick.AddListener(OnRenameClick); @@ -283,6 +285,12 @@ functionOrder = m_GatherSoul.order; } private void OpenFashionDress() { CloseChild(); functionOrder = m_FashionDress.order; } private void OnFuncMagician() { CloseChild(); System/WindowBase/ModelCenter.cs
@@ -218,6 +218,7 @@ RegisterModel<GatherSoulComposeModel>(); RegisterModel<GatherSoulDungeonModel>(); RegisterModel<KingTreasureModel>(); RegisterModel<FashionDressModel>(); inited = true; } Utility/EnumHelper.cs
@@ -374,6 +374,9 @@ retBaldric5, //17 佩饰 retBaldric6, //18 佩饰 mount = 19,//当前的坐骑 retFashionWeapon = 20, retFashionClothes = 21, retFashionWeapon2 = 22, retMax, };