Commit ad185f7b authored by saad's avatar saad

fix choose two gate at the same time

parent d1babcb1
...@@ -539,6 +539,7 @@ namespace com.al_arcade.mcq ...@@ -539,6 +539,7 @@ namespace com.al_arcade.mcq
// ─── Gate Spawning ─────────────────────────────────────────────────── // ─── Gate Spawning ───────────────────────────────────────────────────
private void SpawnGates(McqQuestion question) private void SpawnGates(McqQuestion question)
{ {
McqGateController.ResetGateLock();
var shuffled = McqHelper.Shuffle(question); var shuffled = McqHelper.Shuffle(question);
string[] answers = shuffled.answers; string[] answers = shuffled.answers;
_correctGateIndex = shuffled.correctIndex; _correctGateIndex = shuffled.correctIndex;
......
...@@ -41,6 +41,9 @@ namespace com.al_arcade.mcq ...@@ -41,6 +41,9 @@ namespace com.al_arcade.mcq
private const string colorGraph = "_Texture_Tint_Color"; private const string colorGraph = "_Texture_Tint_Color";
private static Material _sharedGateMaterial; private static Material _sharedGateMaterial;
private static bool _anyGateEnteredThisQuestion = false;
public static void ResetGateLock() => _anyGateEnteredThisQuestion = false;
public void Setup(int index, string text, bool correct) public void Setup(int index, string text, bool correct)
{ {
...@@ -245,8 +248,11 @@ namespace com.al_arcade.mcq ...@@ -245,8 +248,11 @@ namespace com.al_arcade.mcq
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
if (WasEntered) return; if (WasEntered) return;
if (_anyGateEnteredThisQuestion) return;
if (!other.CompareTag("Player") && other.GetComponent<McqPlayerRunner>() == null) return; if (!other.CompareTag("Player") && other.GetComponent<McqPlayerRunner>() == null) return;
WasEntered = true; WasEntered = true;
_anyGateEnteredThisQuestion = true;
onPlayerEnter?.Invoke(GateIndex); onPlayerEnter?.Invoke(GateIndex);
} }
......
...@@ -65,21 +65,11 @@ MonoBehaviour: ...@@ -65,21 +65,11 @@ MonoBehaviour:
- rid: 2049716550016958555 - rid: 2049716550016958555
- rid: 2049716550016958556 - rid: 2049716550016958556
- rid: 2049716550016958557 - rid: 2049716550016958557
- rid: 3240137999107752040
- rid: 3240137999107752041
m_RuntimeSettings: m_RuntimeSettings:
m_List: m_List: []
- rid: 2049716550016958528 m_AssetVersion: 10
- rid: 2049716550016958529
- rid: 2049716550016958530
- rid: 2049716550016958534
- rid: 2049716550016958536
- rid: 2049716550016958539
- rid: 2049716550016958540
- rid: 2049716550016958546
- rid: 2049716550016958547
- rid: 2049716550016958548
- rid: 2049716550016958551
- rid: 2049716550016958552
m_AssetVersion: 9
m_ObsoleteDefaultVolumeProfile: {fileID: 0} m_ObsoleteDefaultVolumeProfile: {fileID: 0}
m_RenderingLayerNames: m_RenderingLayerNames:
- Default - Default
...@@ -139,9 +129,9 @@ MonoBehaviour: ...@@ -139,9 +129,9 @@ MonoBehaviour:
m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} m_CoreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3} m_CoreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} m_SamplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3} m_TerrainDetailLit: {fileID: 0}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3} m_TerrainDetailGrassBillboard: {fileID: 0}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3} m_TerrainDetailGrass: {fileID: 0}
- rid: 2049716550016958529 - rid: 2049716550016958529
type: {class: URPDefaultVolumeProfileSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: URPDefaultVolumeProfileSettings, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
...@@ -390,3 +380,15 @@ MonoBehaviour: ...@@ -390,3 +380,15 @@ MonoBehaviour:
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3} m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3} m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3} m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
- rid: 3240137999107752040
type: {class: URPTerrainShaderSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Version: 0
m_IncludeTerrainShaders: 1
- rid: 3240137999107752041
type: {class: UniversalRenderPipelineRuntimeTerrainShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data:
m_Version: 0
m_TerrainDetailLit: {fileID: 4800000, guid: f6783ab646d374f94b199774402a5144, type: 3}
m_TerrainDetailGrassBillboard: {fileID: 4800000, guid: 29868e73b638e48ca99a19ea58c48d90, type: 3}
m_TerrainDetailGrass: {fileID: 4800000, guid: e507fdfead5ca47e8b9a768b51c291a1, type: 3}
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.burst": { "com.unity.burst": {
"version": "1.8.27", "version": "1.8.28",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment