wangguan
2020-10-27 1cc976d33bfbe7488c85df9d35f28aa6e4360294
Assets/Scripts/GameAnalytics_SDK/UI/LoginUI.cs
@@ -19,20 +19,22 @@
    void Start()
    {
        GA_SDK_Manager.Ins.SDKInit(ChannelID.Gm.ToString());
        GA_SDK_Manager.Ins.Statistics(1);//成功加载登陆界面的人数
        isLogining = false;
        transform.Find("Panel/Button").GetComponent<Button>().onClick.AddListener(OnClickLoginBtn);
        // if (Application.platform == RuntimePlatform.Android)
        // {
        //     GetetDeviceIMEI();//获取安卓手机IMEI
        // }
        // else if (Application.platform == RuntimePlatform.WindowsEditor)
        // {
        //     imei0 = "MyTestGemBattle1";
        // }
        if (Application.platform == RuntimePlatform.Android)
        {
            //GetetDeviceIMEI();//获取安卓手机IMEI
            imei0 = GA_SDK_Manager.Ins.GetDeviceId();//使用设备ID
        }
        else if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            imei0 = "MyTestGemBattle123";
        }
        imei0 = GA_SDK_Manager.Ins. GetDeviceId();//使用设备ID
    }
@@ -69,8 +71,8 @@
    private void OnClickLoginBtn()
    {
        Debug.Log("登录");
        LoginRequest();
        GA_SDK_Manager.Ins.Statistics(2);//埋点
    }
@@ -82,6 +84,19 @@
    {
        if (!isLogining)
        {
            Debug.Log("登录");
            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                Debug.Log("编辑器直接登录");
                GA_SDK_Manager.Ins.Login(imei0);
                GA_SDK_Manager.Ins.Statistics(3);//埋点
                //StartCoroutine(loginMy());
                StartCoroutine(LoadScene());
                return;
            }
            isLogining = true;
            string url = GameConfig.IsDebug ? GameConfig.TestLoginUrl : GameConfig.LoginUrl;
            JsonData data = new JsonData();
@@ -163,9 +178,11 @@
        if (login.Errorcode == 0)
        {
            Debug.Log("--------------------- 登录成功 ---------------------");
            UserDataMsg userData = login.Userdata;
            //UserDataMsg userData = login.Userdata;
            GA_SDK_Manager.Ins.Login(imei0);
            GA_SDK_Manager.Ins.Statistics(3);//埋点
            //StartCoroutine(loginMy());
            StartCoroutine(LoadScene());