修改宝石BUG

This commit is contained in:
马铖荣 2025-06-03 09:19:44 +08:00
parent fecb666b08
commit 9b96fc89c2
2 changed files with 32 additions and 31 deletions

View File

@ -13,22 +13,22 @@ namespace QFramework.Example
public partial class UIInput_AnHuiBaoShi : UIPanel
{
public int CurrentInputIndex;//当前索引次数
[Header("所有的图片")]
public int CurrentInputIndex;//当前索引次数
[Header("所有的图片")]
public Image[] images;
[Header("设置最大目标值")]
public string[] targetMax; // 设置最大目标值
[Header("设置最小目标值")]
public string[] targetMin; // 设置最小目标值
[Header("设置最大目标值")]
public string[] targetMax; // 设置最大目标值
[Header("设置最小目标值")]
public string[] targetMin; // 设置最小目标值
[Header("最大目标值错误次数")]
public int errowIntMax = 0;//最大目标值错误次数
[Header("最小目标值错误次数")]
public int errowIntMin = 0;//最小目标值错误次数
[Header("错误弹窗")]
public GameObject errowTip;//错误弹窗
public Button errowTipClickBtn;//错误弹窗,确认按钮
[Header("最大目标值错误次数")]
public int errowIntMax = 0;//最大目标值错误次数
[Header("最小目标值错误次数")]
public int errowIntMin = 0;//最小目标值错误次数
[Header("错误弹窗")]
public GameObject errowTip;//错误弹窗
public Button errowTipClickBtn;//错误弹窗,确认按钮
private string tMP_InputField1Value = "1.770";
@ -43,7 +43,7 @@ namespace QFramework.Example
public GameObject ZheSheInput;//输入三个数值的输入框
public GameObject ZheSheInput;//输入三个数值的输入框
@ -70,8 +70,13 @@ namespace QFramework.Example
mData = uiData as UIInput_AnHuiBaoShiData ?? new UIInput_AnHuiBaoShiData();
OnReSet();
OnOpen();
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
}
public void OnModuleQuit(OnModuleQuit arg)
{
Hide();
}
protected override void OnOpen(IUIData uiData = null)
{
@ -108,7 +113,7 @@ namespace QFramework.Example
tMP_InputField3.text == tMP_InputField3Value)
{
StringEventSystem.Global.Send("InputUI使用结束");
StringEventSystem.Global.Send("InputUI使用结束");
}
}
@ -198,7 +203,7 @@ namespace QFramework.Example
}
/// <summary>
/// 输入最大值
/// 输入最大值
/// </summary>
/// <param name="userInput"></param>
private void CheckInputMax(string userInput)
@ -206,7 +211,7 @@ namespace QFramework.Example
var v = targetMax[CurrentInputIndex].ToString();
if (v != userInput)
{
//第3次填入正确答案
//第3次填入正确答案
if (errowIntMax >= 3)
{
@ -227,10 +232,10 @@ namespace QFramework.Example
}
//正确++
//正确++
else
{
Debug.Log("填写数值正确");
Debug.Log("填写数值正确");
userInput = targetMax.ToString();
SetNextInput();
@ -238,7 +243,7 @@ namespace QFramework.Example
}
/// <summary>
/// 输入最小值
/// 输入最小值
/// </summary>
/// <param name="userInput"></param>
private void CheckInputMin(string userInput)
@ -247,7 +252,7 @@ namespace QFramework.Example
var v = targetMin[CurrentInputIndex].ToString();
if (v != userInput)
{
//第四次,填入正确答案
//第四次,填入正确答案
if (errowIntMin >= 3)
{
@ -269,10 +274,10 @@ namespace QFramework.Example
}
//正确++
//正确++
else
{
Debug.Log("填写数值正确");
Debug.Log("填写数值正确");
userInput = targetMax.ToString();
SetNextInput();
@ -284,9 +289,10 @@ namespace QFramework.Example
protected override void OnHide()
{
StringEventSystem.Global.Send("InputUI使用结束");
StringEventSystem.Global.Send("InputUI使用结束");
}
protected override void OnClose()
{
}
@ -297,7 +303,7 @@ namespace QFramework.Example
{
//InputFieldmax.ActivateInputField();
//InputFieldmin.ActivateInputField();
//重置
//重置
errowTip.gameObject.SetActive(false);
errowIntMax = 0;
errowIntMin = 0;
@ -316,7 +322,7 @@ namespace QFramework.Example
if (CurrentInputIndex < images.Length)
{
// 先递增索引
// 先递增索引
foreach (var item in images)
{

View File

@ -98,10 +98,6 @@ namespace QFramework.Example
TypeEventSystem.Global.Send<OnLoadingHide>(new OnLoadingHide());
});
}
}
@ -131,7 +127,6 @@ namespace QFramework.Example
}
UIKit.OpenPanelAsync<UIRightTop>(canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() =>
{
TypeEventSystem.Global.Send<OnModuleStart>();
TypeEventSystem.Global.Send<OnLoadingHide>();
Hide();