fr.jeanf.questsystem 0.0.41 → 0.0.43
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.
|
@@ -99,16 +99,11 @@ namespace jeanf.questsystem
|
|
|
99
99
|
#region Instantiations & Loading
|
|
100
100
|
public void InstantiateQuestStep(string id)
|
|
101
101
|
{
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (stepMap.ContainsKey(id))
|
|
109
|
-
{
|
|
110
|
-
activeSteps.Add(id,Instantiate(stepMap[id], this.transform, true));
|
|
111
|
-
}
|
|
102
|
+
if (stepMap[id].stepStatus != QuestStepStatus.Inactive) return;
|
|
103
|
+
if (activeSteps.ContainsKey(id)) return;
|
|
104
|
+
if (!stepMap.ContainsKey(id)) return;
|
|
105
|
+
|
|
106
|
+
if(!activeSteps.ContainsKey(id)) activeSteps.Add(id,Instantiate(stepMap[id], this.transform, true));
|
|
112
107
|
}
|
|
113
108
|
|
|
114
109
|
public void DestroyQuestStep(string id)
|
|
@@ -56,7 +56,7 @@ namespace jeanf.questsystem
|
|
|
56
56
|
public void InitializeQuestStep()
|
|
57
57
|
{
|
|
58
58
|
// failsafe to avoid lauching the same step more than once at a time.
|
|
59
|
-
|
|
59
|
+
if (stepStatus == QuestStepStatus.Active) return;
|
|
60
60
|
Debug.Log($"Initializing quest with questId: {questId}");
|
|
61
61
|
|
|
62
62
|
stepStatus = QuestStepStatus.Active;
|
|
@@ -84,22 +84,17 @@ namespace jeanf.questsystem
|
|
|
84
84
|
{
|
|
85
85
|
sendQuestStepTooltip.RaiseEvent(string.Empty);
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
Debug.LogWarning("Implement prefab destruction");
|
|
89
|
-
Debug.LogWarning("Implement next trigger calls.");
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
;
|
|
92
88
|
|
|
93
89
|
foreach(QuestStep questStep in questStepsToTrigger)
|
|
94
90
|
{
|
|
95
91
|
sendNextStepId?.Invoke(questStep.stepId);
|
|
96
92
|
}
|
|
97
93
|
stepCompleted?.Invoke(stepId);
|
|
98
|
-
stepActive?.Invoke(stepId, stepStatus);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// _timelineTriggerEventChannelSo.RaiseEvent(timeline, false);
|
|
94
|
+
stepActive?.Invoke(stepId, stepStatus);
|
|
95
|
+
|
|
96
|
+
if (isDebug) Debug.Log($"Step with id: {stepId} finished. Destroying the gameobject with name {this.name}", this);
|
|
97
|
+
Destroy(this);
|
|
103
98
|
}
|
|
104
99
|
|
|
105
100
|
|