fr.jeanf.questsystem 0.0.33 → 0.0.35
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.
- package/Runtime/Scripts/Core/Editor/{QuestInfoSO_Editor.cs → QuestSO_Editor.cs} +1 -1
- package/Runtime/Scripts/Core/Editor/QuestStep_Editor.cs +24 -0
- package/Runtime/Scripts/Core/Editor/QuestStep_Editor.cs.meta +11 -0
- package/Runtime/Scripts/Core/QuestItem.cs +12 -15
- package/Runtime/Scripts/Core/QuestStep.cs +2 -2
- package/package.json +1 -1
- /package/Runtime/Scripts/Core/Editor/{QuestInfoSO_Editor.cs.meta → QuestSO_Editor.cs.meta} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace jeanf.questsystem
|
|
6
|
+
{
|
|
7
|
+
[CustomEditor(typeof(QuestStep), true)]
|
|
8
|
+
public class QuestStep_Editor : Editor
|
|
9
|
+
{
|
|
10
|
+
public override void OnInspectorGUI()
|
|
11
|
+
{
|
|
12
|
+
GUILayout.Space(10);
|
|
13
|
+
var eventToSend = (QuestStep)target;
|
|
14
|
+
if (GUILayout.Button("Regenerate questStep id", GUILayout.Height(20)))
|
|
15
|
+
{
|
|
16
|
+
eventToSend.GenerateId(); // how do i call this?
|
|
17
|
+
}
|
|
18
|
+
GUILayout.Space(10);
|
|
19
|
+
|
|
20
|
+
DrawDefaultInspector();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
#endif
|
|
@@ -62,17 +62,6 @@ namespace jeanf.questsystem
|
|
|
62
62
|
stepMap.Add(questSO.questSteps[i].StepId, questSO.questSteps[i]);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
foreach (QuestStep step in stepMap.Values)
|
|
67
|
-
{
|
|
68
|
-
if (step.isRootStep)
|
|
69
|
-
{
|
|
70
|
-
InstantiateQuestStep(step.StepId);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
LoadDependencies();
|
|
75
|
-
|
|
76
65
|
}
|
|
77
66
|
|
|
78
67
|
private void OnEnable()
|
|
@@ -125,11 +114,10 @@ namespace jeanf.questsystem
|
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
public void DestroyQuestStep(string id)
|
|
128
|
-
|
|
117
|
+
{
|
|
129
118
|
if (activeSteps.ContainsKey(id))
|
|
130
119
|
{
|
|
131
120
|
Destroy(activeSteps[id].gameObject);
|
|
132
|
-
activeSteps.Remove(id);
|
|
133
121
|
}
|
|
134
122
|
}
|
|
135
123
|
|
|
@@ -175,14 +163,23 @@ namespace jeanf.questsystem
|
|
|
175
163
|
activeSteps.TrimExcess();
|
|
176
164
|
completedSteps.Clear();
|
|
177
165
|
completedSteps.TrimExcess();
|
|
178
|
-
|
|
166
|
+
|
|
179
167
|
Debug.Log($"Quest [{id}]: _startQuestOnEnable value is: [{_startQuestOnEnable}]");
|
|
180
|
-
if (!_startQuestOnEnable) return;
|
|
181
168
|
if (!_startQuestOnEnable || id != questId) return;
|
|
182
169
|
clearToStart = true;
|
|
183
170
|
currentQuestState = QuestState.CAN_START;
|
|
184
171
|
requirementCheck.RaiseEvent(questId);
|
|
185
172
|
UpdateState();
|
|
173
|
+
|
|
174
|
+
foreach (QuestStep step in stepMap.Values)
|
|
175
|
+
{
|
|
176
|
+
if (step.isRootStep)
|
|
177
|
+
{
|
|
178
|
+
InstantiateQuestStep(step.StepId);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
LoadDependencies();
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
private void UpdateState()
|
|
@@ -100,9 +100,9 @@ namespace jeanf.questsystem
|
|
|
100
100
|
{
|
|
101
101
|
sendNextStepId?.Invoke(questStep.stepId);
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
stepActive?.Invoke(stepId, stepStatus);
|
|
105
103
|
stepCompleted?.Invoke(stepId);
|
|
104
|
+
stepActive?.Invoke(stepId, stepStatus);
|
|
105
|
+
|
|
106
106
|
|
|
107
107
|
if (!isUsingIntroTimeline || !timeline) return;
|
|
108
108
|
//if(isDebug) Debug.Log($"sending trigger to timeline: {timeline.name}, triggerValue: false");
|
package/package.json
CHANGED
|
File without changes
|