条件编译报错问题

This commit is contained in:
CaiYanPeng 2021-08-25 10:29:03 +08:00
parent f155b2b627
commit 88beff5b89

View File

@ -26,7 +26,7 @@ using ZenFulcrum.EmbeddedBrowser;
#endif #endif
//记录小f 是-457和-681 //记录小f 是-457和-681
public class QUserInfo public class QUserInfo
{ {
public long Id { get; set; } public long Id { get; set; }
public string Phone { get; set; } public string Phone { get; set; }
@ -34,12 +34,12 @@ public class QUserInfo
public string Avatar { get; set; } public string Avatar { get; set; }
public string Cookie { get; set; } public string Cookie { get; set; }
} }
public class LoginForm public class LoginForm
{ {
public InputField email { get; set; } public InputField email { get; set; }
public InputField password { get; set; } public InputField password { get; set; }
} }
public class SignForm public class SignForm
{ {
//页面1 //页面1
public InputField email { get; set; } public InputField email { get; set; }
@ -106,7 +106,7 @@ public class LoginController : MonoBehaviour
//其他 //其他
[SerializeField] RawImage loading; [SerializeField] RawImage loading;
Transform toolContainer; Transform toolContainer;
Dictionary<string, Selectable> formDict,signFormDict; Dictionary<string, Selectable> formDict, signFormDict;
public string avatarName { get; private set; } public string avatarName { get; private set; }
public Texture avatar; public Texture avatar;
@ -134,7 +134,7 @@ public class LoginController : MonoBehaviour
EventTriggerType.PointerClick, (b) => goResetPassword()); EventTriggerType.PointerClick, (b) => goResetPassword());
//signPage1.Find("next").GetComponent<Button>().onClick.AddListener(() => { goRegNext(); }); //signPage1.Find("next").GetComponent<Button>().onClick.AddListener(() => { goRegNext(); });
UIManager.AddEvent(signPage1.Find("Captcha").Find("BtnGet").gameObject, UIManager.AddEvent(signPage1.Find("Captcha").Find("BtnGet").gameObject,
EventTriggerType.PointerClick,(b)=> GetCaptcha()); EventTriggerType.PointerClick, (b) => GetCaptcha());
//signPage1.Find("Captcha").Find("BtnGet").GetComponent<Button>().onClick.AddListener(GetCaptcha); //signPage1.Find("Captcha").Find("BtnGet").GetComponent<Button>().onClick.AddListener(GetCaptcha);
var email = signPage1.Find("Email").GetComponent<InputField>(); var email = signPage1.Find("Email").GetComponent<InputField>();
var captcha = signPage1.Find("Captcha").GetComponent<InputField>(); var captcha = signPage1.Find("Captcha").GetComponent<InputField>();
@ -247,18 +247,18 @@ public class LoginController : MonoBehaviour
UIManager.AddEvent(sign.gameObject, EventTriggerType.PointerClick, (b) => goSign()); UIManager.AddEvent(sign.gameObject, EventTriggerType.PointerClick, (b) => goSign());
remember = loginContainer.Find("rememberButton").GetComponent<Button>(); remember = loginContainer.Find("rememberButton").GetComponent<Button>();
UIManager.AddEvent(remember.gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(remember.gameObject, EventTriggerType.PointerClick, (b) =>
{ {
var gou = remember.transform.Find("Gou"); var gou = remember.transform.Find("Gou");
if (gou.gameObject.activeSelf) if (gou.gameObject.activeSelf)
{ {
gou.gameObject.SetActive(false); gou.gameObject.SetActive(false);
} }
else else
{ {
gou.gameObject.SetActive(true); gou.gameObject.SetActive(true);
} }
}); });
UIManager.AddEvent(loginContainer.Find("ForgetPassword").gameObject, EventTriggerType.PointerClick, (e) =>goSign(type:1)); UIManager.AddEvent(loginContainer.Find("ForgetPassword").gameObject, EventTriggerType.PointerClick, (e) => goSign(type: 1));
#if !(UNITY_IOS || UNITY_ANDROID) #if !(UNITY_IOS || UNITY_ANDROID)
var wechatLogin = loginContainer.Find("otherContainer").Find("Wechat").GetComponent<Button>(); var wechatLogin = loginContainer.Find("otherContainer").Find("Wechat").GetComponent<Button>();
UIManager.AddEvent(wechatLogin.gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(wechatLogin.gameObject, EventTriggerType.PointerClick, (b) =>
@ -319,7 +319,7 @@ public class LoginController : MonoBehaviour
UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", () => UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", () =>
{ {
Application.Quit(); Application.Quit();
},2); }, 2);
}); });
} }
#if !(UNITY_IOS || UNITY_ANDROID) #if !(UNITY_IOS || UNITY_ANDROID)
@ -330,7 +330,6 @@ public class LoginController : MonoBehaviour
{ {
wxReturnLogin(); wxReturnLogin();
}); });
#if !(UNITY_IOS || UNITY_ANDROID)
wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>(); wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>();
if (wxBrowser != null) if (wxBrowser != null)
{ {
@ -360,17 +359,17 @@ public class LoginController : MonoBehaviour
if (wxLogin2 != null) if (wxLogin2 != null)
{ {
UIManager.AddEvent(wxLogin2.Find("return").gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(wxLogin2.Find("return").gameObject, EventTriggerType.PointerClick, (b) =>
{ {
#if !(UNITY_IOS || UNITY_ANDROID) #if !(UNITY_IOS || UNITY_ANDROID)
wxLogin1.gameObject.SetActive(false); wxLogin1.gameObject.SetActive(false);
wxLogin1.GetComponent<RectTransform>().localPosition = new Vector3(0, -573, 0); wxLogin1.GetComponent<RectTransform>().localPosition = new Vector3(0, -573, 0);
#endif #endif
wxLogin2.gameObject.SetActive(false); wxLogin2.gameObject.SetActive(false);
//wxLogin3.gameObject.SetActive(false); //wxLogin3.gameObject.SetActive(false);
pageNums = 4; pageNums = 4;
//Canvas.ForceUpdateCanvases(); //Canvas.ForceUpdateCanvases();
StartScrollPanel(1); StartScrollPanel(1);
}); });
wxLogin2.Find("Next").GetComponent<Button>().onClick.AddListener(() => wxLogin2.Find("Next").GetComponent<Button>().onClick.AddListener(() =>
{ {
this.goSign(false); this.goSign(false);
@ -380,40 +379,40 @@ public class LoginController : MonoBehaviour
if (wxLogin3 != null) if (wxLogin3 != null)
{ {
UIManager.AddEvent(wxLogin3.Find("return").gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(wxLogin3.Find("return").gameObject, EventTriggerType.PointerClick, (b) =>
{ {
if (signContainer.gameObject.activeSelf) if (signContainer.gameObject.activeSelf)
{ {
if (pageNums == 5) if (pageNums == 5)
{ {
StartScrollPanel(3); StartScrollPanel(3);
} }
else if (pageNums == 4) else if (pageNums == 4)
{ {
StartScrollPanel(2); StartScrollPanel(2);
} }
else else
{ {
StartScrollPanel(1); StartScrollPanel(1);
} }
} }
else else
{ {
signContainer.gameObject.SetActive(true); signContainer.gameObject.SetActive(true);
#if !(UNITY_IOS || UNITY_ANDROID) #if !(UNITY_IOS || UNITY_ANDROID)
wxLogin1.gameObject.SetActive(false); wxLogin1.gameObject.SetActive(false);
wxLogin1.GetComponent<RectTransform>().localPosition = new Vector3(0, -573, 0); wxLogin1.GetComponent<RectTransform>().localPosition = new Vector3(0, -573, 0);
#endif #endif
pageNums = 4; pageNums = 4;
//wxLogin3.gameObject.SetActive(false); //wxLogin3.gameObject.SetActive(false);
StartScrollPanel(1); StartScrollPanel(1);
} }
}); });
UIManager.AddEvent(wxLogin3.Find("rememberButton").gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(wxLogin3.Find("rememberButton").gameObject, EventTriggerType.PointerClick, (b) =>
{ {
var gou = wxLogin3.Find("rememberButton").Find("Gou").gameObject; var gou = wxLogin3.Find("rememberButton").Find("Gou").gameObject;
gou.SetActive(!gou.activeSelf); gou.SetActive(!gou.activeSelf);
}); });
UIManager.AddEvent(wxLogin3.Find("Next").gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(wxLogin3.Find("Next").gameObject, EventTriggerType.PointerClick, (b) =>
{ {
goMain(wxLogin3.Find("rememberButton").Find("Gou")); goMain(wxLogin3.Find("rememberButton").Find("Gou"));
}); });
@ -424,9 +423,9 @@ public class LoginController : MonoBehaviour
if (toolContainer != null) if (toolContainer != null)
{ {
UIManager.AddEvent(toolContainer.Find("Setting").gameObject, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(toolContainer.Find("Setting").gameObject, EventTriggerType.PointerClick, (b) =>
{ {
UIManager.ShowSettingModal(); UIManager.ShowSettingModal();
}); });
//toolContainer.Find("Setting").GetComponent<Button>().onClick.AddListener(() => //toolContainer.Find("Setting").GetComponent<Button>().onClick.AddListener(() =>
//{ //{
// UIManager.ShowSettingModal(); // UIManager.ShowSettingModal();
@ -464,7 +463,7 @@ public class LoginController : MonoBehaviour
} }
}); });
#endif #endif
signFormDict = new Dictionary<string, Selectable> signFormDict = new Dictionary<string, Selectable>
{ {
{ "Phone",signForm.email}, { "Phone",signForm.email},
{ "Captcha",signForm.captcha}, { "Captcha",signForm.captcha},
@ -481,7 +480,7 @@ public class LoginController : MonoBehaviour
transform.Find("Panel").Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}"; transform.Find("Panel").Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}";
#endif #endif
} }
public void Test(string key) public void Test(string key)
{ {
Debug.Log(key); Debug.Log(key);
} }
@ -498,18 +497,18 @@ public class LoginController : MonoBehaviour
var r = await ConfigHelper.userApi.GetNotify(); var r = await ConfigHelper.userApi.GetNotify();
if (r.result) if (r.result)
{ {
//#if !UNITY_EDITOR //#if !UNITY_EDITOR
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>(); var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
if (ver!=null && ver.HasUpdate) if (ver != null && ver.HasUpdate)
{ {
App.UpdateObject = ver; App.UpdateObject = ver;
Debug.Log(Application.persistentDataPath + "/PowerFun.exe"); Debug.Log(Application.persistentDataPath + "/PowerFun.exe");
UIManager.ShowDownloadModal(); UIManager.ShowDownloadModal();
} }
//#endif //#endif
App.notifyContent = r.data.Value<string>("Content"); App.notifyContent = r.data.Value<string>("Content");
if (r.data.Value<int>("Id") != notifyId) if (r.data.Value<int>("Id") != notifyId)
{ {
UIManager.ShowNewsModal(); UIManager.ShowNewsModal();
PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id")); PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
@ -539,7 +538,7 @@ public class LoginController : MonoBehaviour
Debug.Log(JsonConvert.SerializeObject(locationInfo)); Debug.Log(JsonConvert.SerializeObject(locationInfo));
var i = await ConfigHelper.thirdPartApi.GetMapImage(locationInfo); var i = await ConfigHelper.thirdPartApi.GetMapImage(locationInfo);
var t = new Texture2D(2, 2); var t = new Texture2D(2, 2);
if (t.LoadImage(Utils.StreamToBytes(i))) if (t.LoadImage(Utils.StreamToBytes(i)))
{ {
Debug.Log("成功"); Debug.Log("成功");
App.TextureCache["rotateImage"] = t; App.TextureCache["rotateImage"] = t;
@ -648,7 +647,7 @@ public class LoginController : MonoBehaviour
{ {
} }
#region #region
int time = 0; int time = 0;
float timer = 0f; float timer = 0f;
bool startCaptcha = false; bool startCaptcha = false;
@ -687,8 +686,8 @@ public class LoginController : MonoBehaviour
Utils.SetValidate(signFormDict, r.errFieldMsg); Utils.SetValidate(signFormDict, r.errFieldMsg);
} }
} }
#endregion #endregion
void CaptchaTimerTick() void CaptchaTimerTick()
{ {
timer -= Time.deltaTime; timer -= Time.deltaTime;
@ -762,7 +761,7 @@ public class LoginController : MonoBehaviour
Utils.showToast(gameObject, r.errMsg); Utils.showToast(gameObject, r.errMsg);
} }
} }
async void goRegNextWithoutPass() async void goRegNextWithoutPass()
{ {
var Email = signForm.email; var Email = signForm.email;
@ -775,7 +774,7 @@ public class LoginController : MonoBehaviour
if (r.result) if (r.result)
{ {
var u = JObject.FromObject(r.data).ToObject<UserResultModel>(); var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
RefreshWx3(u,1); RefreshWx3(u, 1);
StartScrollPanel(4); StartScrollPanel(4);
} }
else else
@ -786,7 +785,7 @@ public class LoginController : MonoBehaviour
/// <summary> /// <summary>
/// 重置密码逻辑 /// 重置密码逻辑
/// </summary> /// </summary>
async void goResetPassword() async void goResetPassword()
{ {
var Email = signForm.email; var Email = signForm.email;
var Captcha = signForm.captcha; var Captcha = signForm.captcha;
@ -805,15 +804,15 @@ public class LoginController : MonoBehaviour
var r = await ConfigHelper.userApi.ResetPassword(Email.text, Captcha.text, Password.text); var r = await ConfigHelper.userApi.ResetPassword(Email.text, Captcha.text, Password.text);
if (r.result) if (r.result)
{ {
Utils.showToast(gameObject, "Success",type:1); Utils.showToast(gameObject, "Success", type: 1);
goLoginReturn2(); goLoginReturn2();
} }
else else
{ {
Utils.showToast(gameObject, r.errMsg); Utils.showToast(gameObject, r.errMsg);
} }
} }
void RefreshWx3(UserResultModel data,int type) void RefreshWx3(UserResultModel data, int type)
{ {
Utils.DisplayHead(wxLogin3.Find("Avatar").GetComponent<RawImage>(), Utils.DisplayHead(wxLogin3.Find("Avatar").GetComponent<RawImage>(),
data.WxHeadImg); data.WxHeadImg);
@ -874,7 +873,7 @@ public class LoginController : MonoBehaviour
/// 注册页2 修改信息 /// 注册页2 修改信息
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
bool UpdateInfo() bool UpdateInfo()
{ {
if (userResult == null) return false; if (userResult == null) return false;
var _days = signForm.days.GetComponent<PFUIDropdown>(); var _days = signForm.days.GetComponent<PFUIDropdown>();
@ -889,9 +888,9 @@ public class LoginController : MonoBehaviour
{ {
userResult.Birthday = new DateTime(int.Parse(_years.SelectedItem), int.Parse(_months.SelectedItem), int.Parse(_days.SelectedItem)); userResult.Birthday = new DateTime(int.Parse(_years.SelectedItem), int.Parse(_months.SelectedItem), int.Parse(_days.SelectedItem));
} }
else else
{ {
Utils.SetValidate(signFormDict, JArray.FromObject(new object[] Utils.SetValidate(signFormDict, JArray.FromObject(new object[]
{ {
new { Field = "Years", ErrMsg = "" }, new { Field = "Years", ErrMsg = "" },
new { Field = "Months", ErrMsg = "" }, new { Field = "Months", ErrMsg = "" },
@ -909,7 +908,7 @@ public class LoginController : MonoBehaviour
{ {
userResult.Nickname = userResult.Phone; userResult.Nickname = userResult.Phone;
} }
var r = ConfigHelper.userApi.Update(userResult,out string cookie,""); var r = ConfigHelper.userApi.Update(userResult, out string cookie, "");
return r.result; return r.result;
//userResult.Birthday.v //userResult.Birthday.v
} }
@ -942,9 +941,7 @@ public class LoginController : MonoBehaviour
void wxReturnLogin() void wxReturnLogin()
{ {
wxLock = true; wxLock = true;
#if !(UNITY_IOS || UNITY_ANDROID)
wxBrowser.LoadHTML("<div/>"); wxBrowser.LoadHTML("<div/>");
#endif
//wxBrowser.Url = "chrome://version/"; //wxBrowser.Url = "chrome://version/";
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () => wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
{ {
@ -956,7 +953,7 @@ public class LoginController : MonoBehaviour
/// <summary> /// <summary>
/// 立刻跳到登录页并且返回按钮强行失效 /// 立刻跳到登录页并且返回按钮强行失效
/// </summary> /// </summary>
private void goLoginImmediately() private void goLoginImmediately()
{ {
#if !(UNITY_IOS || UNITY_ANDROID) #if !(UNITY_IOS || UNITY_ANDROID)
imagedf.localPosition = new Vector3(-580, -34, 0); imagedf.localPosition = new Vector3(-580, -34, 0);
@ -1056,7 +1053,7 @@ public class LoginController : MonoBehaviour
/// </summary> /// </summary>
/// <param name="isAccount"></param> /// <param name="isAccount"></param>
/// <param name="type">0 注册 1 忘记密码</param> /// <param name="type">0 注册 1 忘记密码</param>
void goSign(bool isAccount = true,int type = 0) void goSign(bool isAccount = true, int type = 0)
{ {
#if UNITY_ANDROID || UNITY_IOS #if UNITY_ANDROID || UNITY_IOS
imagedf.GetComponent<Image>().DOFade(0, .3f); imagedf.GetComponent<Image>().DOFade(0, .3f);
@ -1076,7 +1073,7 @@ public class LoginController : MonoBehaviour
this.StartScrollPanel(3); this.StartScrollPanel(3);
this.StartScrollSign(0); this.StartScrollSign(0);
} }
else else
{ {
if (type == 0) if (type == 0)
{ {
@ -1091,7 +1088,7 @@ public class LoginController : MonoBehaviour
this.StartScrollPanel(2); this.StartScrollPanel(2);
this.StartScrollSign(0); this.StartScrollSign(0);
} }
else else
{ {
pageNums = 4; pageNums = 4;
signContainer.Find("signText").GetComponent<Text>().text = "RESET PASSWORD"; signContainer.Find("signText").GetComponent<Text>().text = "RESET PASSWORD";
@ -1110,7 +1107,7 @@ public class LoginController : MonoBehaviour
/// 登录/注册完成,去首页 /// 登录/注册完成,去首页
/// </summary> /// </summary>
/// <param name="gou"></param> /// <param name="gou"></param>
void goMain(Transform gou) void goMain(Transform gou)
{ {
var data = userResult; var data = userResult;
if (data == null) return; if (data == null) return;
@ -1120,10 +1117,10 @@ public class LoginController : MonoBehaviour
SaveInfo(data); SaveInfo(data);
//PlayerPrefs.SetString("UserInfos", JsonConvert.SerializeObject(userInfos)); //PlayerPrefs.SetString("UserInfos", JsonConvert.SerializeObject(userInfos));
} }
else else
{ {
var u = userInfos.Find(x => x.Id == data.Id); var u = userInfos.Find(x => x.Id == data.Id);
if (u != null) if (u != null)
{ {
userInfos.Remove(u); userInfos.Remove(u);
} }
@ -1140,7 +1137,7 @@ public class LoginController : MonoBehaviour
/// 缓存打钩的用户信息 /// 缓存打钩的用户信息
/// </summary> /// </summary>
/// <param name="data"></param> /// <param name="data"></param>
public void SaveInfo(UserResultModel data) public void SaveInfo(UserResultModel data)
{ {
var index = userInfos.FindIndex(x => x.Id == data.Id); var index = userInfos.FindIndex(x => x.Id == data.Id);
if (index == -1) if (index == -1)
@ -1178,7 +1175,7 @@ public class LoginController : MonoBehaviour
/// <summary> /// <summary>
/// 登录提交 /// 登录提交
/// </summary> /// </summary>
async void Submit() async void Submit()
{ {
var res = await ConfigHelper.userApi.LoginV1(loginForm.email.text, loginForm.password.text, ""); var res = await ConfigHelper.userApi.LoginV1(loginForm.email.text, loginForm.password.text, "");
//var res = await NoAuthApi.Login(phone.text, pwd.text); //var res = await NoAuthApi.Login(phone.text, pwd.text);
@ -1187,9 +1184,9 @@ public class LoginController : MonoBehaviour
userResult = JObject.FromObject(res.data).ToObject<UserResultModel>(); userResult = JObject.FromObject(res.data).ToObject<UserResultModel>();
goMain(remember.transform.Find("Gou")); goMain(remember.transform.Find("Gou"));
} }
else else
{ {
if (res.data != null) if (res.data != null)
{ {
var errorList = JArray.FromObject(res.data); var errorList = JArray.FromObject(res.data);
Utils.SetValidate(formDict, errorList); Utils.SetValidate(formDict, errorList);
@ -1203,13 +1200,13 @@ public class LoginController : MonoBehaviour
//Debug.Log($"{phone.isFocused}, ${pwd != null}, ${Input.GetKeyDown(KeyCode.Tab)}"); //Debug.Log($"{phone.isFocused}, ${pwd != null}, ${Input.GetKeyDown(KeyCode.Tab)}");
if (Input.GetKeyDown(KeyCode.Tab)) if (Input.GetKeyDown(KeyCode.Tab))
{ {
if (loginForm != null && loginForm.email.isFocused && loginForm.password != null) if (loginForm != null && loginForm.email.isFocused && loginForm.password != null)
{ {
loginForm.password.ActivateInputField(); loginForm.password.ActivateInputField();
} }
if (signForm != null) if (signForm != null)
{ {
if (signForm.email.isFocused) if (signForm.email.isFocused)
{ {
signForm.captcha.ActivateInputField(); signForm.captcha.ActivateInputField();
} }
@ -1227,18 +1224,18 @@ public class LoginController : MonoBehaviour
} }
} }
} }
if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return)) if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return))
{ {
if (loginForm != null && !string.IsNullOrEmpty(loginForm.email.text) && !string.IsNullOrEmpty(loginForm.password.text)) if (loginForm != null && !string.IsNullOrEmpty(loginForm.email.text) && !string.IsNullOrEmpty(loginForm.password.text))
{ {
Submit(); Submit();
} }
} }
if (startCaptcha) if (startCaptcha)
{ {
CaptchaTimerTick(); CaptchaTimerTick();
} }
//if (wxLogin1.gameObject.activeInHierarchy) //if (wxLogin1.gameObject.activeInHierarchy)
//{ //{
// adjTime += Time.deltaTime; // adjTime += Time.deltaTime;
@ -1257,7 +1254,7 @@ public class LoginController : MonoBehaviour
} }
//float adjTime = 0; //float adjTime = 0;
//bool startJs = false; //bool startJs = false;
#region #region
private int tmpImdex = 0; private int tmpImdex = 0;
private int scrollPanelIndex = 2; private int scrollPanelIndex = 2;
//private float scrollValue = 0.5f; //private float scrollValue = 0.5f;
@ -1272,20 +1269,20 @@ public class LoginController : MonoBehaviour
private void goScrollPanel() private void goScrollPanel()
{ {
var index = scrollPanelIndex; var index = scrollPanelIndex;
var scrollValue = 1f/(pageNums - 1); var scrollValue = 1f / (pageNums - 1);
var value = index * scrollValue; var value = index * scrollValue;
if (scrollPanel != null && startScrollPanel) if (scrollPanel != null && startScrollPanel)
{ {
if (scrollPanel.horizontalNormalizedPosition >= value) if (scrollPanel.horizontalNormalizedPosition >= value)
{ {
scrollPanel.horizontalNormalizedPosition -= (scrollValue / 10); scrollPanel.horizontalNormalizedPosition -= (scrollValue / 10);
if (scrollPanel.horizontalNormalizedPosition <= value) if (scrollPanel.horizontalNormalizedPosition <= value)
{ {
scrollPanel.horizontalNormalizedPosition = value; scrollPanel.horizontalNormalizedPosition = value;
startScrollPanel = false; startScrollPanel = false;
} }
} }
else else
{ {
scrollPanel.horizontalNormalizedPosition += (scrollValue / 10); scrollPanel.horizontalNormalizedPosition += (scrollValue / 10);
if (scrollPanel.horizontalNormalizedPosition >= value) if (scrollPanel.horizontalNormalizedPosition >= value)
@ -1296,31 +1293,31 @@ public class LoginController : MonoBehaviour
} }
} }
} }
#endregion #endregion
#region #region
private bool startScrollSign = false; private bool startScrollSign = false;
private int scrollSignIndex = 0; private int scrollSignIndex = 0;
private void StartScrollSign(int index) private void StartScrollSign(int index)
{ {
if (startScrollSign) return; if (startScrollSign) return;
scrollSignIndex = index; scrollSignIndex = index;
startScrollSign = true; startScrollSign = true;
Debug.Log($"{index},{index * 160}"); Debug.Log($"{index},{index * 160}");
if (index == 1) if (index == 1)
{ {
if (signForm.years.value!=-1) signForm.years.value = 0; if (signForm.years.value != -1) signForm.years.value = 0;
if (signForm.months.value != -1) signForm.months.value = 0; if (signForm.months.value != -1) signForm.months.value = 0;
if (signForm.days.value != -1) signForm.days.value = 0; if (signForm.days.value != -1) signForm.days.value = 0;
if (signForm.countrys.value != -1) signForm.countrys.value = regOptions.countryDefaultValue; if (signForm.countrys.value != -1) signForm.countrys.value = regOptions.countryDefaultValue;
if (signForm.genders.value != -1) signForm.genders.value = 0; if (signForm.genders.value != -1) signForm.genders.value = 0;
if (signForm.units.value != -1) signForm.units.value = 0; if (signForm.units.value != -1) signForm.units.value = 0;
if (pageNums == 5 && wxInfoJson != null) if (pageNums == 5 && wxInfoJson != null)
{ {
var sex = wxInfoJson.Value<int>("sex"); var sex = wxInfoJson.Value<int>("sex");
if (sex > 0) if (sex > 0)
{ {
signForm.genders.value = sex - 1; signForm.genders.value = sex - 1;
} }
@ -1352,7 +1349,7 @@ public class LoginController : MonoBehaviour
{ {
scrollSign.horizontalNormalizedPosition = 0; scrollSign.horizontalNormalizedPosition = 0;
startScrollSign = false; startScrollSign = false;
} }
} }
else if (scrollSignIndex == 1) else if (scrollSignIndex == 1)
@ -1366,5 +1363,5 @@ public class LoginController : MonoBehaviour
} }
} }
} }
#endregion #endregion
} }