条件编译报错问题
This commit is contained in:
parent
f155b2b627
commit
88beff5b89
@ -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,39 +379,39 @@ 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();
|
||||||
@ -498,15 +497,15 @@ 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)
|
||||||
@ -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,7 +686,7 @@ public class LoginController : MonoBehaviour
|
|||||||
Utils.SetValidate(signFormDict, r.errFieldMsg);
|
Utils.SetValidate(signFormDict, r.errFieldMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
void CaptchaTimerTick()
|
void CaptchaTimerTick()
|
||||||
{
|
{
|
||||||
@ -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
|
||||||
@ -805,7 +804,7 @@ 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
|
||||||
@ -813,7 +812,7 @@ public class LoginController : MonoBehaviour
|
|||||||
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>();
|
||||||
@ -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 = () =>
|
||||||
{
|
{
|
||||||
@ -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);
|
||||||
@ -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,7 +1269,7 @@ 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)
|
||||||
{
|
{
|
||||||
@ -1296,9 +1293,9 @@ public class LoginController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 注册页面滑动逻辑
|
#region 注册页面滑动逻辑
|
||||||
private bool startScrollSign = false;
|
private bool startScrollSign = false;
|
||||||
private int scrollSignIndex = 0;
|
private int scrollSignIndex = 0;
|
||||||
|
|
||||||
@ -1311,7 +1308,7 @@ public class LoginController : MonoBehaviour
|
|||||||
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;
|
||||||
@ -1366,5 +1363,5 @@ public class LoginController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user