少年修仙传客户端代码仓库
client_Hale
2019-04-11 9f89e3be35da42eb9ccb44e6589d62f320aa444c
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, September 05, 2017
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
 
    public class SelectRoleWin : Window
    {
        [SerializeField] Text m_PlayerName;
        [SerializeField] Text m_PlayerLevel;
 
        [SerializeField] Button m_Begin;
        [SerializeField] Button m_Back;
 
        [SerializeField] Image m_Description;
        [SerializeField] Image m_JobName;
        [SerializeField] Image m_JobSign;
 
        SelectRoleProcessor m_SelectRoleProcessor;
        SelectRoleProcessor selectRoleProcessor {
            get {
                if (m_SelectRoleProcessor == null)
                {
                    m_SelectRoleProcessor = GameObject.FindObjectOfType<SelectRoleProcessor>();
                }
 
                return m_SelectRoleProcessor;
            }
        }
 
        LoginModel model { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
 
        #region Built-in
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
            m_Begin.onClick.AddListener(BeginBtn);
            m_Back.onClick.AddListener(BackToLogin);
        }
 
        private void BackToLogin()
        {
            GameNetSystem.Instance.LoginOut();
        }
 
        protected override void OnPreOpen()
        {
            InitInfo();
        }
 
        protected override void OnAfterOpen()
        {
        }
 
        protected override void OnPreClose()
        {
        }
 
        protected override void OnAfterClose()
        {
            selectRoleProcessor.Dispose();
        }
        #endregion
 
        private void BeginBtn()
        {
            if (GameNetSystem.Instance.netState == GameNetSystem.NetState.Connected)
            {
                return;
            }
 
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                ConfirmCancel.ShowPopConfirm(
                    Language.Get("Mail101"),
                    Language.Get("L1116")
                    );
 
                NetLinkWin.Hide();
                return;
            }
 
            LoadingWin.targetMapResId = 2;
            WindowCenter.Instance.Open<LoadingWin>();
            model.EnterWorld(2);
        }
 
        private void InitInfo()
        {
            if (PlayerDatas.Instance.loginInfo == null)
            {
                return;
            }
 
            m_PlayerName.text = PlayerDatas.Instance.loginInfo.PlayerName.ToString();//玩家昵称
            m_PlayerLevel.text = Language.Get("Z1024", PlayerDatas.Instance.loginInfo.LV);//玩家等级
            var config = CreateRoleConfig.Get(PlayerDatas.Instance.loginInfo.Job);
            m_Description.SetSprite(config.description);
            m_JobName.SetSprite(config.jobName);
            m_JobSign.SetSprite(config.jobSign);
 
            selectRoleProcessor.Show(PlayerDatas.Instance.loginInfo.Job);
        }
 
    }
 
}