| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, October 25, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class DungeonDifficultySelectBehaviour : ScrollItem |
| | | { |
| | | |
| | | [SerializeField] ToggleButton m_Select; |
| | | [SerializeField] ImageEx m_Icon; |
| | | [SerializeField] Transform m_ContainerLock; |
| | | [SerializeField] Text m_Index; |
| | | [SerializeField] Text m_UnLockTitle; |
| | | [SerializeField] Text m_UnLockLevel; |
| | | [SerializeField] Material m_MaterialNormal; |
| | | [SerializeField] Material m_MaterialGray; |
| | | [SerializeField] FontColorSizeConfig m_TitleFontColorSize; |
| | | [SerializeField] FontColorSizeConfig m_FontColorSize; |
| | | |
| | | Dungeon dungeon; |
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | |
| | | public override void Display(object _data) |
| | | { |
| | | base.Display(_data); |
| | | dungeon = (Dungeon)_data; |
| | | |
| | | var config = ConfigManager.Instance.GetTemplate<DungeonConfig>(model.DungeonMap(dungeon.mapId, dungeon.lineId)); |
| | | m_Select.isOn = model.selectedKylinDungeon == dungeon; |
| | | |
| | | var playerLevel = PlayerDatas.Instance.baseData.LV; |
| | | var isUnLocked = playerLevel >= config.LVLimitMin; |
| | | m_Icon.material = isUnLocked ? m_MaterialNormal : m_MaterialGray; |
| | | m_ContainerLock.gameObject.SetActive(!isUnLocked); |
| | | |
| | | m_UnLockTitle.color = m_FontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color; |
| | | m_UnLockLevel.text = config.LVLimitMin.ToString(); |
| | | m_UnLockLevel.color = m_FontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color; |
| | | |
| | | m_Index.text = (dungeon.lineId + 1).ToString(); |
| | | m_Index.color = m_TitleFontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color; |
| | | |
| | | model.kylinDifficultySelectedEvent -= OnSelected; |
| | | model.kylinDifficultySelectedEvent += OnSelected; |
| | | } |
| | | |
| | | public override void Dispose() |
| | | { |
| | | base.Dispose(); |
| | | |
| | | model.kylinDifficultySelectedEvent -= OnSelected; |
| | | } |
| | | |
| | | private void SelectDifficulty() |
| | | { |
| | | model.selectedKylinDungeon = dungeon; |
| | | model.currentDungeon = dungeon; |
| | | } |
| | | |
| | | private void OnSelected(Dungeon _dungeon) |
| | | { |
| | | m_Select.isOn = dungeon == _dungeon; |
| | | } |
| | | |
| | | private void Awake() |
| | | { |
| | | m_Select.AddListener(SelectDifficulty); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, October 25, 2017
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class DungeonDifficultySelectBehaviour : ScrollItem
|
| | | {
|
| | |
|
| | | [SerializeField] ToggleButton m_Select;
|
| | | [SerializeField] ImageEx m_Icon;
|
| | | [SerializeField] Transform m_ContainerLock;
|
| | | [SerializeField] Text m_Index;
|
| | | [SerializeField] Text m_UnLockTitle;
|
| | | [SerializeField] Text m_UnLockLevel;
|
| | | [SerializeField] Material m_MaterialNormal;
|
| | | [SerializeField] Material m_MaterialGray;
|
| | | [SerializeField] FontColorSizeConfig m_TitleFontColorSize;
|
| | | [SerializeField] FontColorSizeConfig m_FontColorSize;
|
| | |
|
| | | Dungeon dungeon;
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | | dungeon = (Dungeon)_data;
|
| | |
|
| | | var config = DungeonConfig.Get(model.GetDungeonId(dungeon.mapId, dungeon.lineId));
|
| | | m_Select.isOn = model.selectedKylinDungeon == dungeon;
|
| | |
|
| | | var playerLevel = PlayerDatas.Instance.baseData.LV;
|
| | | var isUnLocked = playerLevel >= config.LVLimitMin;
|
| | | m_Icon.material = isUnLocked ? m_MaterialNormal : m_MaterialGray;
|
| | | m_ContainerLock.gameObject.SetActive(!isUnLocked);
|
| | |
|
| | | m_UnLockTitle.color = m_FontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color;
|
| | | m_UnLockLevel.text = config.LVLimitMin.ToString();
|
| | | m_UnLockLevel.color = m_FontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color;
|
| | |
|
| | | m_Index.text = (dungeon.lineId + 1).ToString();
|
| | | m_Index.color = m_TitleFontColorSize.GetColorSize(isUnLocked ? "Normal" : "Locked").color;
|
| | |
|
| | | model.kylinDifficultySelectedEvent -= OnSelected;
|
| | | model.kylinDifficultySelectedEvent += OnSelected;
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | |
|
| | | model.kylinDifficultySelectedEvent -= OnSelected;
|
| | | }
|
| | |
|
| | | private void SelectDifficulty()
|
| | | {
|
| | | model.selectedKylinDungeon = dungeon;
|
| | | model.currentDungeon = dungeon;
|
| | | }
|
| | |
|
| | | private void OnSelected(Dungeon _dungeon)
|
| | | {
|
| | | m_Select.isOn = dungeon == _dungeon;
|
| | | }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.AddListener(SelectDifficulty);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|