Пример #1
0
    private void BtnWXLoginOnClick()
    {
        // AudioManager.Instance.PlaySound("button");
        if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            string         acc            = SecurityUtils.AESEncrypt("WX-o2xMF1vxkphDaUP88lkypIYwN14E", kv[0], kv[1]);
            string         pwd            = SecurityUtils.AESEncrypt("123458", kv[0], kv[1]);
            LoginOperation loginOperation = new LoginOperation();
            LoginDto       loginDto       = loginOperation.regist(UnityEngine.Random.Range(1, 10000).ToString(), UnityEngine.Random.Range(1, 100000).ToString(), "123", "Default_" + UnityEngine.Random.Range(0, 7), "男", "123");

            if (loginDto != null)
            {
                //SaveLoginInfo();
                //登录成功 跳转场景
                PlayerCache.loginInfo = loginDto;
                UIManager.Instance.Clear();

                TcpSocketImpl.getInstance().init();
                ClientTcpIoMessage ioMessage = new ClientTcpIoMessage();
                ioMessage.methodName    = "";
                ioMessage.interfaceName = "";
                List <object> list = new List <object>(2);
                list.Add(loginDto.uid);
                list.Add(loginDto.secretKey);

                ioMessage.args = JsonMapper.ToJson(list);
                TcpSocketImpl.getInstance().async(ioMessage, 1, -100);
                XUIUtils.LoadSceneX((int)SceneType.Hall);
            }
        }
        else
        {
            loginByWX.LoginByWX();
        }
    }
Пример #2
0
    //public void DoStartCoroutine(IEnumerator coroutine)
    //{
    //    StartCoroutine(coroutine);
    //}
    //public void DoStartCoroutine(string coroutine,object value = null)
    //{
    //    StartCoroutine(coroutine, value);
    //}

    //public void DoStopCoroutine(IEnumerator coroutine)
    //{
    //    StopCoroutine(coroutine);
    //}

    //public void DoStopCoroutine(string coroutine)
    //{
    //    StopCoroutine(coroutine);
    //}
    public void OnApplicationQuit()
    {
        TcpSocketImpl.getInstance().close();
    }