Example #1
0
    private void _onLoginButtonClick()
    {
        if (m_edit_account.text == string.Empty)
        {
            UI_MessageBox.Show(Locale.Instance["Login@PleaseInputAccount"]);
            return;
        }
        if (m_edit_password.text == string.Empty)
        {
            UI_MessageBox.Show(Locale.Instance["Login@PleaseInputPassword"]);
            return;
        }
        CG_LoginRequestMsg msg = new CG_LoginRequestMsg();

        msg.PlatformID     = 0;
        msg.PlayerName     = m_edit_account.text;
        msg.PlayerPassword = m_edit_password.text;
        var bt = Encoding.UTF8.GetBytes(UnityEngine.SystemInfo.deviceUniqueIdentifier);

        msg.Mac      = BitConverter.ToUInt64(bt, 0);
        msg.Md5      = MD5Helper.GetMD5Hash(bt);
        msg.NameType = 0;
        msg.Version  = 17696793;
        NetManager.Instance.SendMsg(msg);
        LoginSystem.Instance.CurAccount  = msg.PlayerName;
        LoginSystem.Instance.CurPassword = msg.PlayerPassword;
        WaitForResponse.Retain();
    }
Example #2
0
        private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_LoginFailedMsg _msg)
        {
            switch ((GC_LoginFailedMsg.ReasonInfo)_msg.Reason)
            {
            case GC_LoginFailedMsg.ReasonInfo.RET_SUCCESS:
            case GC_LoginFailedMsg.ReasonInfo.RET_SUCCESS_WITH_ITEM:
                break;

            case GC_LoginFailedMsg.ReasonInfo.ERROR_HAS_LOGINED:
            {
                string tip = Locale.Instance[string.Format("Login@{0}", (GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString()];
                NetManager.Instance.RequestDisConnect();
                UI_MessageBox.Show(tip, Locale.Instance["Common@Confirm"], Locale.Instance["Common@Cancel"], () =>
                    {
                        SignalSystem.FireSignal(SignalId.Login_ForceLogin);
                    });
            }
            break;

            default:
            {
                string tip = Locale.Instance[string.Format("Login@{0}", (GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString()];
                if (tip == string.Empty)
                {
                    UI_MessageBox.Show(((GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString());
                }
                else
                {
                    UI_MessageBox.Show(tip);
                }
            }
            break;
            }
            WaitForResponse.Release();
        }
    //------------------------------------------------------------------------------------------------------------------
    void Start()
    {
        m_damageNumbersManager = ScriptableObject.CreateInstance <UI_DamageNumbersManager>();
        m_damageNumbersManager.Initialize();

        m_healthBars = ScriptableObject.CreateInstance <UI_HealthBars>();
        m_healthBars.Initialize();

        m_playerHUD = ScriptableObject.CreateInstance <UI_PlayerHUD>();
        m_playerHUD.Initialize();

        m_miniMap = ScriptableObject.CreateInstance <UI_MiniMap>();
        m_miniMap.Initialize();

        m_messageBox = ScriptableObject.CreateInstance <UI_MessageBox>();
        m_messageBox.Initialize();

        m_deadScreen = ScriptableObject.CreateInstance <UI_DeadScreen>();
        m_deadScreen.Initialize();

        m_mainMenuScreen = ScriptableObject.CreateInstance <UI_MainMenuScreen>();
        m_mainMenuScreen.Initialize();

        m_statisticsScreen = ScriptableObject.CreateInstance <UI_StatisticsScreen>();
        m_statisticsScreen.Initialize();
    }
Example #4
0
        private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_LoginOKNoPlayer _msg)
        {
            WaitForResponse.Release();
            UI_MessageBox.Show(Locale.Instance["Login@NoPlayer"]);

            //登陆成功后更新本地配置中的账户名
            LocalConfigSystem.Instacne.UpdateCurAccount(CurAccount);
            LocalConfigSystem.Instacne.Update("CurrentPassword", CurPassword);
        }
Example #5
0
    public void Buy()
    {
        if (spice[Index] > minecraft_scroce)
        {
            UI_MessageBox.SetActive(true);
            UIBuy.SetActive(false);
            return;
        }

        UIBuy.SetActive(false);

        ItemsCount[Index]++;


        minecraft_scroce  -= spice[Index];
        Get_minecraft.text = minecraft_scroce.ToString();
    }
Example #6
0
        /// <summary>
        ///     更新下载失败提示(包括部分失败)
        /// </summary>
        private void showDownloadFailTip()
        {
            String tip = String.Format(Locale.Instance["Download@Continue"], (float)(mUpdateTotalSize - mDownloadedSize) / 1024f / 1024f);

            UI_MessageBox.Show(tip, Locale.Instance["Common@Confirm"], Locale.Instance["Common@Cancel"], () => { StartCoroutine(downloadRes()); });
        }
Example #7
0
 /// <summary>
 ///     显示检查更新失败提示
 /// </summary>
 private void showCheckUpdateFailTip()
 {
     UI_MessageBox.Show(Locale.Instance["Download@Error"], Locale.Instance["Common@Confirm"], () => { StartCoroutine(checkUpdate()); });
 }
Example #8
0
 /// <summary>
 /// 摩法藥水不足提示窗
 /// </summary>
 public void insufficient()
 {
     UI_MessageBox.SetActive(false);
 }
Example #9
0
 public static void ShowSelectMsgBox(string _tip, string _button1_tip, string _button2_tip, Action _button1_action, Action _button2_action, Action _close_action)
 {
     UI_MessageBox.Show(_tip, _button1_tip, _button2_tip, _button1_action, _button2_action, _close_action);
 }
Example #10
0
 public static void ShowSingleMsgBox(string _tip, string _button_tip, Action _button_action, Action _close_action)
 {
     UI_MessageBox.Show(_tip, _button_tip, _button_action, _close_action);
 }