Skip to content

Commit 2e86062

Browse files
committed
FINAL FIX
1 parent 0e14d14 commit 2e86062

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

Assets/Scripts/MainGame/Interaction.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,21 @@ private void FixedUpdate()
123123
{
124124
if (OtherObject != null)
125125
{
126-
if (Mission.Id == null || Mission.Id < 10)
126+
if (Variables.MissionList.Find(Mission => Mission.Id == Variables.CurrentMissionID).ObjetName == OtherObject.name)
127127
{
128-
if (Variables.MissionList.Find(Mission => Mission.Id == Variables.CurrentMissionID).ObjetName == OtherObject.name)
128+
InteractionText.SetActive(true);
129+
Debug.Log("I am a door");
130+
if (Input.GetKeyDown(KeyCode.E))
129131
{
130-
InteractionText.SetActive(true);
131-
Debug.Log("I am a door");
132-
if (Input.GetKeyDown(KeyCode.E))
133-
{
134-
Showpopup();
135-
}
132+
Showpopup();
136133
}
137134
}
135+
136+
if (Variables.CurrentMissionID >= 10)
137+
{
138+
bs.FadeIn();
139+
SceneManager.LoadSceneAsync("EndGame");
140+
}
138141
}
139142
Mission FirstMission = Variables.MissionList.Find(mission => mission.Id == 0);
140143

@@ -156,12 +159,6 @@ private void FixedUpdate()
156159

157160
MissionNameText.text = Variables.MissionList.Find(mission => mission.Id == Variables.CurrentMissionID).Title;
158161

159-
if (Variables.CurrentMissionID >= 10)
160-
{
161-
bs.FadeIn();
162-
SceneManager.LoadSceneAsync("EndGame");
163-
}
164-
165162
Debug.Log(Mission.Id);
166163
}
167164

@@ -210,7 +207,11 @@ private void AfterConfirmation(bool choice)
210207
ChoiceWindow.SetActive(false);
211208
ChoiceWindowtwo.SetActive(true);
212209
ShowpopupSecondaire(choice);
213-
//TODO : fondu au noir ici elipse
210+
if (Variables.CurrentMissionID > 9)
211+
{
212+
bs.FadeIn();
213+
SceneManager.LoadSceneAsync("EndGame");
214+
}
214215
}
215216

216217
private void Showpopup()

0 commit comments

Comments
 (0)