| | |
| | | using UnityEngine.Networking; |
| | | using Protobuf; |
| | | using Google.Protobuf; |
| | | using DG.Tweening; |
| | | |
| | | public class LoginUI : MonoBehaviour |
| | | { |
| | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | |
| | | AudioSourceManager.Ins.Play(AudioEnum.BGM1); |
| | | EventCenter.Ins.RemoveAllListener(); |
| | | |
| | | isLogining = false; |
| | |
| | | |
| | | //transform.Find("Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnClickResetBtn); |
| | | |
| | | |
| | | if (Application.platform == RuntimePlatform.Android) |
| | | { |
| | | //GetetDeviceIMEI();//获取安卓手机IMEI |
| | |
| | | imei0 = "MyTestGemBattle123"; |
| | | } |
| | | |
| | | GameConfig.PlayerName = imei0; |
| | | |
| | | versionTxt.text = "版本号:" + Application.version; |
| | | //resVersion.text 暂时没有使用 |
| | | transform.Find("Panel/PlayerID").GetComponent<Text>().text = "玩家ID:" + imei0; |
| | |
| | | |
| | | if (!GameConfig.isFirstStart)//后续直接加载 |
| | | { |
| | | OnClickLoginBtn(); |
| | | waitTime = 2f; |
| | | |
| | | loginNext(); |
| | | } |
| | | else |
| | | { |
| | | waitTime = 0f; |
| | | //第一次启动,初始化并且埋点 |
| | | TDAA_SDKManager.Ins.SDKInit(ChannelID.Gm.ToString()); |
| | | TDAA_SDKManager.Ins.Statistics(1);//成功加载登陆界面的人数 |
| | | //TDAA_SDKManager.Ins.SDKInit(ChannelID.Gm.ToString()); |
| | | //TDAA_SDKManager.Ins.Statistics(1);//成功加载登陆界面的人数 |
| | | } |
| | | } |
| | | |
| | | void loginNext() |
| | | { |
| | | progressSlider.gameObject.SetActive(true); |
| | | startBtn.gameObject.SetActive(false); |
| | | |
| | | AudioSourceManager.Ins.Play(AudioEnum.UI); |
| | | TDAA_SDKManager.Ins.Statistics(2);//埋点 |
| | | |
| | | GameConfig.isFirstStart = false; |
| | | StartCoroutine(loginMy()); |
| | | } |
| | | |
| | | float waitTime; |
| | | |
| | | // private void OnEnable() |
| | | // { |
| | |
| | | { |
| | | if (!isLogining) |
| | | { |
| | | progressSlider.gameObject.SetActive(true); |
| | | startBtn.gameObject.SetActive(false); |
| | | // CoderM: 在这里要使用SDK来进行登录了 |
| | | SDKCallBack.ins.setNextAction("login", loginNext); |
| | | SDKManager.ins.sdk.login(); |
| | | |
| | | AudioSourceManager.Ins.Play(AudioEnum.UI); |
| | | TDAA_SDKManager.Ins.Statistics(2);//埋点 |
| | | //progressSlider.gameObject.SetActive(true); |
| | | //startBtn.gameObject.SetActive(false); |
| | | |
| | | GameConfig.isFirstStart = false; |
| | | StartCoroutine(loginMy()); |
| | | //AudioSourceManager.Ins.Play(AudioEnum.UI); |
| | | //TDAA_SDKManager.Ins.Statistics(2);//埋点 |
| | | |
| | | //GameConfig.isFirstStart = false; |
| | | //StartCoroutine(loginMy()); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | IEnumerator loginMy() |
| | | { |
| | | progressSlider.value = 0.0f; |
| | | System.GC.Collect(); |
| | | DOTween.Clear(); |
| | | Debug.Log("开始清理GC,清理DOTween"); |
| | | yield return new WaitForSeconds(waitTime); |
| | | int displayProgress = 0; |
| | | int toProgress = 0; |
| | | AsyncOperation op = SceneManager.LoadSceneAsync("Endless2D"); |