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.
@@ -4,7 +4,7 @@ using jeanf.questsystem;
4
4
  using UnityEditor;
5
5
  using UnityEngine;
6
6
 
7
- public class QuestInfoSO_Editor : Editor
7
+ public class QuestSO_Editor : Editor
8
8
  {
9
9
  [CustomEditor(typeof(QuestSO))]
10
10
  public class BoolEventOnClickEditor : Editor {
@@ -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
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4d6bc104dc5aaf843822427976cba928
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"fr.jeanf.questsystem",
3
- "version":"0.0.33",
3
+ "version":"0.0.35",
4
4
  "displayName":"Quest system",
5
5
  "description":"This package uses Scriptable Objects to define quests.",
6
6
  "unity": "2021.3",