| | |
| | | m_Father: {fileID: 0} |
| | | m_RootOrder: 1 |
| | | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} |
| | | --- !u!1 &1037195905 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | serializedVersion: 6 |
| | | m_Component: |
| | | - component: {fileID: 1037195907} |
| | | - component: {fileID: 1037195906} |
| | | m_Layer: 0 |
| | | m_Name: SDKCallBack |
| | | m_TagString: Untagged |
| | | m_Icon: {fileID: 0} |
| | | m_NavMeshLayer: 0 |
| | | m_StaticEditorFlags: 0 |
| | | m_IsActive: 1 |
| | | --- !u!114 &1037195906 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 1037195905} |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 0639fa72bc8665d4faaed2dfea0c467b, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | list_callBackName: [] |
| | | --- !u!4 &1037195907 |
| | | Transform: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 1037195905} |
| | | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
| | | m_LocalPosition: {x: 523.2839, y: 426.2466, z: -525.2014} |
| | | m_LocalScale: {x: 1, y: 1, z: 1} |
| | | m_Children: [] |
| | | m_Father: {fileID: 0} |
| | | m_RootOrder: 5 |
| | | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| | | --- !u!1 &1234802519 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | //transform.Find("Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnClickResetBtn); |
| | | |
| | | |
| | | if (Application.platform == RuntimePlatform.Android) |
| | | { |
| | | //GetetDeviceIMEI();//获取安卓手机IMEI |
| | | imei0 = TDAA_SDKManager.Ins.GetDeviceId();//使用设备ID |
| | | } |
| | | else if (Application.platform == RuntimePlatform.WindowsEditor) |
| | | { |
| | | imei0 = "MyTestGemBattle123"; |
| | | } |
| | | |
| | | GameConfig.PlayerName = imei0; |
| | | |
| | | versionTxt.text = "版本号:" + Application.version; |
| | | //resVersion.text 暂时没有使用 |
| | | transform.Find("Panel/PlayerID").GetComponent<Text>().text = "玩家ID:" + imei0; |
| | | |
| | | |
| | | |
| | | if (!GameConfig.isFirstStart)//后续直接加载 |
| | |
| | | |
| | | void loginNext() |
| | | { |
| | | //if (Application.platform == RuntimePlatform.Android) |
| | | //{ |
| | | // //GetetDeviceIMEI();//获取安卓手机IMEI |
| | | // imei0 = TDAA_SDKManager.Ins.GetDeviceId();//使用设备ID |
| | | //} |
| | | //else if (Application.platform == RuntimePlatform.WindowsEditor) |
| | | //{ |
| | | // imei0 = "MyTestGemBattle123"; |
| | | //} |
| | | |
| | | GameConfig.PlayerName = SDKManager.ins.sdk.uid; |
| | | |
| | | versionTxt.text = "版本号:" + Application.version; |
| | | //resVersion.text 暂时没有使用 |
| | | transform.Find("Panel/PlayerID").GetComponent<Text>().text = "玩家ID:" + SDKManager.ins.sdk.uid; |
| | | |
| | | progressSlider.gameObject.SetActive(true); |
| | | startBtn.gameObject.SetActive(false); |
| | | |
| | |
| | | { |
| | | public class BaseSdk |
| | | { |
| | | public string uid = ""; |
| | | public virtual void changeAccount() |
| | | { |
| | | throw new System.NotImplementedException(); |
| | |
| | | |
| | | public void Awake() |
| | | { |
| | | DontDestroyOnLoad(this); |
| | | ins = this; |
| | | SDKManager.ins.sdk.setCallBackClazz("SDKCallBack", "AndroidCallBack"); |
| | | // 在这里开始初始化SDK |
| | |
| | | |
| | | if (data.ContainsKey("action")) |
| | | { |
| | | // data.data.openid |
| | | // { "code":200,"msg":"success","data":{ "is_certify":0,"age":0,"openid":"1000484"} } |
| | | |
| | | //{ "action":"login", "data":{ "code":200,"msg":"success","data":{ "is_certify":0,"age":0,"openid":"1000485"} } } |
| | | string act = data["action"].ToString(); |
| | | Debug.Log(act); |
| | | if(act == "login") |
| | | { |
| | | LoginResult(act); |
| | | JsonData loginData = data["data"]; |
| | | if ((int)loginData["code"] == 200) |
| | | { |
| | | string uid = loginData["data"]["openid"].ToString(); |
| | | SDKManager.ins.sdk.uid = (string)uid; |
| | | LoginResult(act); |
| | | } |
| | | else |
| | | { |
| | | // 登录失败则直接重新拉起 |
| | | SDKManager.ins.sdk.login(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | public override void login() |
| | | { |
| | | Debug.Log("模拟PC登录游戏"); |
| | | SDKCallBack.ins.AndroidCallBack("{\"action\":\"login\"}"); |
| | | SDKCallBack.ins.AndroidCallBack("{\"action\":\"login\",\"data\":{ \"code\":200,\"msg\":\"success\",\"data\":{ \"is_certify\":0,\"age\":0,\"openid\":\"1000484\"} }}"); |
| | | } |
| | | |
| | | public override void logout() |
| | |
| | | DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10); |
| | | |
| | | root = new GameObject("ManagerRoot"); |
| | | root.AddComponent<SDKCallBack>(); |
| | | root.AddComponent<DoNotDestory>(); |
| | | root.AddComponent<MasterSocket>(); |
| | | root.AddComponent<TDAA_SDKManager>(); |