| System/Strengthening/GodBeastEntry.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Strengthening/GodBeastEntry.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Strengthening/GodBeastReinforcementWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Strengthening/GodBeastReinforcementWin.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Strengthening/GodBeastSlidingList.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Strengthening/GodBeastSlidingList.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/Strengthening/GodBeastEntry.cs
New file @@ -0,0 +1,58 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Thursday, August 16, 2018 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; using System.Collections.Generic; using TableConfig; //神兽强化;列表条目 namespace Snxxz.UI { public class GodBeastEntry : MonoBehaviour { [SerializeField] ItemCell m_itemCell; [SerializeField] GameObject m_Selectedbar_Image; [SerializeField] Text m_Item_Text; //[SerializeField] Button // DogzModel Dogz_model; DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } public void GetGodBeastLocationMarker(int locationMarker) { int godBeastNumber = locationMarker / 10; int godBeastPart = locationMarker % 10; List<ItemModel> itemModel = dogz_model.GetDogzEquips(godBeastNumber); if (itemModel != null) { for (int i = 0; i < itemModel.Count; i++) { if (itemModel[i].EquipPlace == godBeastPart) { ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, 1); m_itemCell.Init(ItemModel); var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(itemModel[i].itemId); var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度] m_Item_Text.color = UIHelper.GetUIColor(itemConfig.ItemColor); if (IudetDogzEquipPlus != null && IudetDogzEquipPlus[0] > 0) { m_Item_Text.text = itemConfig.ItemName+" +"+ IudetDogzEquipPlus[0]; } else { m_Item_Text.text = itemConfig.ItemName; } } } } } } } System/Strengthening/GodBeastEntry.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: ce0013549955f054e978142d01217a31 timeCreated: 1534423338 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Strengthening/GodBeastReinforcementWin.cs
New file @@ -0,0 +1,152 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Thursday, August 16, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; //神兽强化 namespace Snxxz.UI { public class GodBeastClass { public int GodBeastNumber;//神兽编号 public int GodBeastPart;//神兽部位 public int GodBeastLv;//神兽等级 public int GodBeasProficiency;//熟练度 public int GodBeastQuality;//神兽品质 public int GodBeastStar;//神兽星级 public int LocationMarker;//位置标记 } public class GodBeastReinforcementWin : Window { [SerializeField] ScrollerController m_ScrollerController; [SerializeField] GodBeastSlidingList m_GodBeastSlidingList; [SerializeField] GameObject m_Listprompt_Text; DogzModel Dogz_model; DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } private List<GodBeastClass> GodBeastList = new List<GodBeastClass>(); #region Built-in protected override void BindController() { } protected override void AddListeners() { } protected override void OnPreOpen() { GetGodBeast();//获取神兽强化装备信息 m_ScrollerController.OnRefreshCell += OnRefreshGridCell; OnCreateGridLineCell(m_ScrollerController); if (GodBeastList.Count > 0) { m_ScrollerController.JumpIndex(0); } m_GodBeastSlidingList.Init(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见 m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; } protected override void OnAfterClose() { } #endregion private void GetGodBeast()//存储神兽强化列表数据和排序 { GodBeastList.Clear(); var DogzEquipDict = dogz_model.dogzAssistStateDict; foreach (var key in DogzEquipDict.Keys) { if (DogzEquipDict[key] == 1) { GodBeastClass godBeastClass = new GodBeastClass(); List<ItemModel> itemModel = dogz_model.GetDogzEquips(key); for (int i = 0; i < itemModel.Count; i++) { godBeastClass.GodBeastNumber = key; godBeastClass.GodBeastPart = itemModel[i].EquipPlace; godBeastClass.GodBeastQuality = itemModel[i].chinItemModel.ItemColor; godBeastClass.GodBeastStar = itemModel[i].chinItemModel.StarLevel; var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度] godBeastClass.GodBeastLv = IudetDogzEquipPlus[0]; godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1]; godBeastClass.LocationMarker= key*10+ itemModel[i].EquipPlace; GodBeastList.Add(godBeastClass); } } } GodBeastList.Sort(Compare); } int Compare(GodBeastClass x, GodBeastClass y) { if (x.GodBeastQuality.CompareTo(y.GodBeastQuality) != 0)//品质 { return -x.GodBeastQuality.CompareTo(y.GodBeastQuality); } if (x.GodBeastStar.CompareTo(y.GodBeastStar) != 0)//星级 { return -x.GodBeastStar.CompareTo(y.GodBeastStar); } if (x.GodBeastPart.CompareTo(y.GodBeastPart) != 0)//装备位 { return x.GodBeastPart.CompareTo(y.GodBeastPart); } if (x.GodBeastLv.CompareTo(y.GodBeastLv) != 0)//强化等级 { return -x.GodBeastLv.CompareTo(y.GodBeastLv); } if (x.GodBeasProficiency.CompareTo(y.GodBeasProficiency) != 0)//熟练度 { return -x.GodBeasProficiency.CompareTo(y.GodBeasProficiency); } return 1; } void OnCreateGridLineCell(ScrollerController gridCtrl) { gridCtrl.Refresh(); if (GodBeastList.Count > 0) { m_Listprompt_Text.SetActive(false); } else { m_Listprompt_Text.SetActive(true); } for (int i = 0; i < GodBeastList.Count; i++) { int locationMarker = GodBeastList[i].LocationMarker; gridCtrl.AddCell(ScrollerDataType.Header, locationMarker); } gridCtrl.Restart(); } private void OnRefreshGridCell(ScrollerDataType type, CellView cell) { GodBeastEntry godBeastEntry = cell.GetComponent<GodBeastEntry>(); int locationMarker = cell.index; } } } System/Strengthening/GodBeastReinforcementWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 69585e30fb1796b42b2b119b864f6776 timeCreated: 1534421646 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Strengthening/GodBeastSlidingList.cs
New file @@ -0,0 +1,142 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, August 17, 2018 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; //神兽强化右侧材料吸收列表 namespace Snxxz.UI { public class GodBeastSlidingList:MonoBehaviour { [SerializeField] ScrollerController m_ScrollerController; [SerializeField] Text m_Label; [SerializeField] Button m_Arrow; [SerializeField] GameObject m_ScrollViewFirst; [SerializeField] Button m_ButtonAll;//所有 [SerializeField] Button m_ButtonCrystal;//水晶 [SerializeField] Button m_ButtonBlue;//蓝 [SerializeField] Button m_ButtonPurple;//紫色 [SerializeField] Button m_ButtonOrange;//橙色 [SerializeField] Toggle m_ToggleAll; public int LINE = 10; private int Quality = 10; private void Start() { m_Arrow.AddListener(OnClickArrow); m_ButtonAll.AddListener(()=>{ OnClickSwith(10); }); m_ButtonCrystal.AddListener(() => { OnClickSwith(1);}); m_ButtonBlue.AddListener(() => { OnClickSwith(2); }); m_ButtonPurple.AddListener(() => { OnClickSwith(3); }); m_ButtonOrange.AddListener(() => { OnClickSwith(4); }); m_ToggleAll.onValueChanged.AddListener(OnClickToggle); } private void OnEnable() { } private void OnDisable() { } public void Init() { Quality = 10; ContentSelect(Quality); if (m_ScrollViewFirst.activeSelf) { m_ScrollViewFirst.SetActive(false); } if (m_ToggleAll.isOn) { m_ToggleAll.isOn = false; } m_ScrollerController.OnRefreshCell += OnRefreshGridCell; OnCreateGridLineCell(m_ScrollerController); } public void Unit() { m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; } private void OnClickArrow() { m_ScrollViewFirst.SetActive(!m_ScrollViewFirst.activeSelf); } private void OnClickToggle(bool IsBool) { } private void OnClickSwith(int Type) { Quality = Type; if (m_ScrollViewFirst.activeSelf) { m_ScrollViewFirst.SetActive(false); } ContentSelect(Quality); } private void ContentSelect(int Type) { switch (Type) { case 1: m_Label.text = "强化水晶"; break; case 2: m_Label.text = "蓝色以下"; break; case 3: m_Label.text = "紫色以下"; break; case 4: m_Label.text = "橙色以下"; break; case 10: m_Label.text = "全部"; break; default: break; } } void OnCreateGridLineCell(ScrollerController gridCtrl) { gridCtrl.Refresh(); int code = 0; for (code = 0; code < LINE; code++) { gridCtrl.AddCell(ScrollerDataType.Header, code); } gridCtrl.Restart(); } private void OnRefreshGridCell(ScrollerDataType type, CellView cell) { int gridlineIndex = cell.index; int childCode = 0; for (childCode = 0; childCode < cell.transform.childCount; childCode++) { ChildNodes _ChildNodes = cell.transform.GetChild(childCode).GetComponent<ChildNodes>(); _ChildNodes._ItemIcon.SetActive(false); _ChildNodes._Elect.SetActive(false); int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1); if (cellCount - 1 < 1) { } } } } } System/Strengthening/GodBeastSlidingList.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: e770376f004aa1143bcd9613fa087f12 timeCreated: 1534485389 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: