| | |
| | | public class DogzPackWin : Window
|
| | | {
|
| | | [SerializeField] List<DogzEquip> m_DogzEquips;
|
| | | [SerializeField] List<Button> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<DogzUnEquip> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<Text> m_DogzUnEquipContents;
|
| | | [SerializeField] Image m_DogzHeadIcon;
|
| | | [SerializeField] Button m_CloseBtn;
|
| | |
| | | [SerializeField] ScrollerController m_PackController;
|
| | | [SerializeField] Button qualitySelectBtn;
|
| | | [SerializeField] Button starSelectBtn;
|
| | | [SerializeField] Transform qualityArrow;
|
| | | [SerializeField] Transform starArrow;
|
| | | [SerializeField] SortTable qualitySort;
|
| | | [SerializeField] SortTable starSort;
|
| | |
|
| | |
| | | playerPack.RefreshItemCountAct += RefreshDogzItemEvent;
|
| | | qualitySort.onSelectSortEvent += RefreshDogzSelectEvent;
|
| | | starSort.onSelectSortEvent += RefreshDogzSelectEvent;
|
| | | qualitySort.onSortCloseEvent += CloseQualitySort;
|
| | | starSort.onSortCloseEvent += CloseStarSort;
|
| | | dogzModel.SelectDogzItemQuality = 0;
|
| | | dogzModel.SelectDogzItemStart = 0;
|
| | |
|
| | | starSort.SetDefault();
|
| | | qualitySort.SetDefault();
|
| | | UpdateDogzEquip();
|
| | | UpdateDogzPack();
|
| | | starSort.gameObject.SetActive(false);
|
| | | qualitySort.gameObject.SetActive(false);
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | playerPack.RefreshItemCountAct -= RefreshDogzItemEvent;
|
| | | qualitySort.onSelectSortEvent -= RefreshDogzSelectEvent;
|
| | | starSort.onSelectSortEvent -= RefreshDogzSelectEvent;
|
| | | qualitySort.onSortCloseEvent -= CloseQualitySort;
|
| | | starSort.onSortCloseEvent -= CloseStarSort;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | ItemModel _data;
|
| | | int index = i;
|
| | | bool _equiped = dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, i+101, out _data);
|
| | | m_DogzUnEquipBtns[i].gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].RedpointBeh.redpointId = dogzModel.GetDogzEquipPlaceRedpointById(dogzModel.presentSelectDogz,i).id;
|
| | | m_DogzEquips[i].gameObject.SetActive(_equiped);
|
| | | if (_equiped)
|
| | | {
|
| | |
| | | m_DogzUnEquipContents[i].text = StringUtility.Contact(DogzModel.GetItemColorName(_itemColor),
|
| | | DogzModel.GetDogzPartNameByIndex(i));
|
| | | m_DogzUnEquipContents[i].color = UIHelper.GetUIColor(_itemColor);
|
| | | m_DogzUnEquipBtns[i].RemoveAllListeners();
|
| | | m_DogzUnEquipBtns[i].AddListener(() => { ClickEquipIndex(index); });
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.RemoveAllListeners();
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.AddListener(() => { ClickEquipIndex(index); });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickEquipIndex(int index)
|
| | | {
|
| | | dogzModel.GetDogzItemListByIndex(index);
|
| | | dogzModel.GetDogzItemListByIndex(dogzModel.presentSelectDogz,index);
|
| | | if(dogzModel.selectEquipPlacelist.Count > 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<SelectDogzItemWin>();
|
| | |
| | | private void GetEquipBtn()
|
| | | {
|
| | | //--界面跳转
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DogzDungeon);
|
| | | }
|
| | |
|
| | | private void ClickStarSelect()
|
| | | {
|
| | | starSort.gameObject.SetActive(!starSort.gameObject.activeInHierarchy);
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!starSort.gameObject.activeInHierarchy)
|
| | | {
|
| | | starSort.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickQualitySelect()
|
| | | {
|
| | | qualitySort.gameObject.SetActive(!qualitySort.gameObject.activeInHierarchy);
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!qualitySort.gameObject.activeInHierarchy)
|
| | | {
|
| | | qualitySort.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void CloseQualitySort()
|
| | | {
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | private void CloseStarSort()
|
| | | {
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class DogzUnEquip
|
| | | {
|
| | | [SerializeField] Button m_DogzUnEquipBtn;
|
| | | public Button DogzUnEquipBtn { get { return m_DogzUnEquipBtn; } }
|
| | | [SerializeField] RedpointBehaviour m_RedpointBeh;
|
| | | public RedpointBehaviour RedpointBeh { get { return m_RedpointBeh; } }
|
| | | }
|
| | | }
|
| | |
|