Exemple #1
0
    public override void HandleNotification(INotification notification)
    {
        switch (notification.Name)
        {
        case NotificationName.MSG_GRPC_SERVERLIST_BACK:
            SetBaseData();
            if (!m_LoginProxy.HasLastLoginServer() && PlayerPrefs.GetString(GameConstant.FIRSTLOGIN) == "1")
            {
                GetGameObject().SetActive(false);
                UIManager.Instance.OpenPanel(UIPanel.ServerListPanel);
            }
            break;

        case NotificationName.MSG_CHARACTER_LIST_GETED:
            UIManager.Instance.ClosePanel(this);
            UIManager.Instance.OpenPanel(UIPanel.CharacterPanel);
            break;

        case NotificationName.MSG_LOGINPANEL_ACTIVE:
            GetGameObject().SetActive(true);
            break;

        case NotificationName.SOCKETCONNECTFAIL:
            m_CanvasGroup.interactable = true;
            UIManager.Instance.StartCoroutine(Excute(Time.deltaTime, () =>
            {
                m_BtnLogin.GetComponent <Animator>().SetTrigger("Normal");
            }));
            break;

        case NotificationName.MSG_LOGINWAITSHOW:
            m_LoadingObj.SetActive((bool)notification.Body);
            break;

        default:
            break;
        }
    }