com.xd.sdk.account 6.29.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/Plugins/Android/libs/XDGAccount_7.0.0.aar +0 -0
  2. package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta → Plugins/Android/libs/XDGAccount_7.0.0.aar.meta} +2 -2
  3. package/Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar +0 -0
  4. package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java.meta → Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar.meta} +2 -2
  5. package/Plugins/Android/libs/XDGSupport_7.0.0.aar +0 -0
  6. package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java.meta → Plugins/Android/libs/XDGSupport_7.0.0.aar.meta} +2 -2
  7. package/Plugins/Android/libs.meta +1 -1
  8. package/Plugins/Android.meta +1 -1
  9. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +2 -8
  10. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +1 -1
  11. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK-Swift.h +329 -0
  12. package/Plugins/iOS/XDAccountSDK.framework/Headers/{TDSGlobalThirdPartyLoginManager.h.meta → XDAccountSDK-Swift.h.meta} +1 -1
  13. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +1 -2
  14. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +1 -1
  15. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +29 -43
  16. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +1 -1
  17. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountDefines.h +43 -0
  18. package/Plugins/iOS/XDAccountSDK.framework/Headers/{XDGPhoneAuthManager.h.meta → XDGAccountDefines.h.meta} +1 -1
  19. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +3 -3
  20. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +1 -1
  21. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +3 -0
  22. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +1 -1
  23. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +1 -1
  24. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +1 -1
  25. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +1 -1
  26. package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +1 -1
  27. package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
  28. package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +1 -1
  29. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  30. package/Plugins/iOS/XDAccountSDK.framework/{Headers/XDGRoleInfo.h.meta → Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo.meta} +1 -1
  31. package/{Mobile/Http.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project.meta} +1 -1
  32. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json +9 -0
  33. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json.meta +7 -0
  34. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  35. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc.meta +7 -0
  36. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  37. package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule.meta +7 -0
  38. package/{Mobile/Editor.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule.meta} +1 -1
  39. package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +1 -1
  40. package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +1 -1
  41. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
  42. package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +1 -1
  43. package/Plugins/iOS/XDAccountSDK.framework.meta +4 -4
  44. package/Plugins/iOS.meta +1 -1
  45. package/Plugins.meta +1 -1
  46. package/Runtime/Internal/IXDGAccount.Extended.cs +11 -0
  47. package/{Mobile/Http/XDGAccountHttpConfigMobile.cs.meta → Runtime/Internal/IXDGAccount.Extended.cs.meta} +1 -1
  48. package/Runtime/Internal/Mobile/AccountFeaturesImpl.cs +348 -0
  49. package/{Mobile/User/UserManagerMobile.cs.meta → Runtime/Internal/Mobile/AccountFeaturesImpl.cs.meta} +1 -1
  50. package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs +14 -0
  51. package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs.meta +3 -0
  52. package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs +37 -0
  53. package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs.meta +3 -0
  54. package/Runtime/Internal/Mobile/Http.meta +3 -0
  55. package/{Mobile.meta → Runtime/Internal/Mobile.meta} +1 -1
  56. package/Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs +168 -0
  57. package/{Mobile/Editor/XDAccountMobileProcessBuild.cs.meta → Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs.meta} +1 -1
  58. package/Runtime/Internal/Standalone/AccessToken.meta +8 -0
  59. package/Runtime/Internal/Standalone/AccountCell.cs +143 -0
  60. package/{Mobile/XDGAccountMobile.cs.meta → Runtime/Internal/Standalone/AccountCell.cs.meta} +1 -1
  61. package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs +461 -0
  62. package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs.meta +11 -0
  63. package/Runtime/Internal/Standalone/Auth/AppleAuth.cs +27 -0
  64. package/Runtime/Internal/Standalone/Auth/AppleAuth.cs.meta +11 -0
  65. package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs +27 -0
  66. package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs.meta +11 -0
  67. package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs +27 -0
  68. package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs.meta +11 -0
  69. package/Runtime/Internal/Standalone/Auth/GuestAuth.cs +22 -0
  70. package/Runtime/Internal/Standalone/Auth/GuestAuth.cs.meta +11 -0
  71. package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs +43 -0
  72. package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs.meta +11 -0
  73. package/Runtime/Internal/Standalone/Auth/SteamAuth.cs +90 -0
  74. package/Runtime/Internal/Standalone/Auth/SteamAuth.cs.meta +11 -0
  75. package/Runtime/Internal/Standalone/Auth/TapAuth.cs +72 -0
  76. package/Runtime/Internal/Standalone/Auth/TapAuth.cs.meta +11 -0
  77. package/Runtime/Internal/Standalone/Auth/WebAuth.cs +144 -0
  78. package/Runtime/Internal/Standalone/Auth/WebAuth.cs.meta +11 -0
  79. package/Runtime/Internal/Standalone/Auth.meta +8 -0
  80. package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs +15 -0
  81. package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs.meta +11 -0
  82. package/Runtime/Internal/Standalone/Compliance.meta +8 -0
  83. package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs +374 -0
  84. package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs.meta +11 -0
  85. package/Runtime/Internal/Standalone/LoginModule/Email.meta +8 -0
  86. package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs +245 -0
  87. package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs.meta +11 -0
  88. package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs +392 -0
  89. package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs.meta +11 -0
  90. package/Runtime/Internal/Standalone/LoginModule/Phone.meta +8 -0
  91. package/Runtime/Internal/Standalone/LoginModule.meta +8 -0
  92. package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs +228 -0
  93. package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs.meta +3 -0
  94. package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs +27 -0
  95. package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs.meta +3 -0
  96. package/Runtime/Internal/Standalone/SupportModule.meta +3 -0
  97. package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs +479 -0
  98. package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs.meta +11 -0
  99. package/Runtime/Internal/Standalone/Track.meta +8 -0
  100. package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs +156 -0
  101. package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs.meta +11 -0
  102. package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs +295 -0
  103. package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs.meta +11 -0
  104. package/Runtime/Internal/Standalone/UI/Email.meta +8 -0
  105. package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs +46 -0
  106. package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs.meta +11 -0
  107. package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs +522 -0
  108. package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs.meta +11 -0
  109. package/Runtime/Internal/Standalone/UI/PhoneIO.meta +8 -0
  110. package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs +84 -0
  111. package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs.meta +11 -0
  112. package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs +190 -0
  113. package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs.meta +11 -0
  114. package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs +164 -0
  115. package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs.meta +11 -0
  116. package/Runtime/Internal/Standalone/UI/PhoneVerification.meta +8 -0
  117. package/Runtime/Internal/Standalone/UI.meta +8 -0
  118. package/Runtime/Internal/Standalone/UserCenterAlert.cs +405 -0
  119. package/Runtime/Internal/Standalone/UserCenterAlert.cs.meta +11 -0
  120. package/Runtime/Internal/Standalone/UserModule.cs +604 -0
  121. package/Runtime/Internal/Standalone/UserModule.cs.meta +11 -0
  122. package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs +47 -0
  123. package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs.meta +3 -0
  124. package/Runtime/Internal/Standalone/WebFunction.meta +3 -0
  125. package/{Mobile/Plugins.meta → Runtime/Internal/Standalone.meta} +1 -1
  126. package/Runtime/Internal/XDGAccountEventHandler.cs +23 -0
  127. package/Runtime/Internal/XDGAccountEventHandler.cs.meta +3 -0
  128. package/Runtime/Internal/XDGAccountInternal.cs +86 -0
  129. package/Runtime/Internal/XDGAccountInternal.cs.meta +11 -0
  130. package/Runtime/Internal.meta +1 -1
  131. package/Runtime/Public/XDGAccount.Deprecated.cs +37 -0
  132. package/Runtime/Public/XDGAccount.Deprecated.cs.meta +11 -0
  133. package/Runtime/Public/XDGAccount.cs +107 -0
  134. package/Runtime/{XDGAccount.cs.meta → Public/XDGAccount.cs.meta} +1 -1
  135. package/Runtime/Public.meta +8 -0
  136. package/Runtime/XD.SDK.Account.asmdef +7 -2
  137. package/Runtime/XD.SDK.Account.asmdef.meta +1 -1
  138. package/Runtime.meta +1 -1
  139. package/package.json +5 -5
  140. package/package.json.meta +2 -2
  141. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +0 -20
  142. package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +0 -7
  143. package/Mobile/Editor/XDAccountMobileProcessBuild.cs +0 -20
  144. package/Mobile/Http/XDGAccountHttpConfigMobile.cs +0 -36
  145. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +0 -36
  146. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java +0 -16
  147. package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java +0 -20
  148. package/Mobile/Plugins/Android/com/xd/account/bridge.meta +0 -8
  149. package/Mobile/Plugins/Android/com/xd/account.meta +0 -8
  150. package/Mobile/Plugins/Android/com/xd.meta +0 -8
  151. package/Mobile/Plugins/Android/com.meta +0 -8
  152. package/Mobile/Plugins/Android.meta +0 -8
  153. package/Mobile/Plugins/iOS/XDAccountBridge.m +0 -29
  154. package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +0 -37
  155. package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h +0 -17
  156. package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h.meta +0 -27
  157. package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m +0 -23
  158. package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m.meta +0 -37
  159. package/Mobile/Plugins/iOS.meta +0 -8
  160. package/Mobile/User/UserManagerMobile.cs +0 -45
  161. package/Mobile/User.meta +0 -8
  162. package/Mobile/XD.SDK.Account.Mobile.asmdef +0 -23
  163. package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +0 -7
  164. package/Mobile/XDGAccountMobile.cs +0 -138
  165. package/Mobile/XDGAccountMobileImpl.cs +0 -444
  166. package/Mobile/XDGAccountMobileImpl.cs.meta +0 -11
  167. package/Mobile/XDGTokenManager.cs +0 -116
  168. package/Mobile/XDGTokenManager.cs.meta +0 -11
  169. package/Mobile/XDGUserWrapper.cs +0 -167
  170. package/Mobile/XDGUserWrapper.cs.meta +0 -11
  171. package/Plugins/Android/libs/XDGAccount_6.29.1.aar +0 -0
  172. package/Plugins/Android/libs/XDGAccount_6.29.1.aar.meta +0 -32
  173. package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +0 -47
  174. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +0 -33
  175. package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGRoleInfo.h +0 -22
  176. package/README.md +0 -0
  177. package/README.md.meta +0 -7
  178. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +0 -19
  179. package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +0 -7
  180. package/Runtime/Editor/XDAccountProcessBuild.cs +0 -18
  181. package/Runtime/Editor/XDAccountProcessBuild.cs.meta +0 -11
  182. package/Runtime/Editor.meta +0 -8
  183. package/Runtime/IXDGAccount.cs +0 -44
  184. package/Runtime/IXDGAccount.cs.meta +0 -11
  185. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +0 -9
  186. package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +0 -11
  187. package/Runtime/Internal/Http/XDAccountHttpConfig.cs +0 -32
  188. package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +0 -11
  189. package/Runtime/Internal/Http.meta +0 -8
  190. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +0 -7
  191. package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +0 -11
  192. package/Runtime/Internal/User.meta +0 -8
  193. package/Runtime/UserManager.cs +0 -35
  194. package/Runtime/UserManager.cs.meta +0 -11
  195. package/Runtime/XDGAccessToken.cs +0 -18
  196. package/Runtime/XDGAccessToken.cs.meta +0 -11
  197. package/Runtime/XDGAccount.cs +0 -130
  198. package/Runtime/XDGLoginType.cs +0 -17
  199. package/Runtime/XDGLoginType.cs.meta +0 -11
  200. package/Runtime/XDGRoleInfo.cs +0 -24
  201. package/Runtime/XDGRoleInfo.cs.meta +0 -11
  202. package/Runtime/XDGUser.cs +0 -30
  203. package/Runtime/XDGUser.cs.meta +0 -11
  204. package/Runtime/XDGUserStatusCode.cs +0 -16
  205. package/Runtime/XDGUserStatusCode.cs.meta +0 -11
@@ -0,0 +1,295 @@
1
+ #if UNITY_EDITOR || UNITY_STANDALONE
2
+ using System;
3
+ using System.Collections.Generic;
4
+ using System.Linq;
5
+ using UnityEngine;
6
+ using UnityEngine.EventSystems;
7
+ using UnityEngine.UI;
8
+ using XD.SDK.Common;
9
+ using XD.SDK.Common.Internal;
10
+ using XD.SDK.Common.Internal.Standalone;
11
+
12
+ namespace XD.SDK.Account.Internal.Standalone
13
+ {
14
+ public class EmailAlert : UIElement
15
+ {
16
+ public class Data
17
+ {
18
+ public string email { get; set; }
19
+ public string code { get; set; }
20
+ }
21
+
22
+ public const int SEND_CODE = 0;
23
+ public const int LOGIN_OR_BIND = 1;
24
+ public const int CLOSE_CODE = -1;
25
+ private Button closeButton;
26
+
27
+ private Image emailBG;
28
+ private InputField emailInput;
29
+ private Text emailErrorTips;
30
+
31
+ private Image verificationCodeBG;
32
+ private InputField verificationCodeInput;
33
+ private Button sendCodeButton;
34
+ private Text sendCodeText;
35
+ private Text verificationCodeErrorTips;
36
+
37
+ private Button loginButton;
38
+
39
+ private Button userAgreementButton;
40
+ private Button privacyPolicyButton;
41
+ private Text footerText;
42
+
43
+ private LocalizableString localizableString;
44
+
45
+ private void Awake()
46
+ {
47
+ localizableString = XDLocalization.GetCurrentLocalizableString();
48
+
49
+ // 标题和关闭按钮
50
+ closeButton = transform.Find("Alert/CloseButton").GetComponent<Button>();
51
+ closeButton.onClick.AddListener(OnCloseButtonClicked);
52
+
53
+ // 邮件号码框
54
+ emailBG = transform.Find("Alert/EmailBox").GetComponent<Image>();
55
+ emailInput = transform.Find("Alert/EmailBox/EmailInput").GetComponent<InputField>();
56
+ transform.Find("Alert/EmailBox/EmailInput/Placeholder").GetComponent<Text>().text =
57
+ localizableString.EmailBoxHint;
58
+ EventTrigger emailInputTrigger = transform.Find("Alert/EmailBox/EmailInput").GetComponent<EventTrigger>();
59
+ emailErrorTips = transform.Find("Alert/EmailBox/EmailErrorTips").GetComponent<Text>();
60
+ var emailSelectEntry = new EventTrigger.Entry
61
+ {
62
+ eventID = EventTriggerType.Select
63
+ };
64
+ emailSelectEntry.callback.AddListener(OnEmailInputSelected);
65
+ var emailDeselectEntry = new EventTrigger.Entry
66
+ {
67
+ eventID = EventTriggerType.Deselect
68
+ };
69
+ emailDeselectEntry.callback.AddListener(OnEmailInputDeselect);
70
+ emailInputTrigger.triggers = new List<EventTrigger.Entry>();
71
+ emailInputTrigger.triggers.AddRange(new[]
72
+ {
73
+ emailSelectEntry, emailDeselectEntry
74
+ });
75
+ emailInput.onValueChanged.AddListener(OnEmailInputChanged);
76
+ emailErrorTips.gameObject.SetActive(false);
77
+
78
+ // 验证码框
79
+ verificationCodeBG = transform.Find("Alert/VerificationCodeBox").GetComponent<Image>();
80
+ verificationCodeInput = transform.Find("Alert/VerificationCodeBox/CodeInput").GetComponent<InputField>();
81
+ transform.Find("Alert/VerificationCodeBox/CodeInput/Placeholder").GetComponent<Text>().text =
82
+ localizableString.CodeBoxHint;
83
+ EventTrigger verificationCodeInputTrigger =
84
+ transform.Find("Alert/VerificationCodeBox/CodeInput").GetComponent<EventTrigger>();
85
+ sendCodeButton = transform.Find("Alert/VerificationCodeBox/SendButton").GetComponent<Button>();
86
+ sendCodeText = transform.Find("Alert/VerificationCodeBox/SendButton").GetComponent<Text>();
87
+ verificationCodeErrorTips = transform.Find("Alert/VerificationCodeBox/CodeErrorTips").GetComponent<Text>();
88
+ verificationCodeErrorTips.gameObject.SetActive(false);
89
+ var codeSelectEntry = new EventTrigger.Entry
90
+ {
91
+ eventID = EventTriggerType.Select
92
+ };
93
+ codeSelectEntry.callback.AddListener(OnCodeInputSelected);
94
+ var codeDeselectEntry = new EventTrigger.Entry
95
+ {
96
+ eventID = EventTriggerType.Deselect
97
+ };
98
+ codeDeselectEntry.callback.AddListener(OnCodeInputDeselect);
99
+ verificationCodeInputTrigger.triggers = new List<EventTrigger.Entry>();
100
+ verificationCodeInputTrigger.triggers.AddRange(new[]
101
+ {
102
+ codeSelectEntry, codeDeselectEntry
103
+ });
104
+ verificationCodeInput.onValueChanged.AddListener(OnCodeInputValueChanged);
105
+ sendCodeButton.onClick.AddListener(OnSendCodeButtonClicked);
106
+
107
+ // 登录按钮
108
+ loginButton = transform.Find("Alert/LoginButton").GetComponent<Button>();
109
+ transform.Find("Alert/LoginButton/Text").GetComponent<Text>().text = localizableString.CodeLoginButton;
110
+ loginButton.onClick.AddListener(OnLoginButtonClicked);
111
+
112
+ // 协议
113
+ userAgreementButton = transform.Find("Alert/Footer/UserAgreement").GetComponent<Button>();
114
+ privacyPolicyButton = transform.Find("Alert/Footer/PrivacyPolicy").GetComponent<Button>();
115
+ footerText = transform.Find("Alert/FooterText").GetComponent<Text>();
116
+ transform.Find("Alert/Footer/UserAgreement").GetComponent<Text>().text = localizableString.UserAgreement;
117
+ transform.Find("Alert/Footer/PrivacyPolicy").GetComponent<Text>().text = localizableString.PrivacyPolicy;
118
+ userAgreementButton.onClick.AddListener(OnUserAgreementButtonClicked);
119
+ privacyPolicyButton.onClick.AddListener(OnPrivacyPolicyButtonClicked);
120
+ transform.Find("Alert/FooterText").GetComponent<Text>().text =
121
+ localizableString.CodeBindFooterFormat.Replace("{support}",
122
+ "<b>" + localizableString.CodeBindFooterSupport + "</b>");
123
+ }
124
+
125
+ private void Start()
126
+ {
127
+ AliyunTrack.LoginOpenEmailPanel();
128
+ bool login = (extra["login"] as bool?) ?? false;
129
+ userAgreementButton.gameObject.SetActive(login);
130
+ privacyPolicyButton.gameObject.SetActive(login);
131
+ footerText.gameObject.SetActive(!login);
132
+ transform.Find("Alert/TitleText").GetComponent<Text>().text =
133
+ login ? localizableString.EmailLoginTitle : localizableString.EmailBindTitle;
134
+ }
135
+
136
+ public void UpdateEmailError(string errorString)
137
+ {
138
+ emailErrorTips.text = errorString;
139
+ emailErrorTips.gameObject.SetActive(errorString.Length > 0);
140
+ }
141
+
142
+ public void UpdateCodeError(string errorString)
143
+ {
144
+ verificationCodeErrorTips.text = errorString;
145
+ verificationCodeErrorTips.gameObject.SetActive(errorString.Length > 0);
146
+ }
147
+
148
+ public void SetSendButtonEnable(bool enable)
149
+ {
150
+ sendCodeButtonEnable = enable;
151
+ }
152
+
153
+ public void UpdateCanResendSeconds(float Seconds)
154
+ {
155
+ canSendTime = DateTime.Now + TimeSpan.FromSeconds(Seconds);
156
+ }
157
+
158
+ #region Callback
159
+
160
+ private void OnCloseButtonClicked()
161
+ {
162
+ OnCallback(CLOSE_CODE, null);
163
+ }
164
+
165
+ private void OnSendCodeButtonClicked()
166
+ {
167
+ OnCallback(SEND_CODE, new Data { email = emailInput.text });
168
+ }
169
+
170
+ private void OnLoginButtonClicked()
171
+ {
172
+ OnCallback(LOGIN_OR_BIND, new Data { email = emailInput.text, code = verificationCodeInput.text });
173
+ }
174
+
175
+ private void OnUserAgreementButtonClicked()
176
+ {
177
+ Agreement agreement = AgreementModule.currentAgreement();
178
+ XDGAgreement subAgreement = agreement.Agreements?.FirstOrDefault(x => x.Type == "terms-of-service");
179
+ string url = subAgreement?.Url ?? "https://protocol.xd.com/sdk-agreement-1.0.0.html";
180
+ Application.OpenURL(url);
181
+ }
182
+
183
+ private void OnPrivacyPolicyButtonClicked()
184
+ {
185
+ Agreement agreement = AgreementModule.currentAgreement();
186
+ XDGAgreement subAgreement = agreement.Agreements?.FirstOrDefault(x => x.Type == "privacy-policy");
187
+ string url = subAgreement?.Url ?? "https://protocol.xd.com/sdk-privacy-1.0.0.html";
188
+ Application.OpenURL(url);
189
+ }
190
+
191
+ private void OnEmailInputChanged(string newValue)
192
+ {
193
+ UpdateEmailError("");
194
+ }
195
+
196
+ private void OnCodeInputValueChanged(string newValue)
197
+ {
198
+ UpdateCodeError("");
199
+ }
200
+
201
+ #endregion
202
+
203
+ #region Private
204
+
205
+ private void Update()
206
+ {
207
+ RefreshSendCodeButtonStatus();
208
+ }
209
+
210
+ private void RefreshSendCodeButtonStatus()
211
+ {
212
+ double CanSendSeconds = (canSendTime - DateTime.Now).TotalSeconds;
213
+ bool hasSent = canSendTime != DateTime.MinValue;
214
+ if (CanSendSeconds <= 0)
215
+ {
216
+ sendCodeText.text = hasSent ? localizableString.CodeBoxRetry : localizableString.CodeBoxSendCode;
217
+ sendCodeButton.enabled = sendCodeButtonEnable;
218
+ }
219
+ else
220
+ {
221
+ sendCodeText.text = $"{(int)Math.Ceiling(CanSendSeconds)} s";
222
+ sendCodeButton.enabled = false;
223
+ }
224
+
225
+ sendCodeText.color =
226
+ sendCodeButton.enabled ? PhoneModuleIO.PhoneUIColor : PhoneModuleIO.PhoneUIDisableColor;
227
+ }
228
+
229
+ private bool sendCodeButtonEnable = true;
230
+ private DateTime canSendTime = DateTime.MinValue;
231
+
232
+ private void OnEmailInputSelected(BaseEventData eventData)
233
+ {
234
+ emailInputSelected = true;
235
+ RefreshEmailInputBorderColor();
236
+ }
237
+
238
+ private void OnEmailInputDeselect(BaseEventData eventData)
239
+ {
240
+ emailInputSelected = false;
241
+ RefreshEmailInputBorderColor();
242
+ }
243
+
244
+ private void RefreshEmailInputBorderColor()
245
+ {
246
+ if (emailErrorTips.text.Length > 0)
247
+ {
248
+ emailBG.color = Color.red;
249
+ }
250
+ else if (emailInputSelected)
251
+ {
252
+ emailBG.color = PhoneModuleIO.PhoneUIColor;
253
+ }
254
+ else
255
+ {
256
+ emailBG.color = PhoneModuleIO.PhoneUIDisableColor;
257
+ }
258
+ }
259
+
260
+ private bool emailInputSelected;
261
+
262
+ private void OnCodeInputSelected(BaseEventData eventData)
263
+ {
264
+ codeInputSelected = true;
265
+ RefreshCodeInputBorderColor();
266
+ }
267
+
268
+ private void OnCodeInputDeselect(BaseEventData eventData)
269
+ {
270
+ codeInputSelected = false;
271
+ RefreshCodeInputBorderColor();
272
+ }
273
+
274
+ private void RefreshCodeInputBorderColor()
275
+ {
276
+ if (verificationCodeInput.text.Length > 0)
277
+ {
278
+ verificationCodeBG.color = Color.red;
279
+ }
280
+ else if (codeInputSelected)
281
+ {
282
+ verificationCodeBG.color = PhoneModuleIO.PhoneUIColor;
283
+ }
284
+ else
285
+ {
286
+ verificationCodeBG.color = PhoneModuleIO.PhoneUIDisableColor;
287
+ }
288
+ }
289
+
290
+ private bool codeInputSelected;
291
+
292
+ #endregion
293
+ }
294
+ }
295
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0b18ce53d78b4606bc5f5425aabad298
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 7fe8e876285e4ab18dcedb771914042d
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,46 @@
1
+ #if UNITY_EDITOR || UNITY_STANDALONE
2
+ using System;
3
+ using UnityEngine;
4
+ using UnityEngine.UI;
5
+ using XD.SDK.Common.Internal.Standalone;
6
+
7
+ namespace XD.SDK.Account.Internal.Standalone{
8
+ public class AreaCodeCell : MonoBehaviour{
9
+ internal Action<AreaCodeData> OnSelected;
10
+ private AreaCodeData CodeData;
11
+ private bool isSelected;
12
+
13
+ private Button button;
14
+ private Image iconImage;
15
+ private Text regionText;
16
+ private Text codeText;
17
+ protected virtual void Awake(){
18
+ iconImage = transform.Find("IconImage").GetComponent<Image>();
19
+ regionText = transform.Find("RegionText").GetComponent<Text>();
20
+ codeText = transform.Find("CodeText").GetComponent<Text>();
21
+ button = transform.GetComponent<Button>();
22
+ button.onClick.AddListener(OnClicked);
23
+ }
24
+ public void UpdateCell(AreaCodeData Data){
25
+ CodeData = Data;
26
+ regionText.text = CodeData.RegionName;
27
+ codeText.text = CodeData.AreaCodeName;
28
+ }
29
+
30
+ public void UpdateSelection(bool NewSelection){
31
+ iconImage.enabled = NewSelection;
32
+ regionText.color = NewSelection ? PhoneModuleIO.PhoneUIColor : Color.black;
33
+ codeText.color = NewSelection ? PhoneModuleIO.PhoneUIColor : Color.black;
34
+ }
35
+
36
+ public void UpdateSelection(AreaCodeData SelectData){
37
+ UpdateSelection(SelectData != null && SelectData.AreaCode == CodeData.AreaCode);
38
+ }
39
+
40
+ private void OnClicked(){
41
+ OnSelected(CodeData);
42
+ }
43
+ }
44
+ }
45
+
46
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4e4f215db2e845b09f014d596be37642
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: