修改反馈

This commit is contained in:
李浩 2025-04-24 10:21:49 +08:00
parent 0c7743423c
commit cec825a27c
2 changed files with 72 additions and 52 deletions

View File

@ -7,10 +7,10 @@ using System.Linq;
namespace QFramework.Example namespace QFramework.Example
{ {
public class UIInput_AnHuiBaoShiData : UIPanelData public class UIInput_AnHuiBaoShiData : UIPanelData
{ {
} }
public partial class UIInput_AnHuiBaoShi : UIPanel public partial class UIInput_AnHuiBaoShi : UIPanel
{ {
public int CurrentInputIndex;//当前索引次数 public int CurrentInputIndex;//当前索引次数
@ -23,7 +23,7 @@ namespace QFramework.Example
public string[] targetMin; // 设置最小目标值 public string[] targetMin; // 设置最小目标值
[Header("最大目标值错误次数")] [Header("最大目标值错误次数")]
public int errowIntMax = 0;//最大目标值错误次数 public int errowIntMax = 0;//最大目标值错误次数
[Header("最小目标值错误次数")] [Header("最小目标值错误次数")]
public int errowIntMin = 0;//最小目标值错误次数 public int errowIntMin = 0;//最小目标值错误次数
[Header("错误弹窗")] [Header("错误弹窗")]
@ -31,9 +31,9 @@ namespace QFramework.Example
public Button errowTipClickBtn;//错误弹窗,确认按钮 public Button errowTipClickBtn;//错误弹窗,确认按钮
private string tMP_InputField1Value= "1.770"; private string tMP_InputField1Value = "1.770";
private string tMP_InputField2Value= "1.762"; private string tMP_InputField2Value = "1.762";
private string tMP_InputField3Value = "0.008"; private string tMP_InputField3Value = "0.008";
@ -46,13 +46,33 @@ namespace QFramework.Example
public GameObject ZheSheInput;//输入三个数值的输入框 public GameObject ZheSheInput;//输入三个数值的输入框
public void OnReSet()
{
InputFieldmax.gameObject.SetActive(true);
InputFieldmin.gameObject.SetActive(true);
images[0].gameObject.SetActive(true);
images[1].gameObject.SetActive(false);
images[2].gameObject.SetActive(false);
images[3].gameObject.SetActive(false);
images[4].gameObject.SetActive(false);
tMP_InputField1.gameObject.SetActive(false);
tMP_InputField2.gameObject.SetActive(false);
tMP_InputField3.gameObject.SetActive(false);
errowTip.gameObject.SetActive(false);
CurrentInputIndex = 0;
errowIntMax = 0;
errowIntMin = 0;
}
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
mData = uiData as UIInput_AnHuiBaoShiData ?? new UIInput_AnHuiBaoShiData(); mData = uiData as UIInput_AnHuiBaoShiData ?? new UIInput_AnHuiBaoShiData();
OnReSet();
OnOpen();
}
} protected override void OnOpen(IUIData uiData = null)
protected override void OnOpen(IUIData uiData = null)
{ {
transform.SetAsLastSibling(); transform.SetAsLastSibling();
@ -81,8 +101,8 @@ namespace QFramework.Example
public void CheackAllInputField() public void CheackAllInputField()
{ {
if (tMP_InputField1.text== tMP_InputField1Value && tMP_InputField2.text == tMP_InputField2Value&& if (tMP_InputField1.text == tMP_InputField1Value && tMP_InputField2.text == tMP_InputField2Value &&
tMP_InputField3.text == tMP_InputField3Value ) tMP_InputField3.text == tMP_InputField3Value)
{ {
StringEventSystem.Global.Send("InputUI使用结束"); StringEventSystem.Global.Send("InputUI使用结束");
@ -92,7 +112,7 @@ namespace QFramework.Example
private void CheacktMP_InputField1String(string userInput) private void CheacktMP_InputField1String(string userInput)
{ {
if (userInput==tMP_InputField1Value) if (userInput == tMP_InputField1Value)
{ {
tMP_InputField1.text = tMP_InputField1Value; tMP_InputField1.text = tMP_InputField1Value;
tMP_InputField1.DeactivateInputField(); tMP_InputField1.DeactivateInputField();
@ -102,7 +122,7 @@ namespace QFramework.Example
else else
{ {
tMP_InputField1ErrowIndex++; tMP_InputField1ErrowIndex++;
if (tMP_InputField1ErrowIndex>=3) if (tMP_InputField1ErrowIndex >= 3)
{ {
tMP_InputField1.text = tMP_InputField1Value; tMP_InputField1.text = tMP_InputField1Value;
tMP_InputField1.DeactivateInputField(); tMP_InputField1.DeactivateInputField();
@ -180,9 +200,9 @@ namespace QFramework.Example
/// <param name="userInput"></param> /// <param name="userInput"></param>
private void CheckInputMax(string userInput) private void CheckInputMax(string userInput)
{ {
var v = targetMax[CurrentInputIndex].ToString(); var v = targetMax[CurrentInputIndex].ToString();
if (v != userInput) if (v != userInput)
{ {
//第3次填入正确答案 //第3次填入正确答案
if (errowIntMax >= 3) if (errowIntMax >= 3)
{ {
@ -208,7 +228,7 @@ namespace QFramework.Example
else else
{ {
Debug.Log("填写数值正确"); Debug.Log("填写数值正确");
userInput= targetMax.ToString(); userInput = targetMax.ToString();
SetNextInput(); SetNextInput();
} }
@ -232,7 +252,7 @@ namespace QFramework.Example
InputFieldmin.DeactivateInputField(); InputFieldmin.DeactivateInputField();
InputFieldmin.readOnly = true; InputFieldmin.readOnly = true;
Invoke("SetNextInput",2f); Invoke("SetNextInput", 2f);
return; return;
} }
errowIntMin++; errowIntMin++;
@ -256,21 +276,21 @@ namespace QFramework.Example
} }
} }
protected override void OnShow() protected override void OnShow()
{ {
} }
protected override void OnHide() protected override void OnHide()
{ {
StringEventSystem.Global.Send("InputUI使用结束"); StringEventSystem.Global.Send("InputUI使用结束");
} }
protected override void OnClose() protected override void OnClose()
{ {
} }
private void SetNextInput() private void SetNextInput()
{ {
if (InputFieldmax.text == targetMax[CurrentInputIndex].ToString()&& InputFieldmin.text ==targetMin[CurrentInputIndex].ToString()) if (InputFieldmax.text == targetMax[CurrentInputIndex].ToString() && InputFieldmin.text == targetMin[CurrentInputIndex].ToString())
{ {
//InputFieldmax.ActivateInputField(); //InputFieldmax.ActivateInputField();
//InputFieldmin.ActivateInputField(); //InputFieldmin.ActivateInputField();

View File

@ -30,7 +30,7 @@
<Descript> <Descript>
折射仪又称折光仪用来测定折射率、双折率、光性折射率是物质的重要物理常数之一。折射仪主要由高折射率棱镜铅玻璃或立方氧化锆、棱镜反射镜、透镜、标尺内标尺或外标尺和目镜等组成。可用于1鉴定宝石可测定RI1.35-1.81之间宝石的折射率值2可测定宝石的双折射率DR3确定宝石的轴性如一轴晶、二轴晶和各向同性等轴晶系、非晶质4确定宝石的光性符号如各向异性宝石的正光性和负光性。 折射仪又称折光仪,用来测定折射率、双折率、光性、轴性折射率是物质的重要物理常数之一。折射仪主要由高折射率棱镜铅玻璃或立方氧化锆、棱镜反射镜、透镜、标尺内标尺或外标尺和目镜等组成。可用于1鉴定宝石可测定RI1.35-1.81之间宝石的折射率值2可测定宝石的双折射率DR3确定宝石的轴性如一轴晶、二轴晶和各向同性等轴晶系、非晶质4确定宝石的光性符号如各向异性宝石的正光性和负光性。
</Descript> </Descript>
<Device> <Device>