勘误输入UIBug,统一遍历所有的输入项都正确。
This commit is contained in:
parent
233afdc488
commit
7939e8e9ce
File diff suppressed because one or more lines are too long
@ -1981,7 +1981,7 @@ GameObject:
|
||||
- component: {fileID: 965202665}
|
||||
- component: {fileID: 965202668}
|
||||
- component: {fileID: 965202667}
|
||||
- component: {fileID: 965202666}
|
||||
- component: {fileID: 965202669}
|
||||
m_Layer: 0
|
||||
m_Name: DuanBoKaiGuan
|
||||
m_TagString: Untagged
|
||||
@ -2004,28 +2004,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 780534834}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!64 &965202666
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 965202664}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 8099601409776092033, guid: 2a647b3286094514080676b300e79d16, type: 3}
|
||||
--- !u!23 &965202667
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2076,6 +2054,27 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 965202664}
|
||||
m_Mesh: {fileID: 8099601409776092033, guid: 2a647b3286094514080676b300e79d16, type: 3}
|
||||
--- !u!65 &965202669
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 965202664}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.012488214, y: 0.006884377, z: 0.0068222783}
|
||||
m_Center: {x: 0.000000019324938, y: -0.000000029918755, z: 0.00000012945381}
|
||||
--- !u!1 &986103181
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2453,7 +2452,7 @@ GameObject:
|
||||
- component: {fileID: 1094967884}
|
||||
- component: {fileID: 1094967887}
|
||||
- component: {fileID: 1094967886}
|
||||
- component: {fileID: 1094967885}
|
||||
- component: {fileID: 1094967888}
|
||||
m_Layer: 0
|
||||
m_Name: ChangBoKaiGuan
|
||||
m_TagString: Untagged
|
||||
@ -2476,28 +2475,6 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1984428161}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!64 &1094967885
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1094967883}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 5497570412216542575, guid: 2a647b3286094514080676b300e79d16, type: 3}
|
||||
--- !u!23 &1094967886
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2548,6 +2525,27 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1094967883}
|
||||
m_Mesh: {fileID: 5497570412216542575, guid: 2a647b3286094514080676b300e79d16, type: 3}
|
||||
--- !u!65 &1094967888
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1094967883}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 0.013029096, y: 0.006884377, z: 0.0065968544}
|
||||
m_Center: {x: 0.000000019324938, y: -0.00000002991876, z: 0.000000010244552}
|
||||
--- !u!1 &1111279766
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -126,27 +126,49 @@ namespace QFramework.Example
|
||||
}
|
||||
public bool Check()
|
||||
{
|
||||
bool allCorrect = true; // 初始化一个标志,用于跟踪所有输入是否都正确
|
||||
|
||||
foreach (var item in mData.inputs)
|
||||
{
|
||||
var list = item.answer.Split('|').ToList();
|
||||
string[] list = item.answer.Split('|');
|
||||
|
||||
if (string.IsNullOrEmpty(item.var))
|
||||
{
|
||||
Transform trans = InputContent.transform.Find(item.name);
|
||||
string inputStr = trans.Find("Input").GetComponent<TMP_InputField>().text;
|
||||
if (list.Contains(inputStr))
|
||||
Debug.Log(item.var);
|
||||
|
||||
bool currentCorrect = false; // 标记当前输入是否正确
|
||||
|
||||
for (int i = 0; i < list.Length; i++)
|
||||
{
|
||||
return true;
|
||||
if (inputStr.Equals(list[i]))
|
||||
{
|
||||
currentCorrect = true;
|
||||
break; // 找到匹配项后跳出循环
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentCorrect) // 如果当前输入不正确
|
||||
{
|
||||
allCorrect = false; // 标记为有错误
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list.Contains(VarController.Instance.Get(item.var).ToString()))
|
||||
Debug.Log(item.var);
|
||||
Debug.Log("!!!!" + VarController.Instance.Get(item.var).ToString() + "!!!!");
|
||||
|
||||
if (!list.Contains(VarController.Instance.Get(item.var).ToString()))
|
||||
{
|
||||
return true;
|
||||
Debug.Log("????" + VarController.Instance.Get(item.var).ToString() + "????");
|
||||
allCorrect = false; // 变量值不匹配时标记为有错误
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return allCorrect; // 返回所有输入是否都正确的结果
|
||||
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
|
||||
@ -242,7 +242,7 @@
|
||||
<Action type="HighLightFlash" value="ChangJing/SM_MiDuYi/SM_WenDing" isHigh="false"></Action>
|
||||
|
||||
<Action type="Input" title="请输入" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="测定的数值:" var="变量1" answer="2.6380"></Input>
|
||||
<Input name="测定的数值:" var="变量1" answer="2.64"></Input>
|
||||
<Btn name="确定" clickEvent="确定点击" checkAnswer="true" wrongLabel="输入错误" wrongCount="3" autoHide="1" ></Btn>
|
||||
|
||||
</Action>
|
||||
@ -250,7 +250,7 @@
|
||||
<Condition type="StrEvent" value="UI关闭事件通知用StrEvent接收"></Condition>
|
||||
|
||||
|
||||
<Action type="Led" value="CustomParent/DiZuoxianshipin" number="2.6380" color="0,0,0,255"></Action>
|
||||
<Action type="Led" value="CustomParent/DiZuoxianshipin" number="2.64" color="0,0,0,255"></Action>
|
||||
<Action type="TipWindow" value="恭喜你完成当前模块" btns="确定" audio=""></Action>
|
||||
<Condition type="UIClick" value="UIRoot/PopUI/UITipWindow/Mask/Connnet/BtnContent/确定"></Condition>
|
||||
</Action>
|
||||
|
||||
@ -169,17 +169,17 @@
|
||||
<Action type="TimeLine" value="TimeLines/ChangBoKaiGuanKaiQi" isShow="true" finishedEvent="播放完毕" isWait="true" frame="0" endFrame="60"></Action>
|
||||
<Action type="Delay" value="2"></Action>
|
||||
<!--视角遮光罩-->
|
||||
<Action type="Move" value="FlyCamera" to="-0.296000004,1.43799996,2.31599998" time="0"></Action>
|
||||
<Action type="Rotate" value="FlyCamera" to="74.2322311,359.778748,1.22730043e-07" time="0"></Action>
|
||||
<Action type="Move" value="FlyCamera" to="-0.375,1.5023,2.2641" time="0"></Action>
|
||||
<Action type="Rotate" value="FlyCamera" to="60,358.1117,1.067217E-07" time="0"></Action>
|
||||
<!--显示影像,观察影像-->
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_Deng_ZW/YingXiangCanvas" isShow="true"></Action>
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_Deng_ZW/YingXiangCanvas/Image" isShow="true"></Action>
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_Deng_ZW/YingXiangCanvas/Image (1)" isShow="false"></Action>
|
||||
|
||||
|
||||
<Action type="Input" title="请输入" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="观察后长波的强度:" var="变量1" answer="中"></Input>
|
||||
<Input name="观察后长波的颜色:" var="变量2" answer="绿色"></Input>
|
||||
<Action type="Input" title="请输入观察后,长波的强度,颜色" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="强度:" var="长波的强度" answer="中"></Input>
|
||||
<Input name="颜色:" var="长波的颜色" answer="绿色"></Input>
|
||||
|
||||
<Btn name="确定" clickEvent="确定点击" checkAnswer="true" wrongLabel="输入错误" wrongCount="3" autoHide="1" ></Btn>
|
||||
|
||||
@ -228,7 +228,7 @@
|
||||
|
||||
<!--暂时只能输入一个-->
|
||||
<Action type="Input" title="请输入" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="紫外荧光灯短波数值:" var="变量1" answer="253.7|254"></Input>
|
||||
<Input name="紫外荧光灯短波数值:" var="短波数值" answer="253.7|254"></Input>
|
||||
|
||||
<Btn name="确定" clickEvent="确定点击" checkAnswer="true" wrongLabel="输入错误" wrongCount="3" autoHide="1" ></Btn>
|
||||
|
||||
@ -238,13 +238,19 @@
|
||||
<Action type="Any">
|
||||
<Action type="Sequence">
|
||||
|
||||
<Condition type="Var" name="变量1" value="253.7"></Condition>
|
||||
<Condition type="Var" name="短波数值" value="253.7"></Condition>
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_DengDi/Canvas (1)/253.7" isShow="true" ></Action>
|
||||
|
||||
</Action>
|
||||
<Action type="Sequence">
|
||||
|
||||
<Condition type="Var" name="变量1" value="254"></Condition>
|
||||
<Condition type="Var" name="短波数值" value="254"></Condition>
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_DengDi/Canvas (1)/254" isShow="true" ></Action>
|
||||
|
||||
</Action>
|
||||
<Action type="Sequence">
|
||||
|
||||
<Condition type="Var" name="短波数值" value="0"></Condition>
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_DengDi/Canvas (1)/254" isShow="true" ></Action>
|
||||
|
||||
</Action>
|
||||
@ -281,21 +287,22 @@
|
||||
<Action type="TimeLine" value="TimeLines/DuanBoKaiGuanKaiQi" isShow="true" finishedEvent="播放完毕" isWait="true" frame="0" endFrame="60"></Action>
|
||||
<Action type="Delay" value="2"></Action>
|
||||
<!--视角遮光罩-->
|
||||
<Action type="Move" value="FlyCamera" to="-0.296000004,1.43799996,2.31599998" time="0"></Action>
|
||||
<Action type="Rotate" value="FlyCamera" to="74.2322311,359.778748,1.22730043e-07" time="0"></Action>
|
||||
<Action type="Move" value="FlyCamera" to="-0.375,1.5023,2.2641" time="0"></Action>
|
||||
<Action type="Rotate" value="FlyCamera" to="60,358.1117,1.067217E-07" time="0"></Action>
|
||||
<!--显示影像-->
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_Deng_ZW/YingXiangCanvas/Image" isShow="false"></Action>
|
||||
|
||||
<Action type="Show" value="Main/SM_ZiWaiYingGuangDeng (1)/SM_Deng_ZW/YingXiangCanvas/Image (1)" isShow="true"></Action>
|
||||
|
||||
<Action type="Input" title="请输入" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="观察后短波的强度:" var="变量1" answer="强"></Input>
|
||||
<Input name="观察后短波的颜色:" var="变量2" answer="绿色"></Input>
|
||||
<Action type="Input" title="请输入观察后,短波的强度" finishedEvent="UI关闭事件通知用StrEvent接收">
|
||||
<Input name="强度:" answer="强|强度"></Input>
|
||||
<Input name="颜色:" answer="绿色|绿"></Input>
|
||||
|
||||
<Btn name="确定" clickEvent="确定点击" checkAnswer="true" wrongLabel="输入错误" wrongCount="3" autoHide="1" ></Btn>
|
||||
|
||||
</Action>
|
||||
<Condition type="StrEvent" value="UI关闭事件通知用StrEvent接收"></Condition>
|
||||
|
||||
<Action type="Delay" value="2"></Action>
|
||||
<Action type="NextOperation"></Action>
|
||||
</Action>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user