fr.jeanf.questsystem 0.0.67 → 0.0.69

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.
@@ -53,6 +53,7 @@ namespace jeanf.questsystem
53
53
  [Header("Event Channels")]
54
54
  [SerializeField] private StringEventChannelSO sendQuestStepTooltip;
55
55
  [SerializeField] private StringEventChannelSO stepValidationOverride;
56
+ [SerializeField] protected StringEventChannelSO abortStepSO;
56
57
  #endregion
57
58
 
58
59
  #region standard unity methods
@@ -69,13 +70,15 @@ namespace jeanf.questsystem
69
70
  private void Subscribe()
70
71
  {
71
72
  QuestItem.ValidateStepEvent += ValidateCurrentStep;
73
+ if (abortStepSO) abortStepSO.OnEventRaised += ctx => AbortStep(ctx);
72
74
  if(stepValidationOverride) stepValidationOverride.OnEventRaised += ValidateCurrentStep;
73
75
  }
74
76
 
75
77
  protected virtual void Unsubscribe()
76
78
  {
77
79
  QuestItem.ValidateStepEvent -= ValidateCurrentStep;
78
- if(stepValidationOverride) stepValidationOverride.OnEventRaised -= ValidateCurrentStep;
80
+ if (abortStepSO) abortStepSO.OnEventRaised -= ctx => AbortStep(ctx);
81
+ if (stepValidationOverride) stepValidationOverride.OnEventRaised -= ValidateCurrentStep;
79
82
  }
80
83
  #endregion
81
84
 
@@ -120,6 +123,13 @@ namespace jeanf.questsystem
120
123
  {
121
124
  Destroy(this.gameObject);
122
125
  }
126
+ public void AbortStep(string id)
127
+ {
128
+ if (id == this.stepId)
129
+ {
130
+ Destroy(this.gameObject);
131
+ }
132
+ }
123
133
  public void FinishQuestStep()
124
134
  {
125
135
  if(isDebug) Debug.Log($" ---- Step with id: {stepId} finished. Changing status to completed", this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.questsystem",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "displayName": "Quest system",
5
5
  "description": "This package uses Scriptable Objects to define quests.",
6
6
  "unity": "2021.3",