net.dreditor.progressing.handling 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 (74) hide show
  1. package/.attestation.p7m +0 -0
  2. package/ChapterTitleDisplayer.cs +41 -41
  3. package/ChapterTitleDisplayer.cs.meta +11 -11
  4. package/DREditor.Progressing.Handling.asmdef +16 -16
  5. package/DREditor.Progressing.Handling.asmdef.meta +7 -7
  6. package/FlagTriggerExtensions.cs +78 -78
  7. package/FlagTriggerExtensions.cs.meta +11 -11
  8. package/FlagTriggerHandler.cs +236 -236
  9. package/FlagTriggerHandler.cs.meta +11 -11
  10. package/FlagTriggerHandlerBase.cs +65 -65
  11. package/FlagTriggerHandlerBase.cs.meta +11 -11
  12. package/HistoricalManagerBase.cs +158 -158
  13. package/HistoricalManagerBase.cs.meta +1 -1
  14. package/IHistory.cs +100 -100
  15. package/IHistory.cs.meta +1 -1
  16. package/ProgressionData.cs +180 -180
  17. package/ProgressionData.cs.meta +11 -11
  18. package/ProgressionDebugger.cs +185 -185
  19. package/ProgressionDebugger.cs.meta +11 -11
  20. package/ProgressionFlagHandler.cs +166 -166
  21. package/ProgressionFlagHandler.cs.meta +11 -11
  22. package/ProgressionHistoryManager.cs +33 -33
  23. package/ProgressionHistoryManager.cs.meta +11 -11
  24. package/ProgressionInfo.cs +53 -53
  25. package/ProgressionInfo.cs.meta +11 -11
  26. package/ProgressionLoader.cs +128 -128
  27. package/ProgressionLoader.cs.meta +11 -11
  28. package/ProgressionManager.cs +285 -285
  29. package/ProgressionManager.cs.meta +11 -11
  30. package/ProgressionManagerBase.cs +131 -131
  31. package/ProgressionManagerBase.cs.meta +11 -11
  32. package/ProgressionSaver.cs +48 -48
  33. package/ProgressionSaver.cs.meta +11 -11
  34. package/{Samples → Samples~}/CurrentChapterIndex.asset +21 -21
  35. package/{Samples → Samples~}/CurrentChapterIndex.asset.meta +8 -8
  36. package/{Samples → Samples~}/CurrentObjectiveIndex.asset +19 -19
  37. package/{Samples → Samples~}/CurrentObjectiveIndex.asset.meta +8 -8
  38. package/{Samples → Samples~}/CurrentObjectiveName.asset +19 -19
  39. package/{Samples → Samples~}/CurrentObjectiveName.asset.meta +8 -8
  40. package/{Samples → Samples~}/FlagTriggered.asset +19 -19
  41. package/{Samples → Samples~}/FlagTriggered.asset.meta +8 -8
  42. package/{Samples → Samples~}/Flag_Trigger_Handler.prefab +194 -194
  43. package/{Samples → Samples~}/Flag_Trigger_Handler.prefab.meta +7 -7
  44. package/{Samples → Samples~}/LoadProgressionData.asset +14 -14
  45. package/{Samples → Samples~}/LoadProgressionData.asset.meta +8 -8
  46. package/{Samples → Samples~}/MoveToNextNaturalObjective.asset +14 -14
  47. package/{Samples → Samples~}/MoveToNextNaturalObjective.asset.meta +8 -8
  48. package/{Samples → Samples~}/MoveToObjective.asset +19 -19
  49. package/{Samples → Samples~}/MoveToObjective.asset.meta +8 -8
  50. package/{Samples → Samples~}/ObjectiveKeepsInstanceData.asset +19 -19
  51. package/{Samples → Samples~}/ObjectiveKeepsInstanceData.asset.meta +8 -8
  52. package/{Samples → Samples~}/OnGeneratePastData.asset +14 -14
  53. package/{Samples → Samples~}/OnGeneratePastData.asset.meta +8 -8
  54. package/{Samples → Samples~}/OnLastObjective.asset +19 -19
  55. package/{Samples → Samples~}/OnLastObjective.asset.meta +8 -8
  56. package/{Samples → Samples~}/Progression_Debugger.prefab +73 -73
  57. package/{Samples → Samples~}/Progression_Debugger.prefab.meta +7 -7
  58. package/{Samples → Samples~}/Progression_Flag_Handler.prefab +47 -47
  59. package/{Samples → Samples~}/Progression_Flag_Handler.prefab.meta +7 -7
  60. package/{Samples → Samples~}/Progression_History_Manager.prefab +107 -107
  61. package/{Samples → Samples~}/Progression_History_Manager.prefab.meta +7 -7
  62. package/{Samples → Samples~}/Progression_Loader.prefab +76 -76
  63. package/{Samples → Samples~}/Progression_Loader.prefab.meta +7 -7
  64. package/{Samples → Samples~}/Progression_Manager_ETemplate.prefab +603 -603
  65. package/{Samples → Samples~}/Progression_Manager_ETemplate.prefab.meta +7 -7
  66. package/{Samples → Samples~}/Progression_Saver.prefab +51 -51
  67. package/{Samples → Samples~}/Progression_Saver.prefab.meta +7 -7
  68. package/{Samples → Samples~}/RequiredFlagsTriggered.asset +19 -19
  69. package/{Samples → Samples~}/RequiredFlagsTriggered.asset.meta +8 -8
  70. package/{Samples → Samples~}/TriggerAllRequiredFlags.asset +14 -14
  71. package/{Samples → Samples~}/TriggerAllRequiredFlags.asset.meta +8 -8
  72. package/package.json +40 -35
  73. package/package.json.meta +7 -7
  74. package/Samples.meta +0 -8
@@ -1,286 +1,286 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.EventObjects;
3
- using DREditor.Services;
4
- using UnityEngine;
5
- using UnityEngine.Scripting.APIUpdating;
6
-
7
- namespace DREditor.Progressing.Handling
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader(nameof(ServiceHolder<ProgressionManagerBase>) + " for type: " + nameof(ProgressionManagerBase) +
13
- "\n\n")]
14
- [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
15
- public class ProgressionManager : ProgressionManagerBase
16
- {
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- [Header("")]
21
- [Divider]
22
- [Tooltip("")]
23
- [SerializeField] protected IntWithEvent currentChapterIndex = null;
24
-
25
- /// <summary>
26
- ///
27
- /// </summary>
28
- [Tooltip("")]
29
- [SerializeField] protected IntWithEvent currentObjectiveIndex = null;
30
-
31
- /// <summary>
32
- ///
33
- /// </summary>
34
- [Tooltip("")]
35
- [SerializeField] protected BoolWithEvent onLastObjective = null;
36
-
37
- /// <summary>
38
- ///
39
- /// </summary>
40
- [Tooltip("")]
41
- [SerializeField] protected BoolWithEvent objectiveKeepsInstanceData = null;
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- [Tooltip("")]
47
- [SerializeField] protected BoolWithEvent requiredFlagsTriggered = null;
48
-
49
- /// <summary>
50
- ///
51
- /// </summary>
52
- [Tooltip("")]
53
- [SerializeField] protected StringWithEvent currentObjectiveName = null;
54
-
55
- /// <summary>
56
- ///
57
- /// </summary>
58
- [Tooltip("")]
59
- [SerializeField] protected StringWithEvent moveToObjective = null;
60
-
61
- /// <summary>
62
- ///
63
- /// </summary>
64
- [Tooltip("")]
65
- [SerializeField] protected SceneEventListener newGameSelected = null;
66
-
67
- /// <summary>
68
- ///
69
- /// </summary>
70
- [Tooltip("")]
71
- [SerializeField] protected SceneEventListener startedNewGame = null;
72
-
73
- /// <summary>
74
- ///
75
- /// </summary>
76
- [Tooltip("")]
77
- [SerializeField] protected SceneEventListener moveToNextNaturalObjective = null;
78
-
79
-
80
- /// <summary>
81
- ///
82
- /// </summary>
83
- protected virtual void OnEnable() => SubscribeToEvents();
84
-
85
- /// <summary>
86
- ///
87
- /// </summary>
88
- protected virtual void OnDisable() => UnsubscribeToEvents();
89
-
90
- /// <summary>
91
- ///
92
- /// </summary>
93
- protected virtual void SubscribeToEvents()
94
- {
95
- moveToNextNaturalObjective.Response.AddListener(MoveToNextNaturalObjective);
96
-
97
- newGameSelected.Response.AddListener(ResetProgression);
98
-
99
- startedNewGame.Response.AddListener(ResetProgression);
100
-
101
- moveToObjective.AddListener(MoveToObjective);
102
-
103
- currentChapterIndex.AddListener(SetCurrentChapterByIndex);
104
- }
105
-
106
- /// <summary>
107
- ///
108
- /// </summary>
109
- protected virtual void UnsubscribeToEvents()
110
- {
111
- moveToNextNaturalObjective.Response.RemoveListener(MoveToNextNaturalObjective);
112
-
113
- newGameSelected.Response.RemoveListener(ResetProgression);
114
-
115
- startedNewGame.Response.RemoveListener(ResetProgression);
116
-
117
- moveToObjective.RemoveListener(MoveToObjective);
118
-
119
- currentChapterIndex.RemoveListener(SetCurrentChapterByIndex);
120
- }
121
-
122
- /// <summary>
123
- ///
124
- /// </summary>
125
- /// <param name="index"></param>
126
- /// <remarks>
127
- ///
128
- /// </remarks>
129
- protected virtual void SetCurrentChapterByIndex(int index) => SetCurrentChapter(progressionDatabase.Chapters[index]);
130
-
131
- /// <inheritdoc/>
132
- public override bool PassedPoint(int chapter, string objectiveName)
133
- {
134
- if (currentChapterIndex.Value > chapter)
135
- return true;
136
-
137
- if (currentChapterIndex.Value < chapter)
138
- return false;
139
-
140
- return ServiceLocator.GetService<IHistory>().ContainsObjective(objectiveName);
141
- }
142
-
143
- /// <inheritdoc/>
144
- public override void SetCurrentChapter(Chapter chapter)
145
- {
146
- base.SetCurrentChapter(chapter);
147
-
148
- currentChapterIndex.SetValue(progressionDatabase.Chapters.IndexOf(chapter));
149
-
150
- UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: The Chapter index has changed to {chapter}.");
151
- }
152
-
153
- /// <inheritdoc/>
154
- public override void SetCurrentObjective(Objective objective)
155
- {
156
- base.SetCurrentObjective(objective);
157
-
158
- bool isFinalObjective = currentObjective.Description == currentChapter.Objectives[^1].Description;
159
-
160
- onLastObjective.SetValue(isFinalObjective);
161
-
162
- currentObjectiveIndex.SetValue(currentChapter.Objectives.IndexOf(currentObjective));
163
-
164
- currentObjectiveName.SetValue(currentObjective.Description);
165
-
166
- objectiveKeepsInstanceData.SetValue(progressionDatabase.GetObjective(currentObjective.Description).KeepInstanceData);
167
-
168
- requiredFlagsTriggered.SetValue(false);
169
- }
170
-
171
- /// <summary>
172
- ///
173
- /// </summary>
174
- protected virtual void ResetProgression()
175
- {
176
- SetCurrentChapter(progressionDatabase.Chapters[0]);
177
-
178
- currentChapterIndex.SetValue(0);
179
-
180
- SetCurrentObjective((Objective)currentChapter.Objectives[0].Clone());
181
-
182
- ServiceLocator.GetService<IHistory>().Clear();
183
-
184
- UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: Progression Reset.");
185
- }
186
-
187
- /// <summary>
188
- ///
189
- /// </summary>
190
- /// <param name="objective"></param>
191
- /// <returns></returns>
192
- protected virtual Objective GetNextObjective(Objective objective)
193
- {
194
- for (int i = 0; i < currentChapter.Objectives.Count; i++)
195
- {
196
- Objective iteratedObjective = currentChapter.Objectives[i];
197
-
198
- if (iteratedObjective.Description == objective.Description)
199
- {
200
- if (i + 1 < currentChapter.Objectives.Count)
201
- return currentChapter.Objectives[i + 1];
202
- else
203
- {
204
- MoveToNextChapter();
205
-
206
- return currentChapter.Objectives[0];
207
- }
208
- }
209
- }
210
-
211
- UnityEngine.Debug.Log($"REPORT: {ToString()}: GetNextObjective Evaluated Null");
212
-
213
- return null;
214
- }
215
-
216
- /// <summary>
217
- ///
218
- /// </summary>
219
- protected virtual void MoveToNextChapter()
220
- {
221
- for (int i = 0; i < progressionDatabase.Chapters.Count; i++)
222
- if (progressionDatabase.Chapters[i] == currentChapter && (i + 1) < progressionDatabase.Chapters.Count)
223
- SetCurrentChapter(progressionDatabase.Chapters[i + 1]);
224
- }
225
-
226
- /// <summary>
227
- ///
228
- /// </summary>
229
- /// <param name="objectiveName"></param>
230
- protected virtual void MoveToObjective(string objectiveName)
231
- {
232
- if (string.IsNullOrEmpty(objectiveName))
233
- return;
234
-
235
- ServiceLocator.GetService<IHistory>().Add(currentChapterIndex.Value, currentObjective);
236
-
237
- Objective objective = progressionDatabase.GetObjective(objectiveName);
238
-
239
- if (objective == null)
240
- {
241
- UnityEngine.Debug.LogError($"ALERT: {ToString()}: " +
242
- $"The Move to Objective called name does not match any valid objectives, " +
243
- $"for: " + objectiveName + " . Please make sure the string is spelled correctly and has correct case.");
244
-
245
- return;
246
- }
247
- else
248
- {
249
- ServiceLocator.GetService<IHistory>().SetPreviousObjective((Objective)currentObjective.Clone());
250
-
251
- SetCurrentObjective((Objective)objective.Clone());
252
- }
253
- }
254
-
255
- /// <summary>
256
- ///
257
- /// </summary>
258
- protected virtual void MoveToNextNaturalObjective()
259
- {
260
- bool isFTEObjective = currentChapter.GetObjective(currentObjective.Description) == null;
261
-
262
- if (isFTEObjective)
263
- SetCurrentObjective((Objective)GetNextObjective(ServiceLocator.GetService<IHistory>().GetLastObjective()).Clone());
264
- else
265
- ChangeObjective();
266
- }
267
-
268
- /// <summary>
269
- ///
270
- /// </summary>
271
- protected virtual void ChangeObjective()
272
- {
273
- UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: Changing objective from current objective: "
274
- + currentObjective.Description);
275
-
276
- ServiceLocator.GetService<IHistory>().Add(currentChapterIndex.Value, currentObjective);
277
-
278
- string overrideFlagObjectiveName = currentObjective.GetOverrideFlag();
279
-
280
- if (!string.IsNullOrEmpty(overrideFlagObjectiveName))
281
- SetCurrentObjective((Objective)progressionDatabase.GetObjective(overrideFlagObjectiveName).Clone());
282
- else
283
- SetCurrentObjective((Objective)GetNextObjective(currentObjective).Clone());
284
- }
285
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.EventObjects;
3
+ using DREditor.Services;
4
+ using UnityEngine;
5
+ using UnityEngine.Scripting.APIUpdating;
6
+
7
+ namespace DREditor.Progressing.Handling
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader(nameof(ServiceHolder<ProgressionManagerBase>) + " for type: " + nameof(ProgressionManagerBase) +
13
+ "\n\n")]
14
+ [MovedFrom(true, "DREditor.Progression.Handling", "DREditor.Progression.Handling")]
15
+ public class ProgressionManager : ProgressionManagerBase
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ [Header("")]
21
+ [Divider]
22
+ [Tooltip("")]
23
+ [SerializeField] protected IntWithEvent currentChapterIndex = null;
24
+
25
+ /// <summary>
26
+ ///
27
+ /// </summary>
28
+ [Tooltip("")]
29
+ [SerializeField] protected IntWithEvent currentObjectiveIndex = null;
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ [Tooltip("")]
35
+ [SerializeField] protected BoolWithEvent onLastObjective = null;
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ [Tooltip("")]
41
+ [SerializeField] protected BoolWithEvent objectiveKeepsInstanceData = null;
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ [Tooltip("")]
47
+ [SerializeField] protected BoolWithEvent requiredFlagsTriggered = null;
48
+
49
+ /// <summary>
50
+ ///
51
+ /// </summary>
52
+ [Tooltip("")]
53
+ [SerializeField] protected StringWithEvent currentObjectiveName = null;
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ [Tooltip("")]
59
+ [SerializeField] protected StringWithEvent moveToObjective = null;
60
+
61
+ /// <summary>
62
+ ///
63
+ /// </summary>
64
+ [Tooltip("")]
65
+ [SerializeField] protected SceneEventListener newGameSelected = null;
66
+
67
+ /// <summary>
68
+ ///
69
+ /// </summary>
70
+ [Tooltip("")]
71
+ [SerializeField] protected SceneEventListener startedNewGame = null;
72
+
73
+ /// <summary>
74
+ ///
75
+ /// </summary>
76
+ [Tooltip("")]
77
+ [SerializeField] protected SceneEventListener moveToNextNaturalObjective = null;
78
+
79
+
80
+ /// <summary>
81
+ ///
82
+ /// </summary>
83
+ protected virtual void OnEnable() => SubscribeToEvents();
84
+
85
+ /// <summary>
86
+ ///
87
+ /// </summary>
88
+ protected virtual void OnDisable() => UnsubscribeToEvents();
89
+
90
+ /// <summary>
91
+ ///
92
+ /// </summary>
93
+ protected virtual void SubscribeToEvents()
94
+ {
95
+ moveToNextNaturalObjective.Response.AddListener(MoveToNextNaturalObjective);
96
+
97
+ newGameSelected.Response.AddListener(ResetProgression);
98
+
99
+ startedNewGame.Response.AddListener(ResetProgression);
100
+
101
+ moveToObjective.AddListener(MoveToObjective);
102
+
103
+ currentChapterIndex.AddListener(SetCurrentChapterByIndex);
104
+ }
105
+
106
+ /// <summary>
107
+ ///
108
+ /// </summary>
109
+ protected virtual void UnsubscribeToEvents()
110
+ {
111
+ moveToNextNaturalObjective.Response.RemoveListener(MoveToNextNaturalObjective);
112
+
113
+ newGameSelected.Response.RemoveListener(ResetProgression);
114
+
115
+ startedNewGame.Response.RemoveListener(ResetProgression);
116
+
117
+ moveToObjective.RemoveListener(MoveToObjective);
118
+
119
+ currentChapterIndex.RemoveListener(SetCurrentChapterByIndex);
120
+ }
121
+
122
+ /// <summary>
123
+ ///
124
+ /// </summary>
125
+ /// <param name="index"></param>
126
+ /// <remarks>
127
+ ///
128
+ /// </remarks>
129
+ protected virtual void SetCurrentChapterByIndex(int index) => SetCurrentChapter(progressionDatabase.Chapters[index]);
130
+
131
+ /// <inheritdoc/>
132
+ public override bool PassedPoint(int chapter, string objectiveName)
133
+ {
134
+ if (currentChapterIndex.Value > chapter)
135
+ return true;
136
+
137
+ if (currentChapterIndex.Value < chapter)
138
+ return false;
139
+
140
+ return ServiceLocator.GetService<IHistory>().ContainsObjective(objectiveName);
141
+ }
142
+
143
+ /// <inheritdoc/>
144
+ public override void SetCurrentChapter(Chapter chapter)
145
+ {
146
+ base.SetCurrentChapter(chapter);
147
+
148
+ currentChapterIndex.SetValue(progressionDatabase.Chapters.IndexOf(chapter));
149
+
150
+ UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: The Chapter index has changed to {chapter}.");
151
+ }
152
+
153
+ /// <inheritdoc/>
154
+ public override void SetCurrentObjective(Objective objective)
155
+ {
156
+ base.SetCurrentObjective(objective);
157
+
158
+ bool isFinalObjective = currentObjective.Description == currentChapter.Objectives[^1].Description;
159
+
160
+ onLastObjective.SetValue(isFinalObjective);
161
+
162
+ currentObjectiveIndex.SetValue(currentChapter.Objectives.IndexOf(currentObjective));
163
+
164
+ currentObjectiveName.SetValue(currentObjective.Description);
165
+
166
+ objectiveKeepsInstanceData.SetValue(progressionDatabase.GetObjective(currentObjective.Description).KeepInstanceData);
167
+
168
+ requiredFlagsTriggered.SetValue(false);
169
+ }
170
+
171
+ /// <summary>
172
+ ///
173
+ /// </summary>
174
+ protected virtual void ResetProgression()
175
+ {
176
+ SetCurrentChapter(progressionDatabase.Chapters[0]);
177
+
178
+ currentChapterIndex.SetValue(0);
179
+
180
+ SetCurrentObjective((Objective)currentChapter.Objectives[0].Clone());
181
+
182
+ ServiceLocator.GetService<IHistory>().Clear();
183
+
184
+ UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: Progression Reset.");
185
+ }
186
+
187
+ /// <summary>
188
+ ///
189
+ /// </summary>
190
+ /// <param name="objective"></param>
191
+ /// <returns></returns>
192
+ protected virtual Objective GetNextObjective(Objective objective)
193
+ {
194
+ for (int i = 0; i < currentChapter.Objectives.Count; i++)
195
+ {
196
+ Objective iteratedObjective = currentChapter.Objectives[i];
197
+
198
+ if (iteratedObjective.Description == objective.Description)
199
+ {
200
+ if (i + 1 < currentChapter.Objectives.Count)
201
+ return currentChapter.Objectives[i + 1];
202
+ else
203
+ {
204
+ MoveToNextChapter();
205
+
206
+ return currentChapter.Objectives[0];
207
+ }
208
+ }
209
+ }
210
+
211
+ UnityEngine.Debug.Log($"REPORT: {ToString()}: GetNextObjective Evaluated Null");
212
+
213
+ return null;
214
+ }
215
+
216
+ /// <summary>
217
+ ///
218
+ /// </summary>
219
+ protected virtual void MoveToNextChapter()
220
+ {
221
+ for (int i = 0; i < progressionDatabase.Chapters.Count; i++)
222
+ if (progressionDatabase.Chapters[i] == currentChapter && (i + 1) < progressionDatabase.Chapters.Count)
223
+ SetCurrentChapter(progressionDatabase.Chapters[i + 1]);
224
+ }
225
+
226
+ /// <summary>
227
+ ///
228
+ /// </summary>
229
+ /// <param name="objectiveName"></param>
230
+ protected virtual void MoveToObjective(string objectiveName)
231
+ {
232
+ if (string.IsNullOrEmpty(objectiveName))
233
+ return;
234
+
235
+ ServiceLocator.GetService<IHistory>().Add(currentChapterIndex.Value, currentObjective);
236
+
237
+ Objective objective = progressionDatabase.GetObjective(objectiveName);
238
+
239
+ if (objective == null)
240
+ {
241
+ UnityEngine.Debug.LogError($"ALERT: {ToString()}: " +
242
+ $"The Move to Objective called name does not match any valid objectives, " +
243
+ $"for: " + objectiveName + " . Please make sure the string is spelled correctly and has correct case.");
244
+
245
+ return;
246
+ }
247
+ else
248
+ {
249
+ ServiceLocator.GetService<IHistory>().SetPreviousObjective((Objective)currentObjective.Clone());
250
+
251
+ SetCurrentObjective((Objective)objective.Clone());
252
+ }
253
+ }
254
+
255
+ /// <summary>
256
+ ///
257
+ /// </summary>
258
+ protected virtual void MoveToNextNaturalObjective()
259
+ {
260
+ bool isFTEObjective = currentChapter.GetObjective(currentObjective.Description) == null;
261
+
262
+ if (isFTEObjective)
263
+ SetCurrentObjective((Objective)GetNextObjective(ServiceLocator.GetService<IHistory>().GetLastObjective()).Clone());
264
+ else
265
+ ChangeObjective();
266
+ }
267
+
268
+ /// <summary>
269
+ ///
270
+ /// </summary>
271
+ protected virtual void ChangeObjective()
272
+ {
273
+ UnityEngine.Debug.Log($"REPORT: {nameof(ProgressionManager)}: Changing objective from current objective: "
274
+ + currentObjective.Description);
275
+
276
+ ServiceLocator.GetService<IHistory>().Add(currentChapterIndex.Value, currentObjective);
277
+
278
+ string overrideFlagObjectiveName = currentObjective.GetOverrideFlag();
279
+
280
+ if (!string.IsNullOrEmpty(overrideFlagObjectiveName))
281
+ SetCurrentObjective((Objective)progressionDatabase.GetObjective(overrideFlagObjectiveName).Clone());
282
+ else
283
+ SetCurrentObjective((Objective)GetNextObjective(currentObjective).Clone());
284
+ }
285
+ }
286
286
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 5847fb198f3b4344abce3a75ffe46903
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 5847fb198f3b4344abce3a75ffe46903
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: