少年修仙传客户端代码仓库
leonard Wu
2018-08-09 1875ff6edde61f76e0f0cbe247244b04318fcd80
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//--------------------------------------------------------
//    [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>();
        }
 
    }
 
}