wangguan
2020-11-04 2ae9edd5bfd8b8baabb8cd995485f9ade4faebc9
Assets/Scripts/GameAnalytics_SDK/UI/LoginUI.cs
@@ -18,21 +18,24 @@
    // Start is called before the first frame update
    void Start()
    {
        GA_SDK_Manager.Ins.SDKInit(ChannelID.Gm.ToString());
        TDAA_SDKManager.Ins.SDKInit(ChannelID.Gm.ToString());
        TDAA_SDKManager.Ins.Statistics(1);//成功加载登陆界面的人数
        isLogining = false;
        transform.Find("Panel/Button").GetComponent<Button>().onClick.AddListener(OnClickLoginBtn);
        transform.Find("Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnClickResetBtn);
        // if (Application.platform == RuntimePlatform.Android)
        // {
        //     GetetDeviceIMEI();//获取安卓手机IMEI
        // }
        // else if (Application.platform == RuntimePlatform.WindowsEditor)
        // {
        //     imei0 = "MyTestGemBattle1";
        // }
        if (Application.platform == RuntimePlatform.Android)
        {
            //GetetDeviceIMEI();//获取安卓手机IMEI
            imei0 = TDAA_SDKManager.Ins.GetDeviceId();//使用设备ID
        }
        else if (Application.platform == RuntimePlatform.WindowsEditor)
        {
            imei0 = "MyTestGemBattle123";
        }
        imei0 = GA_SDK_Manager.Ins. GetDeviceId();//使用设备ID
    }
@@ -67,11 +70,29 @@
    #endregion
    private void OnClickResetBtn()
    {
        Debug.LogError("清空了所有数据");
        PlayerPrefs.DeleteAll();
        TDAA_SDKManager.Ins.Reset();
    }
    private void OnClickLoginBtn()
    {
        Debug.Log("登录");
        LoginRequest();
        if (!isLogining)
        {
            AudioSourceManager.Ins.Play(AudioEnum.UI);
            TDAA_SDKManager.Ins.Statistics(2);//埋点
            //StartCoroutine(loginMy());
            StartCoroutine(LoadScene());
        }else{
        }
        //TDAA_SDKManager.Ins.Statistics(2);//埋点
        //LoginRequest();
    }
    /// <summary>
@@ -82,6 +103,19 @@
    {
        if (!isLogining)
        {
            Debug.Log("登录");
            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                Debug.Log("编辑器直接登录");
                //TDAA_SDKManager.Ins.Login();
                //TDAA_SDKManager.Ins.Statistics(3);//埋点
                //StartCoroutine(loginMy());
                StartCoroutine(LoadScene());
                return;
            }
            isLogining = true;
            string url = GameConfig.IsDebug ? GameConfig.TestLoginUrl : GameConfig.LoginUrl;
            JsonData data = new JsonData();
@@ -163,9 +197,11 @@
        if (login.Errorcode == 0)
        {
            Debug.Log("--------------------- 登录成功 ---------------------");
            UserDataMsg userData = login.Userdata;
            //UserDataMsg userData = login.Userdata;
            GA_SDK_Manager.Ins.Login(imei0);
            //TDAA_SDKManager.Ins.Login();
            //TDAA_SDKManager.Ins.Statistics(3);//埋点
            //StartCoroutine(loginMy());
            StartCoroutine(LoadScene());