fr.jeanf.questsystem 0.0.62 → 0.0.64
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/Quests/Quest_VisitAllPlaces.prefab +4 -3
- package/Runtime/Scripts/GraphEditor/QuestGraphWindow.cs +30 -0
- package/Runtime/Scripts/GraphEditor/QuestGraphWindow.cs.meta +11 -0
- package/Runtime/Scripts/GraphEditor/QuestStepNode.cs +11 -0
- package/Runtime/Scripts/GraphEditor/QuestStepNode.cs.meta +11 -0
- package/Runtime/Scripts/GraphEditor.meta +8 -0
- package/Runtime/Scripts/jeanf.QuestSystem.asmdef +3 -1
- package/Runtime/Scripts/quests/MultiQuestStep.cs +44 -0
- package/Runtime/Scripts/quests/MultiQuestStep.cs.meta +11 -0
- package/package.json +2 -2
|
@@ -28,13 +28,13 @@ Transform:
|
|
|
28
28
|
m_PrefabInstance: {fileID: 0}
|
|
29
29
|
m_PrefabAsset: {fileID: 0}
|
|
30
30
|
m_GameObject: {fileID: 5258580714634048286}
|
|
31
|
-
serializedVersion: 2
|
|
32
31
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
33
32
|
m_LocalPosition: {x: 7.37, y: 1, z: 6.08}
|
|
34
33
|
m_LocalScale: {x: 3, y: 3, z: 3}
|
|
35
34
|
m_ConstrainProportionsScale: 0
|
|
36
35
|
m_Children: []
|
|
37
36
|
m_Father: {fileID: 0}
|
|
37
|
+
m_RootOrder: -2
|
|
38
38
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
39
39
|
--- !u!33 &7682207879693783699
|
|
40
40
|
MeshFilter:
|
|
@@ -171,7 +171,8 @@ MonoBehaviour:
|
|
|
171
171
|
progress: 0
|
|
172
172
|
clearToStart: 0
|
|
173
173
|
QuestProgress: {fileID: 11400000, guid: d6b05e1957994c8449fb72e849a2a3d6, type: 2}
|
|
174
|
-
StartQuestEventChannel: {fileID: 11400000, guid: c510c1e4d26428740b3e329cca98e5d1,
|
|
175
|
-
type: 2}
|
|
176
174
|
QuestInitialCheck: {fileID: 11400000, guid: 4f5235d1ff779064cabee9ca65296d7f, type: 2}
|
|
175
|
+
resetChannel: {fileID: 11400000, guid: f5878d9ead688634e8a37cb28026e722, type: 2}
|
|
177
176
|
requirementCheck: {fileID: 11400000, guid: a4dae407f780f974abbf43c280515876, type: 2}
|
|
177
|
+
loadRequiredScenesEventChannel: {fileID: 0}
|
|
178
|
+
unlockDoorsEventChannel: {fileID: 0}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
"GUID:e8958e6939af7314a97769de4be4ce25",
|
|
8
8
|
"GUID:db1b0a3157155ad47996061dbcc07bbb",
|
|
9
9
|
"GUID:ca937d03ee5dd4d699091438dc0f3ae6",
|
|
10
|
-
"GUID:a432eb0a70c5c4a37ab50d59671586f8"
|
|
10
|
+
"GUID:a432eb0a70c5c4a37ab50d59671586f8",
|
|
11
|
+
"GUID:b8e24fd1eb19b4226afebb2810e3c19b",
|
|
12
|
+
"GUID:002c1bbed08fa44d282ef34fd5edb138"
|
|
11
13
|
],
|
|
12
14
|
"includePlatforms": [],
|
|
13
15
|
"excludePlatforms": [],
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace jeanf.questsystem
|
|
6
|
+
{
|
|
7
|
+
public class MultiQuestStep : QuestStep
|
|
8
|
+
{
|
|
9
|
+
[SerializeField] List<QuestStep> steps = new List<QuestStep>();
|
|
10
|
+
[SerializeField] Dictionary<string, QuestStep> stepsDictionary = new Dictionary<string, QuestStep>();
|
|
11
|
+
private void OnEnable()
|
|
12
|
+
{
|
|
13
|
+
base.OnEnable();
|
|
14
|
+
foreach(QuestStep step in steps)
|
|
15
|
+
{
|
|
16
|
+
childStep.Invoke(step);
|
|
17
|
+
sendNextStepId?.Invoke(step.StepId);
|
|
18
|
+
stepsDictionary.Add(step.StepId, step);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
stepCompleted += str => RemoveStepFromBundle(str);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected override void Unsubscribe()
|
|
25
|
+
{
|
|
26
|
+
base.Unsubscribe();
|
|
27
|
+
stepCompleted -= str => RemoveStepFromBundle(str);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private void RemoveStepFromBundle(string stepId)
|
|
31
|
+
{
|
|
32
|
+
if (stepsDictionary.ContainsKey(stepId))
|
|
33
|
+
{
|
|
34
|
+
stepsDictionary.Remove(stepId);
|
|
35
|
+
|
|
36
|
+
if (stepsDictionary.Count <= 0)
|
|
37
|
+
{
|
|
38
|
+
FinishQuestStep();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fr.jeanf.questsystem",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.64",
|
|
4
4
|
"displayName": "Quest system",
|
|
5
5
|
"description": "This package uses Scriptable Objects to define quests.",
|
|
6
6
|
"unity": "2021.3",
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
"fr.jeanf.propertydrawer": "1.1.6"
|
|
18
18
|
},
|
|
19
19
|
"samples": []
|
|
20
|
-
}
|
|
20
|
+
}
|