| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, November 07, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class MapLineBehaviour : MonoBehaviour |
| | | { |
| | | [SerializeField] Button m_Select; |
| | | [SerializeField] Text m_Title; |
| | | |
| | | MapModel m_Model; |
| | | MapModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<MapModel>()); } } |
| | | |
| | | int lineId = 0; |
| | | Transform m_ContainerLines; |
| | | |
| | | public void Display(int _lineId, Transform _parent) |
| | | { |
| | | lineId = _lineId; |
| | | m_Title.text = Language.Get("line", _lineId + 1); |
| | | m_ContainerLines = _parent; |
| | | } |
| | | |
| | | private void Awake() |
| | | { |
| | | m_Select.AddListener(SelectLine); |
| | | } |
| | | |
| | | private void SelectLine() |
| | | { |
| | | m_ContainerLines.gameObject.SetActive(false); |
| | | model.RequestSelectedLine(lineId); |
| | | |
| | | WindowCenter.Instance.Close<WorldMapWin>(); |
| | | WindowCenter.Instance.Close<LocalMapWin>(); |
| | | WindowCenter.Instance.Open<MainInterfaceWin>(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, November 07, 2017
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class MapLineBehaviour : ScrollItem
|
| | | {
|
| | | [SerializeField] Button m_Select;
|
| | | [SerializeField] Text m_Title;
|
| | |
|
| | | MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | |
|
| | | MapLine line;
|
| | |
|
| | | public override void Display(object _data)
|
| | | {
|
| | | base.Display(_data);
|
| | |
|
| | | line = (MapLine)_data;
|
| | |
|
| | | var grabBossLine = 0;
|
| | | if (fairyGrabBossModel.TryGetFairyGrabBossLine(out grabBossLine) && line.lineIndex == grabBossLine + 1)
|
| | | {
|
| | | m_Title.text = Language.Get("FairyGrabBossLine");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Title.text = Language.Get("line", line.lineIndex);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Dispose()
|
| | | {
|
| | | base.Dispose();
|
| | | }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.AddListener(SelectLine);
|
| | | }
|
| | |
|
| | | private void SelectLine()
|
| | | {
|
| | | model.RequestSelectedLine(line.lineIndex - 1);
|
| | |
|
| | | WindowCenter.Instance.Close<WorldMapWin>();
|
| | | WindowCenter.Instance.Close<LocalMapWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|