fr.jeanf.questsystem 0.0.28 → 0.0.29

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.
@@ -73,11 +73,11 @@ namespace jeanf.questsystem
73
73
 
74
74
  foreach (Quest quest in questMap.Values)
75
75
  {
76
- // initialize any loaded quest steps
77
- if (quest.state == QuestState.IN_PROGRESS)
78
- {
79
- quest.InstantiateCurrentQuestStep(this.transform);
80
- }
76
+ //// initialize any loaded quest steps
77
+ //if (quest.state == QuestState.IN_PROGRESS)
78
+ //{
79
+ // quest.InstantiateCurrentQuestStep(this.transform);
80
+ //}
81
81
 
82
82
  // broadcast the initial state of all quests on startup
83
83
  GameEventsManager.instance.questEvents.QuestStateChange(quest);
@@ -29,8 +29,8 @@ namespace jeanf.questsystem
29
29
  [SerializeField] private QuestTooltipSO questTooltipSO;
30
30
 
31
31
  [Header("Game Objects to Trigger")]
32
- [SerializeField] QuestInfoSO[] gameObjectsToTriggerOnStart;
33
- [SerializeField] QuestInfoSO[] gameObjectsToTriggerOnEnd;
32
+ [SerializeField] QuestStep[] questStepsToTriggerOnStart;
33
+ [SerializeField] QuestStep[] questStepsToTriggerOnEnd;
34
34
 
35
35
  public void InitializeQuestStep(string questId, int stepIndex, string questStepState)
36
36
  {
@@ -45,11 +45,12 @@ namespace jeanf.questsystem
45
45
  {
46
46
  DisplayActiveQuestStep();
47
47
  }
48
- if (gameObjectsToTriggerOnStart != null)
48
+
49
+ if (questStepsToTriggerOnStart != null)
49
50
  {
50
- foreach (QuestInfoSO questInfoSO in gameObjectsToTriggerOnStart)
51
+ foreach (QuestStep questStep in questStepsToTriggerOnStart)
51
52
  {
52
- GameEventsManager.instance.questEvents.StartQuest(questInfoSO.id);
53
+ Instantiate(questStep, this.transform.parent);
53
54
  }
54
55
  }
55
56
  if (isUsingIntroTimeline && timeline)
@@ -63,6 +64,13 @@ namespace jeanf.questsystem
63
64
 
64
65
  protected void FinishQuestStep()
65
66
  {
67
+ if (questStepsToTriggerOnEnd != null)
68
+ {
69
+ foreach (QuestStep questStep in questStepsToTriggerOnEnd)
70
+ {
71
+ Instantiate(questStep, this.transform.parent);
72
+ }
73
+ }
66
74
  if (isFinished) return;
67
75
  isFinished = true;
68
76
  if (sendQuestStepTooltip != null)
@@ -71,14 +79,7 @@ namespace jeanf.questsystem
71
79
  }
72
80
  if(questId != null) GameEventsManager.instance.questEvents.AdvanceQuest(questId);
73
81
  if(this.gameObject) Destroy(this.gameObject);
74
-
75
- if (gameObjectsToTriggerOnEnd != null)
76
- {
77
- foreach (QuestInfoSO questInfoSO in gameObjectsToTriggerOnEnd)
78
- {
79
- GameEventsManager.instance.questEvents.StartQuest(questInfoSO.id);
80
- }
81
- }
82
+
82
83
 
83
84
  if (!isUsingIntroTimeline || !timeline) return;
84
85
  //if(isDebug) Debug.Log($"sending trigger to timeline: {timeline.name}, triggerValue: false");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"fr.jeanf.questsystem",
3
- "version":"0.0.28",
3
+ "version":"0.0.29",
4
4
  "displayName":"Quest system",
5
5
  "description":"This package uses Scriptable Objects to define quests.",
6
6
  "unity": "2021.3",