fr.jeanf.questsystem 0.0.26 → 0.0.28
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.
|
@@ -140,7 +140,7 @@ namespace jeanf.questsystem
|
|
|
140
140
|
|
|
141
141
|
Debug.Log($"Quest [{id}]: _startQuestOnEnable value is: [{_startQuestOnEnable}]");
|
|
142
142
|
if (!_startQuestOnEnable) return;
|
|
143
|
-
RequestQuestStart(
|
|
143
|
+
RequestQuestStart(id);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
private void InitialCheckFromQuestManager( string id)
|
|
@@ -219,6 +219,7 @@ namespace jeanf.questsystem
|
|
|
219
219
|
if (quest.info.id.Equals(questId))
|
|
220
220
|
{
|
|
221
221
|
currentQuestState = quest.state;
|
|
222
|
+
UpdateState();
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
|
|
@@ -154,8 +154,8 @@ namespace jeanf.questsystem
|
|
|
154
154
|
Debug.Log(
|
|
155
155
|
$"[{quest.info.id}]quest state: {quest.state} - {quest.currentStep} over {quest.info.questStepPrefabs.Length} steps done",
|
|
156
156
|
this);
|
|
157
|
-
questStatusUpdateChannel.RaiseEvent(
|
|
158
|
-
|
|
157
|
+
questStatusUpdateChannel.RaiseEvent(quest.info.id);
|
|
158
|
+
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
// if there are more steps, instantiate the next one
|
|
@@ -187,7 +187,7 @@ namespace jeanf.questsystem
|
|
|
187
187
|
UpdateProgress(quest);
|
|
188
188
|
ClaimRewards(quest);
|
|
189
189
|
ChangeQuestState(quest.info.id, QuestState.FINISHED);
|
|
190
|
-
questStatusUpdateChannel.RaiseEvent(
|
|
190
|
+
questStatusUpdateChannel.RaiseEvent(quest.info.id);
|
|
191
191
|
questProgress.RaiseEvent(quest.info.id, 1);
|
|
192
192
|
SaveQuest(quest);
|
|
193
193
|
if (!quest.sendMessageOnFinish) return;
|
|
@@ -28,6 +28,10 @@ namespace jeanf.questsystem
|
|
|
28
28
|
[Header("Quest Tooltip")]
|
|
29
29
|
[SerializeField] private QuestTooltipSO questTooltipSO;
|
|
30
30
|
|
|
31
|
+
[Header("Game Objects to Trigger")]
|
|
32
|
+
[SerializeField] QuestInfoSO[] gameObjectsToTriggerOnStart;
|
|
33
|
+
[SerializeField] QuestInfoSO[] gameObjectsToTriggerOnEnd;
|
|
34
|
+
|
|
31
35
|
public void InitializeQuestStep(string questId, int stepIndex, string questStepState)
|
|
32
36
|
{
|
|
33
37
|
this.questId = questId;
|
|
@@ -41,28 +45,45 @@ namespace jeanf.questsystem
|
|
|
41
45
|
{
|
|
42
46
|
DisplayActiveQuestStep();
|
|
43
47
|
}
|
|
48
|
+
if (gameObjectsToTriggerOnStart != null)
|
|
49
|
+
{
|
|
50
|
+
foreach (QuestInfoSO questInfoSO in gameObjectsToTriggerOnStart)
|
|
51
|
+
{
|
|
52
|
+
GameEventsManager.instance.questEvents.StartQuest(questInfoSO.id);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
44
55
|
if (isUsingIntroTimeline && timeline)
|
|
45
56
|
{
|
|
46
57
|
if(isDebug) Debug.Log($"sending trigger to timeline: {timeline.name}, triggerValue: true");
|
|
47
58
|
_timelineTriggerEventChannelSo.RaiseEvent(timeline, true);
|
|
48
59
|
}
|
|
60
|
+
|
|
61
|
+
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
protected void FinishQuestStep()
|
|
52
65
|
{
|
|
53
66
|
if (isFinished) return;
|
|
54
67
|
isFinished = true;
|
|
55
|
-
if (sendQuestStepTooltip
|
|
68
|
+
if (sendQuestStepTooltip != null)
|
|
56
69
|
{
|
|
57
70
|
sendQuestStepTooltip.RaiseEvent(string.Empty);
|
|
58
71
|
}
|
|
59
72
|
if(questId != null) GameEventsManager.instance.questEvents.AdvanceQuest(questId);
|
|
60
73
|
if(this.gameObject) Destroy(this.gameObject);
|
|
61
74
|
|
|
75
|
+
if (gameObjectsToTriggerOnEnd != null)
|
|
76
|
+
{
|
|
77
|
+
foreach (QuestInfoSO questInfoSO in gameObjectsToTriggerOnEnd)
|
|
78
|
+
{
|
|
79
|
+
GameEventsManager.instance.questEvents.StartQuest(questInfoSO.id);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
62
82
|
|
|
63
83
|
if (!isUsingIntroTimeline || !timeline) return;
|
|
64
84
|
//if(isDebug) Debug.Log($"sending trigger to timeline: {timeline.name}, triggerValue: false");
|
|
65
85
|
//_timelineTriggerEventChannelSo.RaiseEvent(timeline, false);
|
|
86
|
+
|
|
66
87
|
}
|
|
67
88
|
|
|
68
89
|
protected void ChangeState(string newState)
|