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.
- package/Plugins/Android/libs/XDGAccount_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java.meta → Plugins/Android/libs/XDGAccount_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java.meta → Plugins/Android/libs/XDGBridgeAccount_v7_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs/XDGSupport_7.0.0.aar +0 -0
- package/{Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java.meta → Plugins/Android/libs/XDGSupport_7.0.0.aar.meta} +2 -2
- package/Plugins/Android/libs.meta +1 -1
- package/Plugins/Android.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h +2 -8
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginHelper.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK-Swift.h +329 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/{TDSGlobalThirdPartyLoginManager.h.meta → XDAccountSDK-Swift.h.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h +1 -2
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDAccountSDK.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h +29 -43
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccount.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountDefines.h +43 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/{XDGPhoneAuthManager.h.meta → XDGAccountDefines.h.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +3 -3
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h +3 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLogger+Account.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginEntriesConfig.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGLoginService.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGTapLoginPermissionDialog.h.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Headers.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/{Headers/XDGRoleInfo.h.meta → Modules/XDAccountSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo.meta} +1 -1
- package/{Mobile/Http.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/Project.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json +9 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.abi.json.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftdoc.meta +7 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule/arm64-apple-ios.swiftmodule.meta +7 -0
- package/{Mobile/Editor.meta → Plugins/iOS/XDAccountSDK.framework/Modules/XDAccountSDK.swiftmodule.meta} +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules/module.modulemap.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/Modules.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK.meta +1 -1
- package/Plugins/iOS/XDAccountSDK.framework.meta +4 -4
- package/Plugins/iOS.meta +1 -1
- package/Plugins.meta +1 -1
- package/Runtime/Internal/IXDGAccount.Extended.cs +11 -0
- package/{Mobile/Http/XDGAccountHttpConfigMobile.cs.meta → Runtime/Internal/IXDGAccount.Extended.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/AccountFeaturesImpl.cs +348 -0
- package/{Mobile/User/UserManagerMobile.cs.meta → Runtime/Internal/Mobile/AccountFeaturesImpl.cs.meta} +1 -1
- package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs +14 -0
- package/Runtime/Internal/Mobile/Http/LoginSyncResponse.cs.meta +3 -0
- package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs +37 -0
- package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs.meta +3 -0
- package/Runtime/Internal/Mobile/Http.meta +3 -0
- package/{Mobile.meta → Runtime/Internal/Mobile.meta} +1 -1
- package/Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs +168 -0
- package/{Mobile/Editor/XDAccountMobileProcessBuild.cs.meta → Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/AccessToken.meta +8 -0
- package/Runtime/Internal/Standalone/AccountCell.cs +143 -0
- package/{Mobile/XDGAccountMobile.cs.meta → Runtime/Internal/Standalone/AccountCell.cs.meta} +1 -1
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs +461 -0
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/AppleAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/AppleAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/FacebookAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs +27 -0
- package/Runtime/Internal/Standalone/Auth/GoogleAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/GuestAuth.cs +22 -0
- package/Runtime/Internal/Standalone/Auth/GuestAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs +43 -0
- package/Runtime/Internal/Standalone/Auth/PhoneAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/SteamAuth.cs +90 -0
- package/Runtime/Internal/Standalone/Auth/SteamAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/TapAuth.cs +72 -0
- package/Runtime/Internal/Standalone/Auth/TapAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth/WebAuth.cs +144 -0
- package/Runtime/Internal/Standalone/Auth/WebAuth.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Auth.meta +8 -0
- package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs +15 -0
- package/Runtime/Internal/Standalone/Compliance/XDComplianceCode.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Compliance.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs +374 -0
- package/Runtime/Internal/Standalone/LoginModule/Email/EmailModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Email.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs +245 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs +392 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone/PhoneModuleIO.cs.meta +11 -0
- package/Runtime/Internal/Standalone/LoginModule/Phone.meta +8 -0
- package/Runtime/Internal/Standalone/LoginModule.meta +8 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs +228 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs.meta +3 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs +27 -0
- package/Runtime/Internal/Standalone/SupportModule/SupportResponse.cs.meta +3 -0
- package/Runtime/Internal/Standalone/SupportModule.meta +3 -0
- package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs +479 -0
- package/Runtime/Internal/Standalone/Track/AliyunTrack.Login.cs.meta +11 -0
- package/Runtime/Internal/Standalone/Track.meta +8 -0
- package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs +156 -0
- package/Runtime/Internal/Standalone/UI/CodeUnbindAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs +295 -0
- package/Runtime/Internal/Standalone/UI/Email/EmailAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/Email.meta +8 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs +46 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/AreaCodeCell.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs +522 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO/PhoneAlertIO.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneIO.meta +8 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs +84 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/PhoneNumberInputAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs +190 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs +164 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification/VerifyCodeInputAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UI/PhoneVerification.meta +8 -0
- package/Runtime/Internal/Standalone/UI.meta +8 -0
- package/Runtime/Internal/Standalone/UserCenterAlert.cs +405 -0
- package/Runtime/Internal/Standalone/UserCenterAlert.cs.meta +11 -0
- package/Runtime/Internal/Standalone/UserModule.cs +604 -0
- package/Runtime/Internal/Standalone/UserModule.cs.meta +11 -0
- package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs +47 -0
- package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs.meta +3 -0
- package/Runtime/Internal/Standalone/WebFunction.meta +3 -0
- package/{Mobile/Plugins.meta → Runtime/Internal/Standalone.meta} +1 -1
- package/Runtime/Internal/XDGAccountEventHandler.cs +23 -0
- package/Runtime/Internal/XDGAccountEventHandler.cs.meta +3 -0
- package/Runtime/Internal/XDGAccountInternal.cs +86 -0
- package/Runtime/Internal/XDGAccountInternal.cs.meta +11 -0
- package/Runtime/Internal.meta +1 -1
- package/Runtime/Public/XDGAccount.Deprecated.cs +37 -0
- package/Runtime/Public/XDGAccount.Deprecated.cs.meta +11 -0
- package/Runtime/Public/XDGAccount.cs +107 -0
- package/Runtime/{XDGAccount.cs.meta → Public/XDGAccount.cs.meta} +1 -1
- package/Runtime/Public.meta +8 -0
- package/Runtime/XD.SDK.Account.asmdef +7 -2
- package/Runtime/XD.SDK.Account.asmdef.meta +1 -1
- package/Runtime.meta +1 -1
- package/package.json +5 -5
- package/package.json.meta +2 -2
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef +0 -20
- package/Mobile/Editor/XD.SDK.Account.Mobile.Editor.asmdef.meta +0 -7
- package/Mobile/Editor/XDAccountMobileProcessBuild.cs +0 -20
- package/Mobile/Http/XDGAccountHttpConfigMobile.cs +0 -36
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGAccountBridge.java +0 -36
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnity.java +0 -16
- package/Mobile/Plugins/Android/com/xd/account/bridge/XDGLoginServiceUnityImpl.java +0 -20
- package/Mobile/Plugins/Android/com/xd/account/bridge.meta +0 -8
- package/Mobile/Plugins/Android/com/xd/account.meta +0 -8
- package/Mobile/Plugins/Android/com/xd.meta +0 -8
- package/Mobile/Plugins/Android/com.meta +0 -8
- package/Mobile/Plugins/Android.meta +0 -8
- package/Mobile/Plugins/iOS/XDAccountBridge.m +0 -29
- package/Mobile/Plugins/iOS/XDAccountBridge.m.meta +0 -37
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h +0 -17
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.h.meta +0 -27
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m +0 -23
- package/Mobile/Plugins/iOS/XDGLoginServiceUnity.m.meta +0 -37
- package/Mobile/Plugins/iOS.meta +0 -8
- package/Mobile/User/UserManagerMobile.cs +0 -45
- package/Mobile/User.meta +0 -8
- package/Mobile/XD.SDK.Account.Mobile.asmdef +0 -23
- package/Mobile/XD.SDK.Account.Mobile.asmdef.meta +0 -7
- package/Mobile/XDGAccountMobile.cs +0 -138
- package/Mobile/XDGAccountMobileImpl.cs +0 -444
- package/Mobile/XDGAccountMobileImpl.cs.meta +0 -11
- package/Mobile/XDGTokenManager.cs +0 -116
- package/Mobile/XDGTokenManager.cs.meta +0 -11
- package/Mobile/XDGUserWrapper.cs +0 -167
- package/Mobile/XDGUserWrapper.cs.meta +0 -11
- package/Plugins/Android/libs/XDGAccount_6.29.1.aar +0 -0
- package/Plugins/Android/libs/XDGAccount_6.29.1.aar.meta +0 -32
- package/Plugins/iOS/XDAccountSDK.framework/Headers/TDSGlobalThirdPartyLoginManager.h +0 -47
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGPhoneAuthManager.h +0 -33
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGRoleInfo.h +0 -22
- package/README.md +0 -0
- package/README.md.meta +0 -7
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef +0 -19
- package/Runtime/Editor/XD.SDK.Account.Editor.asmdef.meta +0 -7
- package/Runtime/Editor/XDAccountProcessBuild.cs +0 -18
- package/Runtime/Editor/XDAccountProcessBuild.cs.meta +0 -11
- package/Runtime/Editor.meta +0 -8
- package/Runtime/IXDGAccount.cs +0 -44
- package/Runtime/IXDGAccount.cs.meta +0 -11
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs +0 -9
- package/Runtime/Internal/Http/IXDAccountHttpConfig.cs.meta +0 -11
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs +0 -32
- package/Runtime/Internal/Http/XDAccountHttpConfig.cs.meta +0 -11
- package/Runtime/Internal/Http.meta +0 -8
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs +0 -7
- package/Runtime/Internal/User/IUserManagerPlatformWrapper.cs.meta +0 -11
- package/Runtime/Internal/User.meta +0 -8
- package/Runtime/UserManager.cs +0 -35
- package/Runtime/UserManager.cs.meta +0 -11
- package/Runtime/XDGAccessToken.cs +0 -18
- package/Runtime/XDGAccessToken.cs.meta +0 -11
- package/Runtime/XDGAccount.cs +0 -130
- package/Runtime/XDGLoginType.cs +0 -17
- package/Runtime/XDGLoginType.cs.meta +0 -11
- package/Runtime/XDGRoleInfo.cs +0 -24
- package/Runtime/XDGRoleInfo.cs.meta +0 -11
- package/Runtime/XDGUser.cs +0 -30
- package/Runtime/XDGUser.cs.meta +0 -11
- package/Runtime/XDGUserStatusCode.cs +0 -16
- 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,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
|