fr.jeanf.questsystem 0.1.3 → 0.1.5

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.
@@ -72,7 +72,11 @@ namespace jeanf.questsystem
72
72
  {
73
73
  if (isTimed)
74
74
  {
75
- increaseTimer();
75
+ time += Time.deltaTime;
76
+ if (time > timerDuration)
77
+ {
78
+ ApplyFailureConsequence();
79
+ }
76
80
  }
77
81
  }
78
82
  public void OnDisable() => Unsubscribe();
@@ -82,14 +86,12 @@ namespace jeanf.questsystem
82
86
  private void Subscribe()
83
87
  {
84
88
  QuestItem.ValidateStepEvent += ValidateCurrentStep;
85
- //if (abortStepSO) abortStepSO.OnEventRaised += ctx => AbortStep(ctx);
86
89
  if(stepValidationOverride) stepValidationOverride.OnEventRaised += ValidateCurrentStep;
87
90
  }
88
91
 
89
92
  protected virtual void Unsubscribe()
90
93
  {
91
94
  QuestItem.ValidateStepEvent -= ValidateCurrentStep;
92
- //if (abortStepSO) abortStepSO.OnEventRaised -= ctx => AbortStep(ctx);
93
95
  if (stepValidationOverride) stepValidationOverride.OnEventRaised -= ValidateCurrentStep;
94
96
  }
95
97
  #endregion
@@ -135,22 +137,11 @@ namespace jeanf.questsystem
135
137
  {
136
138
  Destroy(this.gameObject);
137
139
  }
138
- //public void AbortStep(string id)
139
- //{
140
- // if (id == this.stepId)
141
- // {
142
- // Destroy(this.gameObject);
143
- // }
144
- //}
145
-
146
- protected void increaseTimer()
147
- {
148
- time += Time.deltaTime;
149
140
 
150
- if (time >= timerDuration)
151
- {
152
- endStepChannel.RaiseEvent(this.stepId);
153
- }
141
+
142
+ protected virtual void ApplyFailureConsequence()
143
+ {
144
+ endStepChannel.RaiseEvent(stepId);
154
145
  }
155
146
  public void FinishQuestStep()
156
147
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.questsystem",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "displayName": "Quest system",
5
5
  "description": "This package uses Scriptable Objects to define quests.",
6
6
  "unity": "2021.3",