fr.jeanf.questsystem 0.0.66 → 0.0.68

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.
@@ -1,7 +1,6 @@
1
1
  using System;
2
2
  using System.Collections;
3
3
  using System.Collections.Generic;
4
- using GraphProcessor;
5
4
  using jeanf.EventSystem;
6
5
  using jeanf.propertyDrawer;
7
6
  using UnityEngine;
@@ -1,6 +1,5 @@
1
1
  using System.Collections;
2
2
  using System.Collections.Generic;
3
- using GraphProcessor;
4
3
  using UnityEngine;
5
4
 
6
5
  namespace jeanf.questsystem
@@ -20,16 +19,5 @@ namespace jeanf.questsystem
20
19
  this.questStepIndex = questStepIndex;
21
20
  this.questStepStates = questStepStates;
22
21
  }
23
-
24
-
25
- // new constructor (tree structure)
26
- public BaseGraph QuestTree;
27
- public Dictionary<string, QuestStep> QuestStepDictionary;
28
-
29
- public QuestData(BaseGraph QuestTree, Dictionary<string, QuestStep> QuestStepDictionary)
30
- {
31
- this.QuestTree = QuestTree;
32
- this.QuestStepDictionary = QuestStepDictionary;
33
- }
34
22
  }
35
23
  }
@@ -1,7 +1,6 @@
1
1
  using System;
2
2
  using System.Collections;
3
3
  using System.Collections.Generic;
4
- using GraphProcessor;
5
4
  using jeanf.EventSystem;
6
5
  using jeanf.validationTools;
7
6
  using UnityEngine;
@@ -1,5 +1,4 @@
1
1
  using System;
2
- using GraphProcessor;
3
2
  using jeanf.EventSystem;
4
3
  using UnityEngine;
5
4
  using jeanf.propertyDrawer;
@@ -4,13 +4,12 @@ using jeanf.propertyDrawer;
4
4
  using UnityEngine;
5
5
  using UnityEngine.Playables;
6
6
  using System.Collections.Generic;
7
- using GraphProcessor;
8
7
  using jeanf.validationTools;
9
8
  using UnityEditor;
10
9
 
11
10
  namespace jeanf.questsystem
12
11
  {
13
- [System.Serializable, NodeMenuItem("questSystem/QuestStep"), DefaultExecutionOrder(1)]
12
+ [System.Serializable, DefaultExecutionOrder(1)]
14
13
  public class QuestStep : MonoBehaviour, IDebugBehaviour
15
14
  {
16
15
  #region Ids and status
@@ -54,6 +53,7 @@ namespace jeanf.questsystem
54
53
  [Header("Event Channels")]
55
54
  [SerializeField] private StringEventChannelSO sendQuestStepTooltip;
56
55
  [SerializeField] private StringEventChannelSO stepValidationOverride;
56
+ [SerializeField] private StringEventChannelSO abortStepSO;
57
57
  #endregion
58
58
 
59
59
  #region standard unity methods
@@ -70,13 +70,15 @@ namespace jeanf.questsystem
70
70
  private void Subscribe()
71
71
  {
72
72
  QuestItem.ValidateStepEvent += ValidateCurrentStep;
73
+ if (abortStepSO) abortStepSO.OnEventRaised += ctx => AbortStep(ctx);
73
74
  if(stepValidationOverride) stepValidationOverride.OnEventRaised += ValidateCurrentStep;
74
75
  }
75
76
 
76
77
  protected virtual void Unsubscribe()
77
78
  {
78
79
  QuestItem.ValidateStepEvent -= ValidateCurrentStep;
79
- if(stepValidationOverride) stepValidationOverride.OnEventRaised -= ValidateCurrentStep;
80
+ if (abortStepSO) abortStepSO.OnEventRaised -= ctx => AbortStep(ctx);
81
+ if (stepValidationOverride) stepValidationOverride.OnEventRaised -= ValidateCurrentStep;
80
82
  }
81
83
  #endregion
82
84
 
@@ -121,6 +123,13 @@ namespace jeanf.questsystem
121
123
  {
122
124
  Destroy(this.gameObject);
123
125
  }
126
+ public void AbortStep(string id)
127
+ {
128
+ if (id == this.stepId)
129
+ {
130
+ Destroy(this.gameObject);
131
+ }
132
+ }
124
133
  public void FinishQuestStep()
125
134
  {
126
135
  if(isDebug) Debug.Log($" ---- Step with id: {stepId} finished. Changing status to completed", this);
@@ -5,11 +5,7 @@
5
5
  "GUID:75469ad4d38634e559750d17036d5f7c",
6
6
  "GUID:e134609276952144282613c65d798616",
7
7
  "GUID:e8958e6939af7314a97769de4be4ce25",
8
- "GUID:db1b0a3157155ad47996061dbcc07bbb",
9
- "GUID:ca937d03ee5dd4d699091438dc0f3ae6",
10
- "GUID:a432eb0a70c5c4a37ab50d59671586f8",
11
- "GUID:b8e24fd1eb19b4226afebb2810e3c19b",
12
- "GUID:002c1bbed08fa44d282ef34fd5edb138"
8
+ "GUID:db1b0a3157155ad47996061dbcc07bbb"
13
9
  ],
14
10
  "includePlatforms": [],
15
11
  "excludePlatforms": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.questsystem",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "displayName": "Quest system",
5
5
  "description": "This package uses Scriptable Objects to define quests.",
6
6
  "unity": "2021.3",
@@ -1,30 +0,0 @@
1
- #if UNITY_EDITOR
2
- using UnityEngine;
3
- using UnityEditor;
4
- using GraphProcessor;
5
-
6
- public class QuestGraphWindow : BaseGraphWindow
7
- {
8
- [MenuItem("QuestGraph/01_DefaultGraph")]
9
- public static BaseGraphWindow Open()
10
- {
11
- var graphWindow = GetWindow<QuestGraphWindow>();
12
-
13
- graphWindow.Show();
14
-
15
- return graphWindow;
16
- }
17
-
18
- protected override void InitializeWindow(BaseGraph graph)
19
- {
20
- // Set the window title
21
- titleContent = new GUIContent("Default Graph");
22
-
23
- // Here you can use the default BaseGraphView or a custom one (see section below)
24
- var graphView = new BaseGraphView(this);
25
-
26
- rootView.Add(graphView);
27
- }
28
-
29
- }
30
- #endif
@@ -1,11 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 4783b98f3c3c6da49b8d8a1dc5b2bd52
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
@@ -1,11 +0,0 @@
1
- using UnityEngine;
2
- using GraphProcessor;
3
- using jeanf.questsystem;
4
-
5
- public class QuestStepNode : BaseNode
6
- {
7
- [Input(name = "A")]
8
- private QuestStep StepsRequiredForCompletion;
9
- [Output(name = "Out")]
10
- private QuestStep StepsTriggeredOnCompletion;
11
- }
@@ -1,11 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: feb5db492d0ac36459e73370531d6f8c
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 7b22fa752a8ac804aa1053eac644fb47
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant: