下载界面增加开始按钮,登陆注册bug修改
This commit is contained in:
parent
470d52b1bc
commit
09514e2a8a
@ -33,7 +33,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 4690766463415434102}
|
||||
m_Father: {fileID: 3706567255822698944}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
@ -484,6 +484,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 7830190604736488075}
|
||||
- {fileID: 5683174797082813662}
|
||||
- {fileID: 6797571756054001242}
|
||||
- {fileID: 5365663280637269737}
|
||||
- {fileID: 519173366022166441}
|
||||
- {fileID: 7867355229879358215}
|
||||
@ -757,7 +758,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &519173366022166441
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -773,7 +774,7 @@ RectTransform:
|
||||
- {fileID: 2099421121628425594}
|
||||
- {fileID: 9064511354930000322}
|
||||
m_Father: {fileID: 3706567255822698944}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
@ -989,7 +990,7 @@ PrefabInstance:
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
value: 3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
@ -1099,7 +1100,7 @@ PrefabInstance:
|
||||
- target: {fileID: 3150550772916003707, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Text
|
||||
value: UPDATE NOW
|
||||
value: Update Now
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
@ -1134,3 +1135,173 @@ RectTransform:
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 7048040436756266057}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8497397782667877626
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 3706567255822698944}
|
||||
m_Modifications:
|
||||
- target: {fileID: 545917028276686471, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 140
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 38
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -444
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312289, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BtnStart
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312289, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772099312291, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Interactable
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3150550772916003707, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_Text
|
||||
value: Start
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5329299856310536127, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -9
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8688565590564084001, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
propertyPath: mType
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6b94e789d6585a04dbdc04c8a7cf97b2, type: 3}
|
||||
--- !u!224 &6797571756054001242 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 3150550772099312288, guid: 6b94e789d6585a04dbdc04c8a7cf97b2,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8497397782667877626}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -11,6 +12,7 @@ namespace Assets.Scripts.Apis
|
||||
public bool result { get; set; }
|
||||
//public dynamic data { get; set; }
|
||||
public string errMsg { get; set; }
|
||||
public JArray errFieldMsg { get; set; }
|
||||
}
|
||||
|
||||
public class JsonResult<T> : JsonResult
|
||||
|
||||
@ -309,14 +309,7 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
UIManager.AddEvent(wxLogin1.Find("Image").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
wxLock = true;
|
||||
wxBrowser.LoadHTML("<div/>");
|
||||
//wxBrowser.Url = "chrome://version/";
|
||||
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
|
||||
{
|
||||
wxLock = false;
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
};
|
||||
wxReturnLogin();
|
||||
});
|
||||
wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>();
|
||||
if (wxBrowser != null)
|
||||
@ -619,6 +612,8 @@ public class LoginController : MonoBehaviour
|
||||
async void GetCaptcha()
|
||||
{
|
||||
var btn = signPage1.Find("Captcha").Find("BtnGet");
|
||||
btn.GetComponent<Button>().enabled = false;
|
||||
btn.GetComponent<Button>().interactable = false;
|
||||
var btnText = signPage1.Find("Captcha").Find("BtnGet").Find("Text").GetComponent<Text>();
|
||||
var Email = signForm.email;
|
||||
var r = await ConfigHelper.userApi.GetCaptcha(Email.text);
|
||||
@ -643,7 +638,10 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.GetComponent<Button>().enabled = true;
|
||||
btn.GetComponent<Button>().interactable = true;
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
Utils.SetValidate(signFormDict, r.errFieldMsg);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -886,10 +884,24 @@ public class LoginController : MonoBehaviour
|
||||
if (wxLogin2.gameObject.activeSelf) wxLogin2.gameObject.SetActive(false);
|
||||
//if (wxLogin3.gameObject.activeSelf) wxLogin3.gameObject.SetActive(false);
|
||||
pageNums = 4;
|
||||
if (wxLogin1.transform.localPosition.y == 0)
|
||||
{
|
||||
wxReturnLogin();
|
||||
}
|
||||
Canvas.ForceUpdateCanvases();
|
||||
this.StartScrollPanel(1);
|
||||
}
|
||||
|
||||
void wxReturnLogin()
|
||||
{
|
||||
wxLock = true;
|
||||
wxBrowser.LoadHTML("<div/>");
|
||||
//wxBrowser.Url = "chrome://version/";
|
||||
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
|
||||
{
|
||||
wxLock = false;
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// 立刻跳到登录页并且返回按钮强行失效
|
||||
/// </summary>
|
||||
@ -1124,9 +1136,31 @@ public class LoginController : MonoBehaviour
|
||||
void Update()
|
||||
{
|
||||
//Debug.Log($"{phone.isFocused}, ${pwd != null}, ${Input.GetKeyDown(KeyCode.Tab)}");
|
||||
if (Input.GetKeyDown(KeyCode.Tab) && loginForm !=null && loginForm.email.isFocused && loginForm.password != null)
|
||||
if (Input.GetKeyDown(KeyCode.Tab))
|
||||
{
|
||||
loginForm.password.ActivateInputField();
|
||||
if (loginForm != null && loginForm.email.isFocused && loginForm.password != null)
|
||||
{
|
||||
loginForm.password.ActivateInputField();
|
||||
}
|
||||
if (signForm != null)
|
||||
{
|
||||
if (signForm.email.isFocused)
|
||||
{
|
||||
signForm.captcha.ActivateInputField();
|
||||
}
|
||||
if (signForm.captcha.isFocused)
|
||||
{
|
||||
signForm.password.ActivateInputField();
|
||||
}
|
||||
if (signForm.password.isFocused)
|
||||
{
|
||||
signForm.cpassword.ActivateInputField();
|
||||
}
|
||||
if (signForm.cpassword.isFocused)
|
||||
{
|
||||
signForm.email.ActivateInputField();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return))
|
||||
{
|
||||
|
||||
@ -11,13 +11,14 @@ using UnityEngine.UI;
|
||||
public class DownloadController : PFUIPanel
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
Transform Button,Loading,Exit;
|
||||
Transform Btn, Loading,Exit,BtnStart;
|
||||
ScrollRect scroll;
|
||||
string path;
|
||||
[SerializeField] Transform log;
|
||||
void Start()
|
||||
{
|
||||
Button = transform.Find("Panel/BtnConfirm");
|
||||
Btn = transform.Find("Panel/BtnConfirm");
|
||||
BtnStart = transform.Find("Panel/BtnStart");
|
||||
Loading = transform.Find("Panel/LoadingContainer");
|
||||
scroll = transform.Find("Panel/Scroll View").GetComponent<ScrollRect>();
|
||||
Exit = transform.Find("Panel/Exit");
|
||||
@ -25,29 +26,39 @@ public class DownloadController : PFUIPanel
|
||||
{
|
||||
Utils.showToast(gameObject, "Please update to the latest version.");
|
||||
});
|
||||
SetType(false);
|
||||
SetType(1);
|
||||
//Button.GetComponent<Button>().enabled = false;
|
||||
//Button.GetComponent<Button>().interactable = false;
|
||||
path = Application.persistentDataPath + "/PowerFun.exe";
|
||||
UIManager.AddEvent(Button.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (b) =>
|
||||
UIManager.AddEvent(Btn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
Application.Quit();
|
||||
Utils.ExecFile(path);
|
||||
});
|
||||
UIManager.AddEvent(BtnStart.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (_base) =>
|
||||
{
|
||||
if (App.UpdateObject != null)
|
||||
{
|
||||
BtnStart.GetComponent<Button>().enabled = false;
|
||||
BtnStart.GetComponent<Button>().interactable = false;
|
||||
StartCoroutine(DownLoadExe(App.UpdateObject.Url, path, (a, b, isComplete) =>
|
||||
{
|
||||
transform.Find("Panel/LoadingContainer/Text").GetComponent<Text>().text = $"Downloaded {a.ToString("#0")}M / {b.ToString("#0")}M";// string.Format(, a, b);
|
||||
transform.Find("Panel/LoadingContainer/Loading").GetComponent<Image>().fillAmount = (float)(a / b);
|
||||
if (isComplete)
|
||||
{
|
||||
SetType(3);
|
||||
|
||||
PlayerPrefs.SetString("exeVersion", App.UpdateObject.Code);
|
||||
new FileInfo(path + ".pfdownload").MoveTo(path);
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
//transform
|
||||
if (App.UpdateObject != null)
|
||||
{
|
||||
StartCoroutine(DownLoadExe(App.UpdateObject.Url, path, (a, b, isComplete) =>
|
||||
{
|
||||
transform.Find("Panel/LoadingContainer/Text").GetComponent<Text>().text = $"Downloaded {a.ToString("#0")}M / {b.ToString("#0")}M";// string.Format(, a, b);
|
||||
transform.Find("Panel/LoadingContainer/Loading").GetComponent<Image>().fillAmount = (float)(a / b);
|
||||
if (isComplete)
|
||||
{
|
||||
SetType(true);
|
||||
PlayerPrefs.SetString("exeVersion", App.UpdateObject.Code);
|
||||
new FileInfo(path + ".pfdownload").MoveTo(path);
|
||||
}
|
||||
}));
|
||||
|
||||
for (var i = 0; i < App.UpdateObject.UpdateLog.Count; i++)
|
||||
{
|
||||
var newLog = Instantiate<Transform>(log);
|
||||
@ -96,6 +107,7 @@ public class DownloadController : PFUIPanel
|
||||
{
|
||||
File.Delete(desFileName + ".pfdownload");
|
||||
}
|
||||
SetType(2);
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||
request.Timeout = 5000;
|
||||
WebResponse response = request.GetResponse();
|
||||
@ -124,11 +136,29 @@ public class DownloadController : PFUIPanel
|
||||
}
|
||||
OnDownloadProgressEvent.Invoke(dDownloadedLength, dTotalLength, true);
|
||||
}
|
||||
void SetType(bool f)
|
||||
void SetType(int a)
|
||||
{
|
||||
// true 显示 button false 显示loading
|
||||
Button.gameObject.SetActive(f);
|
||||
Loading.gameObject.SetActive(!f);
|
||||
switch (a)
|
||||
{
|
||||
case 1:
|
||||
// true 显示 button false 显示loading
|
||||
Btn.gameObject.SetActive(false);
|
||||
Loading.gameObject.SetActive(false);
|
||||
BtnStart.gameObject.SetActive(true);
|
||||
break;
|
||||
case 2:
|
||||
Btn.gameObject.SetActive(false);
|
||||
Loading.gameObject.SetActive(true);
|
||||
BtnStart.gameObject.SetActive(false);
|
||||
break;
|
||||
case 3:
|
||||
Btn.gameObject.SetActive(true);
|
||||
Loading.gameObject.SetActive(false);
|
||||
BtnStart.gameObject.SetActive(false);
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user