| | |
| | | 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 |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | private void OnClickLoginBtn() |
| | | { |
| | | Debug.Log("登录"); |
| | | LoginRequest(); |
| | | GA_SDK_Manager.Ins.Statistics(2);//埋点 |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | 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(); |
| | |
| | | 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()); |
| | | |