少年修仙传客户端代码仓库
client_linchunjie
2018-08-27 d106f11e7f44c748f595da36e0cdfd54849649e6
Core/GameEngine/DataToCtl/RoleLoginState.cs
@@ -3,51 +3,51 @@
using UnityEngine;
using Snxxz.UI;
public class RoleLoginState : NetState
{
public class RoleLoginState : NetState
{
    const int OVERTIME_THRESHOLD_1 = 20;
    const int OVERTIME_THRESHOLD_2 = 10;
    float timer1 = 0f;
    float timer2 = 0f;
    public override void OnEnter()
    {
        base.OnEnter();
        timer1 = 0f;
        timer2 = 0f;
    public override void OnEnter()
    {
        base.OnEnter();
        timer1 = 0f;
        timer2 = 0f;
    }
    protected override void Update()
    {
        if (GameNetSystem.Instance.netState != GameNetSystem.NetState.RoleLogin)
        {
            return;
        }
        timer1 += Time.deltaTime;
        if (timer1 > OVERTIME_THRESHOLD_1)
        {
            GameNetSystem.Instance.Disconnect();
            WindowCenter.Instance.Open<DisconnectHintWin>();
        }
        if (StageManager.Instance.isServerPreparing)
        {
            return;
        }
        timer2 += Time.deltaTime;
        if (timer2 > OVERTIME_THRESHOLD_2)
        {
            GameNetSystem.Instance.Disconnect();
            WindowCenter.Instance.Open<DisconnectHintWin>();
        }
    protected override void Update()
    {
        if (GameNetSystem.Instance.netState != GameNetSystem.NetState.RoleLogin)
        {
            return;
        }
        timer1 += Time.deltaTime;
        if (timer1 > OVERTIME_THRESHOLD_1)
        {
            GameNetSystem.Instance.Disconnect();
            WindowCenter.Instance.Open<DisconnectHintWin>();
        }
        if (StageManager.Instance.isServerPreparing)
        {
            return;
        }
        timer2 += Time.deltaTime;
        if (timer2 > OVERTIME_THRESHOLD_2)
        {
            GameNetSystem.Instance.Disconnect();
            WindowCenter.Instance.Open<DisconnectHintWin>();
        }
    }
    public override void OnExit()
    {
        base.OnExit();
    public override void OnExit()
    {
        base.OnExit();
    }
}