net.dreditor.minigames.bs 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.attestation.p7m +0 -0
  2. package/BlackenedManager.cs +427 -427
  3. package/BlackenedManager.cs.meta +11 -11
  4. package/BlackenedManagerBase.cs +162 -162
  5. package/BlackenedManagerBase.cs.meta +11 -11
  6. package/BlackenedNameScroller.cs +89 -89
  7. package/BlackenedNameScroller.cs.meta +11 -11
  8. package/BlackenedSelectBuilder.cs +30 -30
  9. package/BlackenedSelectBuilder.cs.meta +11 -11
  10. package/BlackenedSelectBuilderEditor.cs +264 -264
  11. package/BlackenedSelectBuilderEditor.cs.meta +11 -11
  12. package/BlackenedSelectData.cs +52 -52
  13. package/BlackenedSelectData.cs.meta +11 -11
  14. package/ColoredNameScoller.cs +151 -151
  15. package/ColoredNameScoller.cs.meta +11 -11
  16. package/DREditor.Minigames.BS.asmdef +21 -21
  17. package/DREditor.Minigames.BS.asmdef.meta +7 -7
  18. package/{Samples → Samples~}/BS_Main_UI_Group_Shell.prefab +57 -57
  19. package/{Samples → Samples~}/BS_Main_UI_Group_Shell.prefab.meta +7 -7
  20. package/{Samples → Samples~}/BS_Main_UI_Group_Template.prefab +488 -488
  21. package/{Samples → Samples~}/BS_Main_UI_Group_Template.prefab.meta +7 -7
  22. package/{Samples → Samples~}/BS_Manager_Shell.prefab +119 -119
  23. package/{Samples → Samples~}/BS_Manager_Shell.prefab.meta +7 -7
  24. package/{Samples → Samples~}/BS_Manager_Template.prefab +367 -367
  25. package/{Samples → Samples~}/BS_Manager_Template.prefab.meta +7 -7
  26. package/{Samples → Samples~}/Blackened_Select_Canvas_Shell.prefab +144 -144
  27. package/{Samples → Samples~}/Blackened_Select_Canvas_Shell.prefab.meta +7 -7
  28. package/{Samples → Samples~}/Blackened_Select_Canvas_Template.prefab +495 -495
  29. package/{Samples → Samples~}/Blackened_Select_Canvas_Template.prefab.meta +7 -7
  30. package/package.json +43 -38
  31. package/package.json.meta +7 -7
  32. package/Samples.meta +0 -8
@@ -1,428 +1,428 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Cameras;
3
- using DREditor.Characters;
4
- using DREditor.Minigames.Stats;
5
- using DREditor.Services;
6
- using DREditor.UIHandling;
7
- using System.Collections;
8
- using UnityEngine;
9
- using UnityEngine.Events;
10
- using UnityEngine.InputSystem;
11
- using static UnityEngine.InputSystem.InputAction;
12
-
13
- namespace DREditor.Minigames.BS
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- [ClassHeader(nameof(BlackenedManagerBase) + ", " +nameof(MinigameManagerBase) + ", " +
19
- "\n\n")]
20
- public class BlackenedManager : BlackenedManagerBase
21
- {
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Header("")]
26
- [Divider]
27
- [Tooltip("")]
28
- [SerializeField] protected bool debug = false;
29
-
30
- /// <summary>
31
- ///
32
- /// </summary>
33
- [Tooltip("")]
34
- [SerializeField] protected float debugbufferTime = 1;
35
-
36
- /// <summary>
37
- ///
38
- /// </summary>
39
- [Tooltip("")]
40
- [SerializeField] protected BlackenedSelectBuilder builder = null;
41
-
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- [Header("")]
47
- [Divider]
48
- [Tooltip("")]
49
- [SerializeField] protected UIVisibilityComponent minigameUI = null;
50
-
51
- /// <summary>
52
- ///
53
- /// </summary>
54
- [Tooltip("")]
55
- [SerializeField] protected UIVisibilityComponent selectionUI = null;
56
-
57
- /// <summary>
58
- ///
59
- /// </summary>
60
- [Tooltip("")]
61
- [SerializeField] protected UIVisibilityComponent answerUI = null;
62
-
63
- /// <summary>
64
- ///
65
- /// </summary>
66
- [Tooltip("")]
67
- [SerializeField] protected float menuFadeWaitTime = 0.25f;
68
-
69
- /// <summary>
70
- ///
71
- /// </summary>
72
- [Tooltip("")]
73
- [SerializeField] protected float removeOffsetBufferDuration = 1;
74
-
75
- /// <summary>
76
- ///
77
- /// </summary>
78
- [Tooltip("")]
79
- [SerializeField] protected float moveStallDuration = 0.3f;
80
-
81
-
82
- [Header("")]
83
- [Divider]
84
- [Header("")]
85
- [SerializeField] protected UnityEvent OnMinigameStarted;
86
-
87
- [Header("")]
88
- [SerializeField] protected UnityEvent OnShowVisuals;
89
-
90
- [Header("")]
91
- [SerializeField] protected UnityEvent OnHideVisuals;
92
-
93
- [Header("")]
94
- [SerializeField] protected UnityEvent<string> OnChangeSelection;
95
-
96
- [Header("")]
97
- [SerializeField] protected UnityEvent OnSelected;
98
-
99
- [Header("")]
100
- [SerializeField] protected UnityEvent OnCorrectSelected;
101
-
102
-
103
- /// <summary>
104
- ///
105
- /// </summary>
106
- protected DRTrialCamera trialCamera;
107
-
108
- /// <summary>
109
- ///
110
- /// </summary>
111
- protected TrialStatsBase TrialStats;
112
-
113
-
114
- #region Initialization
115
-
116
- /// <summary>
117
- ///
118
- /// </summary>
119
- protected virtual void Start()
120
- {
121
- InitializeTrialCamera();
122
-
123
- if (debug && builder != null)
124
- PlayBlackenedSelect(builder);
125
-
126
- TrialStats = ServiceLocator.GetService<TrialStatsBase>();
127
- }
128
-
129
- /// <summary>
130
- ///
131
- /// </summary>
132
- protected virtual void InitializeTrialCamera()
133
- {
134
- if (trialCamera == null)
135
- {
136
- trialCamera = FindAnyObjectByType<DRTrialCamera>();
137
-
138
- trialCamera.SmoothFocus = true;
139
- }
140
- }
141
-
142
- /// <summary>
143
- ///
144
- /// </summary>
145
- /// <param name="obj"></param>
146
- /// <remarks></remarks>
147
- public void PlayMinigame(ScriptableObject obj)
148
- => FindAnyObjectByType<BlackenedManager>().PlayBlackenedSelect((BlackenedSelectBuilder)obj);
149
-
150
- /// <summary>
151
- ///
152
- /// </summary>
153
- /// <param name="asset"></param>
154
- protected virtual void PlayBlackenedSelect(BlackenedSelectBuilder asset)
155
- {
156
- builder = asset;
157
-
158
- StartCoroutine(BlackenedSelectStartRoutine());
159
- }
160
-
161
- /// <summary>
162
- ///
163
- /// </summary>
164
- /// <returns></returns>
165
- protected virtual IEnumerator BlackenedSelectStartRoutine()
166
- {
167
- if (debug)
168
- yield return new WaitForSeconds(debugbufferTime);
169
-
170
- OnMinigameStarted?.Invoke();
171
-
172
- InitializeTrialCamera();
173
-
174
- trialCamera.TriggerAnim(trialCamera.SeatFocus + cameraPositionOffset);
175
-
176
- if (minigameUI != null)
177
- yield return minigameUI.ShowTillComplete();
178
-
179
- Initialize();
180
- }
181
-
182
- /// <summary>
183
- ///
184
- /// </summary>
185
- protected virtual void Initialize()
186
- {
187
- currentControlsKey.SetValue(controlsKey);
188
-
189
- if (TrialTimer != null)
190
- TrialTimer.ShowInitialize(builder.times, false);
191
-
192
- if (questionToggle != null)
193
- questionToggle.Initialize(builder.questionText);
194
-
195
- InvokeChangedSelection();
196
-
197
- ActivateControls();
198
- }
199
-
200
- #endregion
201
-
202
- #region Move Select
203
-
204
- /// <inheritdoc/>
205
- protected override void MoveSelect(CallbackContext ctx)
206
- {
207
- Vector2 value = move.action.ReadValue<Vector2>();
208
-
209
- if (moving || value.x == 0)
210
- return;
211
-
212
- moving = true;
213
-
214
- DeactivateControls();
215
-
216
- if (value.x > 0)
217
- {
218
- // move right
219
- if ((trialCamera.SeatFocus - cameraPositionOffset + 1) > trialCamera.CharHeightOffset.Length - 1)
220
- trialCamera.SeatFocus = 0 + cameraPositionOffset;
221
- else
222
- trialCamera.SeatFocus += 1;
223
- }
224
- else if (value.x < 0)
225
- {
226
- //move left
227
- if ((trialCamera.SeatFocus - cameraPositionOffset - 1) < 0)
228
- trialCamera.SeatFocus = trialCamera.CharHeightOffset.Length - 1 + cameraPositionOffset;
229
- else
230
- trialCamera.SeatFocus -= 1;
231
- }
232
-
233
- StartCoroutine(MoveStall());
234
-
235
- InvokeChangedSelection();
236
- }
237
-
238
- /// <summary>
239
- ///
240
- /// </summary>
241
- /// <returns></returns>
242
- protected virtual IEnumerator MoveStall()
243
- {
244
- yield return new WaitForSeconds(moveStallDuration);
245
-
246
- ActivateControls();
247
-
248
- moving = false;
249
-
250
- yield break;
251
- }
252
-
253
- /// <summary>
254
- ///
255
- /// </summary>
256
- protected virtual void InvokeChangedSelection() => OnChangeSelection?.Invoke(GetHoveredCharacterData()?.characterName);
257
-
258
- /// <summary>
259
- ///
260
- /// </summary>
261
- /// <returns></returns>
262
- protected virtual BlackenedSelectData GetHoveredCharacterData()
263
- {
264
- foreach (var data in builder.selectDatas)
265
- if (Mathf.RoundToInt(trialCamera.SeatFocus) == characterDatabase.GetCharacter(data.characterName).TrialPosition)
266
- return data;
267
-
268
- UnityEngine.Debug.LogError("The Character could not be found! " + trialCamera.SeatFocus);
269
-
270
- return null;
271
- }
272
-
273
- #endregion
274
-
275
- #region Select Character Resolve Minigame
276
-
277
- /// <inheritdoc/>
278
- protected override void SelectCharacter(CallbackContext ctx)
279
- {
280
- DeactivateControls();
281
-
282
- TrialTimer.PauseTimer();
283
-
284
- HideVisuals();
285
-
286
- OnSelected?.Invoke();
287
-
288
- StartCoroutine(SelectCharacterRoutine());
289
- }
290
-
291
- /// <summary>
292
- ///
293
- /// </summary>
294
- /// <returns></returns>
295
- protected virtual IEnumerator SelectCharacterRoutine()
296
- {
297
- if (minigameUI != null)
298
- minigameUI.Hide();
299
-
300
- yield return new WaitForSeconds(removeOffsetBufferDuration);
301
-
302
- if (Mathf.RoundToInt(trialCamera.SeatFocus) >= trialCamera.CharHeightOffset.Length)
303
- trialCamera.SeatFocus = 0;
304
-
305
- trialCamera.SeatFocus = Mathf.RoundToInt(trialCamera.SeatFocus);
306
-
307
- if (minigameUI != null)
308
- yield return minigameUI.WaitForChangeToComplete();
309
-
310
- trialCamera.SmoothFocus = false;
311
-
312
- if (GetHoveredCharacterData() is BlackenedSelectData data)
313
- {
314
- if (data.isAnswer)
315
- StartCoroutine(ResolveMinigame());
316
- else
317
- TrialMistake(data.fuckUpDialogue);
318
- }
319
- }
320
-
321
- /// <inheritdoc/>
322
- public override IEnumerator ResolveMinigame()
323
- {
324
- if (TrialTimer != null)
325
- TrialTimer.HideStop();
326
-
327
- OnCorrectSelected?.Invoke();
328
-
329
- if (selectionUI != null)
330
- yield return selectionUI.ShowTillComplete();
331
-
332
- yield return new WaitForSeconds(menuFadeWaitTime);
333
-
334
- if (answerUI != null)
335
- yield return answerUI.ShowTillComplete();
336
-
337
- yield return base.ResolveMinigame();
338
-
339
- yield break;
340
- }
341
-
342
- #endregion
343
-
344
- #region Time Up, Player Death, Restart Minigame
345
-
346
- /// <inheritdoc/>
347
- protected override void OnTimeUp()
348
- {
349
- DeactivateControls();
350
-
351
- HideVisuals();
352
-
353
- base.OnTimeUp();
354
- }
355
-
356
- /// <inheritdoc/>
357
- protected override void Restart()
358
- {
359
- UnityEngine.Debug.Log("Restart Called");
360
-
361
- ShowVisuals();
362
-
363
- InvokeChangedSelection();
364
-
365
- StartCoroutine(ResolveRestart());
366
- }
367
-
368
- /// <summary>
369
- ///
370
- /// </summary>
371
- protected virtual void ShowVisuals()
372
- {
373
- if (questionToggle != null)
374
- questionToggle.Activate();
375
-
376
- if (TrialTimer != null)
377
- TrialTimer.Show();
378
-
379
- if (TrialTimer != null)
380
- TrialTimer.Restart();
381
-
382
- if (TrialStats != null)
383
- TrialStats.ShowTrialStats();
384
-
385
- if (minigameUI != null)
386
- minigameUI.Show();
387
-
388
- trialCamera.TriggerAnim(trialCamera.SeatFocus + cameraPositionOffset);
389
-
390
- trialCamera.SmoothFocus = true;
391
-
392
- OnShowVisuals?.Invoke();
393
- }
394
-
395
- /// <summary>
396
- ///
397
- /// </summary>
398
- protected virtual void HideVisuals()
399
- {
400
- if (questionToggle != null)
401
- questionToggle.Deactivate();
402
-
403
- if (TrialTimer != null)
404
- TrialTimer.Hide();
405
-
406
- if (TrialStats != null)
407
- TrialStats.HideTrialStats();
408
-
409
- if (minigameUI != null)
410
- minigameUI.Hide();
411
-
412
- OnHideVisuals?.Invoke();
413
- }
414
-
415
- /// <summary>
416
- ///
417
- /// </summary>
418
- protected virtual IEnumerator ResolveRestart()
419
- {
420
- if (minigameUI != null)
421
- yield return minigameUI.WaitForChangeToComplete();
422
-
423
- ActivateControls();
424
- }
425
-
426
- #endregion
427
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Cameras;
3
+ using DREditor.Characters;
4
+ using DREditor.Minigames.Stats;
5
+ using DREditor.Services;
6
+ using DREditor.UIHandling;
7
+ using System.Collections;
8
+ using UnityEngine;
9
+ using UnityEngine.Events;
10
+ using UnityEngine.InputSystem;
11
+ using static UnityEngine.InputSystem.InputAction;
12
+
13
+ namespace DREditor.Minigames.BS
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [ClassHeader(nameof(BlackenedManagerBase) + ", " +nameof(MinigameManagerBase) + ", " +
19
+ "\n\n")]
20
+ public class BlackenedManager : BlackenedManagerBase
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Header("")]
26
+ [Divider]
27
+ [Tooltip("")]
28
+ [SerializeField] protected bool debug = false;
29
+
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ [Tooltip("")]
34
+ [SerializeField] protected float debugbufferTime = 1;
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ [Tooltip("")]
40
+ [SerializeField] protected BlackenedSelectBuilder builder = null;
41
+
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ [Header("")]
47
+ [Divider]
48
+ [Tooltip("")]
49
+ [SerializeField] protected UIVisibilityComponent minigameUI = null;
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ [Tooltip("")]
55
+ [SerializeField] protected UIVisibilityComponent selectionUI = null;
56
+
57
+ /// <summary>
58
+ ///
59
+ /// </summary>
60
+ [Tooltip("")]
61
+ [SerializeField] protected UIVisibilityComponent answerUI = null;
62
+
63
+ /// <summary>
64
+ ///
65
+ /// </summary>
66
+ [Tooltip("")]
67
+ [SerializeField] protected float menuFadeWaitTime = 0.25f;
68
+
69
+ /// <summary>
70
+ ///
71
+ /// </summary>
72
+ [Tooltip("")]
73
+ [SerializeField] protected float removeOffsetBufferDuration = 1;
74
+
75
+ /// <summary>
76
+ ///
77
+ /// </summary>
78
+ [Tooltip("")]
79
+ [SerializeField] protected float moveStallDuration = 0.3f;
80
+
81
+
82
+ [Header("")]
83
+ [Divider]
84
+ [Header("")]
85
+ [SerializeField] protected UnityEvent OnMinigameStarted;
86
+
87
+ [Header("")]
88
+ [SerializeField] protected UnityEvent OnShowVisuals;
89
+
90
+ [Header("")]
91
+ [SerializeField] protected UnityEvent OnHideVisuals;
92
+
93
+ [Header("")]
94
+ [SerializeField] protected UnityEvent<string> OnChangeSelection;
95
+
96
+ [Header("")]
97
+ [SerializeField] protected UnityEvent OnSelected;
98
+
99
+ [Header("")]
100
+ [SerializeField] protected UnityEvent OnCorrectSelected;
101
+
102
+
103
+ /// <summary>
104
+ ///
105
+ /// </summary>
106
+ protected DRTrialCamera trialCamera;
107
+
108
+ /// <summary>
109
+ ///
110
+ /// </summary>
111
+ protected TrialStatsBase TrialStats;
112
+
113
+
114
+ #region Initialization
115
+
116
+ /// <summary>
117
+ ///
118
+ /// </summary>
119
+ protected virtual void Start()
120
+ {
121
+ InitializeTrialCamera();
122
+
123
+ if (debug && builder != null)
124
+ PlayBlackenedSelect(builder);
125
+
126
+ TrialStats = ServiceLocator.GetService<TrialStatsBase>();
127
+ }
128
+
129
+ /// <summary>
130
+ ///
131
+ /// </summary>
132
+ protected virtual void InitializeTrialCamera()
133
+ {
134
+ if (trialCamera == null)
135
+ {
136
+ trialCamera = FindAnyObjectByType<DRTrialCamera>();
137
+
138
+ trialCamera.SmoothFocus = true;
139
+ }
140
+ }
141
+
142
+ /// <summary>
143
+ ///
144
+ /// </summary>
145
+ /// <param name="obj"></param>
146
+ /// <remarks></remarks>
147
+ public void PlayMinigame(ScriptableObject obj)
148
+ => FindAnyObjectByType<BlackenedManager>().PlayBlackenedSelect((BlackenedSelectBuilder)obj);
149
+
150
+ /// <summary>
151
+ ///
152
+ /// </summary>
153
+ /// <param name="asset"></param>
154
+ protected virtual void PlayBlackenedSelect(BlackenedSelectBuilder asset)
155
+ {
156
+ builder = asset;
157
+
158
+ StartCoroutine(BlackenedSelectStartRoutine());
159
+ }
160
+
161
+ /// <summary>
162
+ ///
163
+ /// </summary>
164
+ /// <returns></returns>
165
+ protected virtual IEnumerator BlackenedSelectStartRoutine()
166
+ {
167
+ if (debug)
168
+ yield return new WaitForSeconds(debugbufferTime);
169
+
170
+ OnMinigameStarted?.Invoke();
171
+
172
+ InitializeTrialCamera();
173
+
174
+ trialCamera.TriggerAnim(trialCamera.SeatFocus + cameraPositionOffset);
175
+
176
+ if (minigameUI != null)
177
+ yield return minigameUI.ShowTillComplete();
178
+
179
+ Initialize();
180
+ }
181
+
182
+ /// <summary>
183
+ ///
184
+ /// </summary>
185
+ protected virtual void Initialize()
186
+ {
187
+ currentControlsKey.SetValue(controlsKey);
188
+
189
+ if (TrialTimer != null)
190
+ TrialTimer.ShowInitialize(builder.times, false);
191
+
192
+ if (questionToggle != null)
193
+ questionToggle.Initialize(builder.questionText);
194
+
195
+ InvokeChangedSelection();
196
+
197
+ ActivateControls();
198
+ }
199
+
200
+ #endregion
201
+
202
+ #region Move Select
203
+
204
+ /// <inheritdoc/>
205
+ protected override void MoveSelect(CallbackContext ctx)
206
+ {
207
+ Vector2 value = move.action.ReadValue<Vector2>();
208
+
209
+ if (moving || value.x == 0)
210
+ return;
211
+
212
+ moving = true;
213
+
214
+ DeactivateControls();
215
+
216
+ if (value.x > 0)
217
+ {
218
+ // move right
219
+ if ((trialCamera.SeatFocus - cameraPositionOffset + 1) > trialCamera.CharHeightOffset.Length - 1)
220
+ trialCamera.SeatFocus = 0 + cameraPositionOffset;
221
+ else
222
+ trialCamera.SeatFocus += 1;
223
+ }
224
+ else if (value.x < 0)
225
+ {
226
+ //move left
227
+ if ((trialCamera.SeatFocus - cameraPositionOffset - 1) < 0)
228
+ trialCamera.SeatFocus = trialCamera.CharHeightOffset.Length - 1 + cameraPositionOffset;
229
+ else
230
+ trialCamera.SeatFocus -= 1;
231
+ }
232
+
233
+ StartCoroutine(MoveStall());
234
+
235
+ InvokeChangedSelection();
236
+ }
237
+
238
+ /// <summary>
239
+ ///
240
+ /// </summary>
241
+ /// <returns></returns>
242
+ protected virtual IEnumerator MoveStall()
243
+ {
244
+ yield return new WaitForSeconds(moveStallDuration);
245
+
246
+ ActivateControls();
247
+
248
+ moving = false;
249
+
250
+ yield break;
251
+ }
252
+
253
+ /// <summary>
254
+ ///
255
+ /// </summary>
256
+ protected virtual void InvokeChangedSelection() => OnChangeSelection?.Invoke(GetHoveredCharacterData()?.characterName);
257
+
258
+ /// <summary>
259
+ ///
260
+ /// </summary>
261
+ /// <returns></returns>
262
+ protected virtual BlackenedSelectData GetHoveredCharacterData()
263
+ {
264
+ foreach (var data in builder.selectDatas)
265
+ if (Mathf.RoundToInt(trialCamera.SeatFocus) == characterDatabase.GetCharacter(data.characterName).TrialPosition)
266
+ return data;
267
+
268
+ UnityEngine.Debug.LogError("The Character could not be found! " + trialCamera.SeatFocus);
269
+
270
+ return null;
271
+ }
272
+
273
+ #endregion
274
+
275
+ #region Select Character Resolve Minigame
276
+
277
+ /// <inheritdoc/>
278
+ protected override void SelectCharacter(CallbackContext ctx)
279
+ {
280
+ DeactivateControls();
281
+
282
+ TrialTimer.PauseTimer();
283
+
284
+ HideVisuals();
285
+
286
+ OnSelected?.Invoke();
287
+
288
+ StartCoroutine(SelectCharacterRoutine());
289
+ }
290
+
291
+ /// <summary>
292
+ ///
293
+ /// </summary>
294
+ /// <returns></returns>
295
+ protected virtual IEnumerator SelectCharacterRoutine()
296
+ {
297
+ if (minigameUI != null)
298
+ minigameUI.Hide();
299
+
300
+ yield return new WaitForSeconds(removeOffsetBufferDuration);
301
+
302
+ if (Mathf.RoundToInt(trialCamera.SeatFocus) >= trialCamera.CharHeightOffset.Length)
303
+ trialCamera.SeatFocus = 0;
304
+
305
+ trialCamera.SeatFocus = Mathf.RoundToInt(trialCamera.SeatFocus);
306
+
307
+ if (minigameUI != null)
308
+ yield return minigameUI.WaitForChangeToComplete();
309
+
310
+ trialCamera.SmoothFocus = false;
311
+
312
+ if (GetHoveredCharacterData() is BlackenedSelectData data)
313
+ {
314
+ if (data.isAnswer)
315
+ StartCoroutine(ResolveMinigame());
316
+ else
317
+ TrialMistake(data.fuckUpDialogue);
318
+ }
319
+ }
320
+
321
+ /// <inheritdoc/>
322
+ public override IEnumerator ResolveMinigame()
323
+ {
324
+ if (TrialTimer != null)
325
+ TrialTimer.HideStop();
326
+
327
+ OnCorrectSelected?.Invoke();
328
+
329
+ if (selectionUI != null)
330
+ yield return selectionUI.ShowTillComplete();
331
+
332
+ yield return new WaitForSeconds(menuFadeWaitTime);
333
+
334
+ if (answerUI != null)
335
+ yield return answerUI.ShowTillComplete();
336
+
337
+ yield return base.ResolveMinigame();
338
+
339
+ yield break;
340
+ }
341
+
342
+ #endregion
343
+
344
+ #region Time Up, Player Death, Restart Minigame
345
+
346
+ /// <inheritdoc/>
347
+ protected override void OnTimeUp()
348
+ {
349
+ DeactivateControls();
350
+
351
+ HideVisuals();
352
+
353
+ base.OnTimeUp();
354
+ }
355
+
356
+ /// <inheritdoc/>
357
+ protected override void Restart()
358
+ {
359
+ UnityEngine.Debug.Log("Restart Called");
360
+
361
+ ShowVisuals();
362
+
363
+ InvokeChangedSelection();
364
+
365
+ StartCoroutine(ResolveRestart());
366
+ }
367
+
368
+ /// <summary>
369
+ ///
370
+ /// </summary>
371
+ protected virtual void ShowVisuals()
372
+ {
373
+ if (questionToggle != null)
374
+ questionToggle.Activate();
375
+
376
+ if (TrialTimer != null)
377
+ TrialTimer.Show();
378
+
379
+ if (TrialTimer != null)
380
+ TrialTimer.Restart();
381
+
382
+ if (TrialStats != null)
383
+ TrialStats.ShowTrialStats();
384
+
385
+ if (minigameUI != null)
386
+ minigameUI.Show();
387
+
388
+ trialCamera.TriggerAnim(trialCamera.SeatFocus + cameraPositionOffset);
389
+
390
+ trialCamera.SmoothFocus = true;
391
+
392
+ OnShowVisuals?.Invoke();
393
+ }
394
+
395
+ /// <summary>
396
+ ///
397
+ /// </summary>
398
+ protected virtual void HideVisuals()
399
+ {
400
+ if (questionToggle != null)
401
+ questionToggle.Deactivate();
402
+
403
+ if (TrialTimer != null)
404
+ TrialTimer.Hide();
405
+
406
+ if (TrialStats != null)
407
+ TrialStats.HideTrialStats();
408
+
409
+ if (minigameUI != null)
410
+ minigameUI.Hide();
411
+
412
+ OnHideVisuals?.Invoke();
413
+ }
414
+
415
+ /// <summary>
416
+ ///
417
+ /// </summary>
418
+ protected virtual IEnumerator ResolveRestart()
419
+ {
420
+ if (minigameUI != null)
421
+ yield return minigameUI.WaitForChangeToComplete();
422
+
423
+ ActivateControls();
424
+ }
425
+
426
+ #endregion
427
+ }
428
428
  }