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.
- package/Runtime/Scripts/Core/Quest.cs +0 -1
- package/Runtime/Scripts/Core/QuestData.cs +0 -12
- package/Runtime/Scripts/Core/QuestManager.cs +0 -1
- package/Runtime/Scripts/Core/QuestSO.cs +0 -1
- package/Runtime/Scripts/Core/QuestStep.cs +12 -3
- package/Runtime/Scripts/jeanf.QuestSystem.asmdef +1 -5
- package/package.json +1 -1
- package/Runtime/Scripts/GraphEditor/QuestGraphWindow.cs +0 -30
- package/Runtime/Scripts/GraphEditor/QuestGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/GraphEditor/QuestStepNode.cs +0 -11
- package/Runtime/Scripts/GraphEditor/QuestStepNode.cs.meta +0 -11
- package/Runtime/Scripts/GraphEditor.meta +0 -8
|
@@ -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
|
}
|
|
@@ -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,
|
|
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(
|
|
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,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
|
-
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
|
-
}
|