fr.jeanf.questsystem 0.0.36 → 0.0.38
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/QuestManager.cs +7 -11
- package/Runtime/Scripts/Core/QuestStep.cs +5 -12
- package/package.json +1 -1
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Comparison.cs +0 -39
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Comparison.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalLink.cs +0 -4
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalLink.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalNode.cs +0 -72
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalProcessor.cs +0 -200
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/ConditionalProcessor.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Editor/ComparisonView.cs +0 -49
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Editor/ComparisonView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Editor/ConditionalProcessorView.cs +0 -53
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Editor/ConditionalProcessorView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/Editor.meta +0 -8
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/IConditionalNode.cs +0 -12
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/IConditionalNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/RuntimeConditionalGraph.cs +0 -19
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/RuntimeConditionalGraph.cs.meta +0 -3
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/StartNode.cs +0 -24
- package/Runtime/Scripts/NodeGraph/ConditionalGraph/StartNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/ConditionalGraph.meta +0 -8
- package/Runtime/Scripts/NodeGraph/CustomConvertions.cs +0 -17
- package/Runtime/Scripts/NodeGraph/CustomConvertions.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/AbstractNodeView.cs +0 -17
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/AbstractNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/CircleRadiansView.cs +0 -49
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/CircleRadiansView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/ColorNodeView.cs +0 -18
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/ColorNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/FloatNodeView.cs +0 -31
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/FloatNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/ForLoopNodeView.cs +0 -23
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/ForLoopNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/IfNodeView.cs +0 -22
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/IfNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/MessageNode2View.cs +0 -16
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/MessageNode2View.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/MutliAddNodeView.cs +0 -27
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/MutliAddNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/PrefabNodeView.cs +0 -41
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/PrefabNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/PrintNodeView.cs +0 -67
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/PrintNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/SettingsNodeView.cs +0 -32
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/SettingsNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/StringNodeView.cs +0 -28
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/StringNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/SwitchNodeView.cs +0 -21
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/SwitchNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/TypeSwitchNodeView.cs +0 -25
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor/TypeSwitchNodeView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Editor.meta +0 -8
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/AbstractNode.cs +0 -26
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/AbstractNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CircleRadians.cs +0 -28
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CircleRadians.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ColorNode.cs +0 -14
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ColorNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ConsoleLogNode.cs +0 -41
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ConsoleLogNode.cs.meta +0 -3
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CustomPortDataNode.cs +0 -52
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CustomPortDataNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CustomPortsNode.cs +0 -64
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/CustomPortsNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/DrawerFieldTestNode.cs +0 -56
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/DrawerFieldTestNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/FieldTestNode.cs +0 -28
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/FieldTestNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/FloatNode.cs +0 -18
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/FloatNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ForLoopNode.cs +0 -42
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ForLoopNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/GameObjectNode.cs +0 -20
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/GameObjectNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/IfNode.cs +0 -33
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/IfNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/Inheritance1.cs +0 -24
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/Inheritance1.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/Inheritance2.cs +0 -24
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/Inheritance2.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/InheritanceBase.cs +0 -24
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/InheritanceBase.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/InspectorNode.cs +0 -27
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/InspectorNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ListNode.cs +0 -24
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/ListNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MessageNode.cs +0 -27
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MessageNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MessageNode2.cs +0 -22
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MessageNode2.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MultiAddNode.cs +0 -40
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/MultiAddNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/OutputNode.cs +0 -21
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/OutputNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PortConnectionTests.cs +0 -47
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PortConnectionTests.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PrefabNode.cs +0 -14
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PrefabNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PrintNode.cs +0 -23
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/PrintNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/RenamableNode.cs +0 -18
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/RenamableNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SettingsNode.cs +0 -27
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SettingsNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/StringNode.cs +0 -14
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/StringNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SubNode.cs +0 -24
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SubNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SwitchNode.cs +0 -22
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/SwitchNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/TextNode.cs +0 -14
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/TextNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/TypeSwitchNode.cs +0 -32
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/TypeSwitchNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/UnityEventNode.cs +0 -22
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/UnityEventNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VectorNode.cs +0 -22
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VectorNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VerticalNode.cs +0 -23
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VerticalNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VerticalNode2.cs +0 -25
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VerticalNode2.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VisibleIfAttributeNode.cs +0 -49
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/VisibleIfAttributeNode.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/WaitFrameNode.cs +0 -48
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/WaitFrameNode.cs.meta +0 -3
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/WaitNode.cs +0 -48
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes/WaitNode.cs.meta +0 -3
- package/Runtime/Scripts/NodeGraph/DefaultNodes/Nodes.meta +0 -8
- package/Runtime/Scripts/NodeGraph/DefaultNodes.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/01_DefaultGraph/DefaultGraphWindow.cs +0 -41
- package/Runtime/Scripts/NodeGraph/Editor/01_DefaultGraph/DefaultGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/01_DefaultGraph.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/02_CustomContextMenu/CustomContextMenuGraphView.cs +0 -34
- package/Runtime/Scripts/NodeGraph/Editor/02_CustomContextMenu/CustomContextMenuGraphView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/02_CustomContextMenu/CustomContextMenuGraphWindow.cs +0 -44
- package/Runtime/Scripts/NodeGraph/Editor/02_CustomContextMenu/CustomContextMenuGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/02_CustomContextMenu.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarGraphView.cs +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarGraphView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarGraphWindow.cs +0 -44
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarView.cs +0 -23
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar/CustomToolbarView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/03_CustomToolbar.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraph.cs +0 -10
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraph.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraphView.cs +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraphView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraphWindow.cs +0 -46
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties/ExposedPropertiesGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/04_ExposedProperties.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/05_All/AllGraphView.cs +0 -28
- package/Runtime/Scripts/NodeGraph/Editor/05_All/AllGraphView.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/05_All/AllGraphWindow.cs +0 -52
- package/Runtime/Scripts/NodeGraph/Editor/05_All/AllGraphWindow.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/05_All.meta +0 -8
- package/Runtime/Scripts/NodeGraph/Editor/GraphAssetCallbacks.cs +0 -30
- package/Runtime/Scripts/NodeGraph/Editor/GraphAssetCallbacks.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/GraphAssetInspector.cs +0 -36
- package/Runtime/Scripts/NodeGraph/Editor/GraphAssetInspector.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/GraphBehaviourEditor.cs +0 -35
- package/Runtime/Scripts/NodeGraph/Editor/GraphBehaviourEditor.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor/GraphProcessorMenuItems.cs +0 -13
- package/Runtime/Scripts/NodeGraph/Editor/GraphProcessorMenuItems.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/Editor.meta +0 -8
- package/Runtime/Scripts/NodeGraph/GraphBehaviour.cs +0 -16
- package/Runtime/Scripts/NodeGraph/GraphBehaviour.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/RuntimeGraph/RuntimeGraph.cs +0 -31
- package/Runtime/Scripts/NodeGraph/RuntimeGraph/RuntimeGraph.cs.meta +0 -11
- package/Runtime/Scripts/NodeGraph/RuntimeGraph.meta +0 -8
- package/Runtime/Scripts/NodeGraph.meta +0 -8
- package/Runtime/Scripts/Nodes/EndNode.cs +0 -14
- package/Runtime/Scripts/Nodes/EndNode.cs.meta +0 -11
- package/Runtime/Scripts/Nodes/QuestFinished.asset +0 -16
- package/Runtime/Scripts/Nodes/QuestFinished.asset.meta +0 -8
- package/Runtime/Scripts/Nodes/QuestStarted.asset +0 -16
- package/Runtime/Scripts/Nodes/QuestStarted.asset.meta +0 -8
- package/Runtime/Scripts/Nodes/QuestStepNode.cs +0 -64
- package/Runtime/Scripts/Nodes/QuestStepNode.cs.meta +0 -11
- package/Runtime/Scripts/Nodes/QuestTree.asset +0 -153
- package/Runtime/Scripts/Nodes/QuestTree.asset.meta +0 -8
- package/Runtime/Scripts/Nodes/StepStarted.asset +0 -16
- package/Runtime/Scripts/Nodes/StepStarted.asset.meta +0 -8
- package/Runtime/Scripts/Nodes.meta +0 -8
|
@@ -169,13 +169,6 @@ namespace jeanf.questsystem
|
|
|
169
169
|
GameEventsManager.instance.scenarioEvents.ScenarioUnlocked(quest.questSO.unlockedScenario);
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
//private void QuestStepStateChange(string id, int stepIndex, QuestStepState questStepState)
|
|
173
|
-
//{
|
|
174
|
-
// Quest quest = GetQuestById(id);
|
|
175
|
-
// quest.StoreQuestStepState(questStepState, stepIndex);
|
|
176
|
-
// ChangeQuestState(id, quest.state);
|
|
177
|
-
//}
|
|
178
|
-
|
|
179
172
|
private Dictionary<string, Quest> CreateQuestMap()
|
|
180
173
|
{
|
|
181
174
|
// loads all QuestInfoSO Scriptable Objects under the Assets/Resources/Quests folder
|
|
@@ -240,25 +233,28 @@ namespace jeanf.questsystem
|
|
|
240
233
|
|
|
241
234
|
private Quest LoadQuest(QuestSO questSO)
|
|
242
235
|
{
|
|
243
|
-
|
|
236
|
+
Debug.Log($"attempting to load quest with id: [{questSO.id}]");
|
|
237
|
+
var quest = new Quest(questSO);
|
|
244
238
|
try
|
|
245
239
|
{
|
|
246
240
|
// load quest from saved data
|
|
247
241
|
if (PlayerPrefs.HasKey(questSO.id) && loadSavedQuestState)
|
|
248
242
|
{
|
|
249
|
-
|
|
250
|
-
|
|
243
|
+
var serializedData = PlayerPrefs.GetString(questSO.id);
|
|
244
|
+
var questData = JsonUtility.FromJson<QuestData>(serializedData);
|
|
251
245
|
quest = new Quest(questSO, questData.state, questData.questStepIndex, questData.questStepStates);
|
|
246
|
+
Debug.Log($"loaded previously saved quest with id: [{quest.questSO.id}]");
|
|
252
247
|
}
|
|
253
248
|
// otherwise, initialize a new quest
|
|
254
249
|
else
|
|
255
250
|
{
|
|
256
251
|
quest = new Quest(questSO);
|
|
252
|
+
Debug.Log($"loaded a fresh instance of quest with id: [{quest.questSO.id}]");
|
|
257
253
|
}
|
|
258
254
|
}
|
|
259
255
|
catch (System.Exception e)
|
|
260
256
|
{
|
|
261
|
-
Debug.LogError("Failed to load quest with id
|
|
257
|
+
Debug.LogError($"Failed to load quest with id: [{quest.questSO.id}] - exception: {e}");
|
|
262
258
|
}
|
|
263
259
|
|
|
264
260
|
return quest;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
using jeanf.EventSystem;
|
|
2
|
-
using jeanf.propertyDrawer
|
|
3
|
-
using jeanf.tooltip;
|
|
2
|
+
using jeanf.propertyDrawer;
|
|
4
3
|
using UnityEngine;
|
|
5
4
|
using UnityEngine.Playables;
|
|
6
|
-
using System;
|
|
7
5
|
using System.Collections.Generic;
|
|
8
|
-
using System.Linq;
|
|
9
6
|
using GraphProcessor;
|
|
10
|
-
using NodeGraphProcessor.Examples;
|
|
11
7
|
|
|
12
8
|
namespace jeanf.questsystem
|
|
13
9
|
{
|
|
@@ -99,13 +95,10 @@ namespace jeanf.questsystem
|
|
|
99
95
|
sendNextStepId?.Invoke(questStep.stepId);
|
|
100
96
|
}
|
|
101
97
|
stepCompleted?.Invoke(stepId);
|
|
102
|
-
stepActive?.Invoke(stepId, stepStatus);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//if(isDebug) Debug.Log($"sending trigger to timeline: {timeline.name}, triggerValue: false");
|
|
107
|
-
//_timelineTriggerEventChannelSo.RaiseEvent(timeline, false);
|
|
108
|
-
|
|
98
|
+
stepActive?.Invoke(stepId, stepStatus);
|
|
99
|
+
|
|
100
|
+
//stops the timeline in case it were playing
|
|
101
|
+
_timelineTriggerEventChannelSo.RaiseEvent(timeline, false);
|
|
109
102
|
}
|
|
110
103
|
|
|
111
104
|
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
using GraphProcessor;
|
|
2
|
-
using UnityEngine.Rendering;
|
|
3
|
-
|
|
4
|
-
namespace NodeGraphProcessor.Examples
|
|
5
|
-
{
|
|
6
|
-
[System.Serializable, NodeMenuItem("Conditional/Comparison")]
|
|
7
|
-
public class Comparison : BaseNode
|
|
8
|
-
{
|
|
9
|
-
[Input(name = "In A")]
|
|
10
|
-
public float inA;
|
|
11
|
-
|
|
12
|
-
[Input(name = "In B")]
|
|
13
|
-
public float inB;
|
|
14
|
-
|
|
15
|
-
[Output(name = "Out")]
|
|
16
|
-
public bool compared;
|
|
17
|
-
|
|
18
|
-
public CompareFunction compareFunction = CompareFunction.LessEqual;
|
|
19
|
-
|
|
20
|
-
public override string name => "Comparison";
|
|
21
|
-
|
|
22
|
-
protected override void Process()
|
|
23
|
-
{
|
|
24
|
-
switch (compareFunction)
|
|
25
|
-
{
|
|
26
|
-
default:
|
|
27
|
-
case CompareFunction.Disabled:
|
|
28
|
-
case CompareFunction.Never: compared = false; break;
|
|
29
|
-
case CompareFunction.Always: compared = true; break;
|
|
30
|
-
case CompareFunction.Equal: compared = inA == inB; break;
|
|
31
|
-
case CompareFunction.Greater: compared = inA > inB; break;
|
|
32
|
-
case CompareFunction.GreaterEqual: compared = inA >= inB; break;
|
|
33
|
-
case CompareFunction.Less: compared = inA < inB; break;
|
|
34
|
-
case CompareFunction.LessEqual: compared = inA <= inB; break;
|
|
35
|
-
case CompareFunction.NotEqual: compared = inA != inB; break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using System.Collections;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using System.Linq;
|
|
5
|
-
using System.Reflection;
|
|
6
|
-
using GraphProcessor;
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
|
|
9
|
-
namespace NodeGraphProcessor.Examples
|
|
10
|
-
{
|
|
11
|
-
[System.Serializable]
|
|
12
|
-
/// <summary>
|
|
13
|
-
/// This is the base class for every node that is executed by the conditional processor, it takes an executed bool as input to
|
|
14
|
-
/// </summary>
|
|
15
|
-
public abstract class ConditionalNode : BaseNode, IConditionalNode
|
|
16
|
-
{
|
|
17
|
-
// These booleans will controls wether or not the execution of the folowing nodes will be done or discarded.
|
|
18
|
-
[Input(name = "Executed", allowMultiple = true)]
|
|
19
|
-
public ConditionalLink executed;
|
|
20
|
-
|
|
21
|
-
public abstract IEnumerable< ConditionalNode > GetExecutedNodes();
|
|
22
|
-
|
|
23
|
-
// Assure that the executed field is always at the top of the node port section
|
|
24
|
-
public override FieldInfo[] GetNodeFields()
|
|
25
|
-
{
|
|
26
|
-
var fields = base.GetNodeFields();
|
|
27
|
-
Array.Sort(fields, (f1, f2) => f1.Name == nameof(executed) ? -1 : 1);
|
|
28
|
-
return fields;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[System.Serializable]
|
|
33
|
-
/// <summary>
|
|
34
|
-
/// This class represent a simple node which takes one event in parameter and pass it to the next node
|
|
35
|
-
/// </summary>
|
|
36
|
-
public abstract class LinearConditionalNode : ConditionalNode, IConditionalNode
|
|
37
|
-
{
|
|
38
|
-
[Output(name = "Executes")]
|
|
39
|
-
public ConditionalLink executes;
|
|
40
|
-
|
|
41
|
-
public override IEnumerable< ConditionalNode > GetExecutedNodes()
|
|
42
|
-
{
|
|
43
|
-
// Return all the nodes connected to the executes port
|
|
44
|
-
return outputPorts.FirstOrDefault(n => n.fieldName == nameof(executes))
|
|
45
|
-
.GetEdges().Select(e => e.inputNode as ConditionalNode);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[System.Serializable]
|
|
50
|
-
/// <summary>
|
|
51
|
-
/// This class represent a waitable node which invokes another node after a time/frame
|
|
52
|
-
/// </summary>
|
|
53
|
-
public abstract class WaitableNode : LinearConditionalNode
|
|
54
|
-
{
|
|
55
|
-
[Output(name = "Execute After")]
|
|
56
|
-
public ConditionalLink executeAfter;
|
|
57
|
-
|
|
58
|
-
protected void ProcessFinished()
|
|
59
|
-
{
|
|
60
|
-
onProcessFinished.Invoke(this);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
[HideInInspector]
|
|
64
|
-
public Action<WaitableNode> onProcessFinished;
|
|
65
|
-
|
|
66
|
-
public IEnumerable< ConditionalNode > GetExecuteAfterNodes()
|
|
67
|
-
{
|
|
68
|
-
return outputPorts.FirstOrDefault(n => n.fieldName == nameof(executeAfter))
|
|
69
|
-
.GetEdges().Select(e => e.inputNode as ConditionalNode);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
using System.Collections.Generic;
|
|
2
|
-
using System.Linq;
|
|
3
|
-
using GraphProcessor;
|
|
4
|
-
using Debug = UnityEngine.Debug;
|
|
5
|
-
|
|
6
|
-
namespace NodeGraphProcessor.Examples
|
|
7
|
-
{
|
|
8
|
-
public class ConditionalProcessor : BaseGraphProcessor
|
|
9
|
-
{
|
|
10
|
-
List< BaseNode > processList;
|
|
11
|
-
List< StartNode > startNodeList;
|
|
12
|
-
|
|
13
|
-
Dictionary<BaseNode, List<BaseNode>> nonConditionalDependenciesCache = new Dictionary<BaseNode, List<BaseNode>>();
|
|
14
|
-
|
|
15
|
-
public bool pause;
|
|
16
|
-
|
|
17
|
-
public IEnumerator<BaseNode> currentGraphExecution { get; private set; } = null;
|
|
18
|
-
|
|
19
|
-
// static readonly float maxExecutionTimeMS = 100; // 100 ms max execution time to avoid infinite loops
|
|
20
|
-
|
|
21
|
-
/// <summary>
|
|
22
|
-
/// Manage graph scheduling and processing
|
|
23
|
-
/// </summary>
|
|
24
|
-
/// <param name="graph">Graph to be processed</param>
|
|
25
|
-
public ConditionalProcessor(BaseGraph graph) : base(graph) {}
|
|
26
|
-
|
|
27
|
-
public override void UpdateComputeOrder()
|
|
28
|
-
{
|
|
29
|
-
// Gather start nodes:
|
|
30
|
-
startNodeList = graph.nodes.Where(n => n is StartNode).Select(n => n as StartNode).ToList();
|
|
31
|
-
|
|
32
|
-
// In case there is no start node, we process the graph like usual
|
|
33
|
-
if (startNodeList.Count == 0)
|
|
34
|
-
{
|
|
35
|
-
processList = graph.nodes.OrderBy(n => n.computeOrder).ToList();
|
|
36
|
-
}
|
|
37
|
-
else
|
|
38
|
-
{
|
|
39
|
-
nonConditionalDependenciesCache.Clear();
|
|
40
|
-
// Prepare the cache of non-conditional node execution
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public override void Run()
|
|
45
|
-
{
|
|
46
|
-
IEnumerator<BaseNode> enumerator;
|
|
47
|
-
|
|
48
|
-
if(startNodeList.Count == 0)
|
|
49
|
-
{
|
|
50
|
-
enumerator = RunTheGraph();
|
|
51
|
-
}
|
|
52
|
-
else
|
|
53
|
-
{
|
|
54
|
-
Stack<BaseNode> nodeToExecute = new Stack<BaseNode>();
|
|
55
|
-
// Add all the start nodes to the execution stack
|
|
56
|
-
startNodeList.ForEach(s => nodeToExecute.Push(s));
|
|
57
|
-
// Execute the whole graph:
|
|
58
|
-
enumerator = RunTheGraph(nodeToExecute);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
while(enumerator.MoveNext());
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private void WaitedRun(Stack<BaseNode> nodesToRun)
|
|
65
|
-
{
|
|
66
|
-
// Execute the waitable node:
|
|
67
|
-
var enumerator = RunTheGraph(nodesToRun);
|
|
68
|
-
|
|
69
|
-
while(enumerator.MoveNext())
|
|
70
|
-
;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
IEnumerable<BaseNode> GatherNonConditionalDependencies(BaseNode node)
|
|
74
|
-
{
|
|
75
|
-
Stack<BaseNode> dependencies = new Stack<BaseNode>();
|
|
76
|
-
|
|
77
|
-
dependencies.Push(node);
|
|
78
|
-
|
|
79
|
-
while (dependencies.Count > 0)
|
|
80
|
-
{
|
|
81
|
-
var dependency = dependencies.Pop();
|
|
82
|
-
|
|
83
|
-
foreach (var d in dependency.GetInputNodes().Where(n => !(n is IConditionalNode)))
|
|
84
|
-
dependencies.Push(d);
|
|
85
|
-
|
|
86
|
-
if (dependency != node)
|
|
87
|
-
yield return dependency;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
private IEnumerator<BaseNode> RunTheGraph()
|
|
92
|
-
{
|
|
93
|
-
int count = processList.Count;
|
|
94
|
-
|
|
95
|
-
for(int i = 0; i < count; i++)
|
|
96
|
-
{
|
|
97
|
-
processList[i].OnProcess();
|
|
98
|
-
yield return processList[i];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
private IEnumerator<BaseNode> RunTheGraph(Stack<BaseNode> nodeToExecute)
|
|
103
|
-
{
|
|
104
|
-
HashSet<BaseNode> nodeDependenciesGathered = new HashSet<BaseNode>();
|
|
105
|
-
HashSet<BaseNode> skipConditionalHandling = new HashSet<BaseNode>();
|
|
106
|
-
|
|
107
|
-
while(nodeToExecute.Count > 0)
|
|
108
|
-
{
|
|
109
|
-
var node = nodeToExecute.Pop();
|
|
110
|
-
// TODO: maxExecutionTimeMS
|
|
111
|
-
|
|
112
|
-
// In case the node is conditional, then we need to execute it's non-conditional dependencies first
|
|
113
|
-
if(node is IConditionalNode && !skipConditionalHandling.Contains(node))
|
|
114
|
-
{
|
|
115
|
-
// Gather non-conditional deps: TODO, move to the cache:
|
|
116
|
-
if(nodeDependenciesGathered.Contains(node))
|
|
117
|
-
{
|
|
118
|
-
// Execute the conditional node:
|
|
119
|
-
node.OnProcess();
|
|
120
|
-
yield return node;
|
|
121
|
-
|
|
122
|
-
// And select the next nodes to execute:
|
|
123
|
-
switch(node)
|
|
124
|
-
{
|
|
125
|
-
// special code path for the loop node as it will execute multiple times the same nodes
|
|
126
|
-
case ForLoopNode forLoopNode:
|
|
127
|
-
forLoopNode.index = forLoopNode.start - 1; // Initialize the start index
|
|
128
|
-
foreach(var n in forLoopNode.GetExecutedNodesLoopCompleted())
|
|
129
|
-
nodeToExecute.Push(n);
|
|
130
|
-
for(int i = forLoopNode.start; i < forLoopNode.end; i++)
|
|
131
|
-
{
|
|
132
|
-
foreach(var n in forLoopNode.GetExecutedNodesLoopBody())
|
|
133
|
-
nodeToExecute.Push(n);
|
|
134
|
-
|
|
135
|
-
nodeToExecute.Push(node); // Increment the counter
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
skipConditionalHandling.Add(node);
|
|
139
|
-
break;
|
|
140
|
-
// another special case for waitable nodes, like "wait for a coroutine", wait x seconds", etc.
|
|
141
|
-
case WaitableNode waitableNode:
|
|
142
|
-
foreach(var n in waitableNode.GetExecutedNodes())
|
|
143
|
-
nodeToExecute.Push(n);
|
|
144
|
-
|
|
145
|
-
waitableNode.onProcessFinished += (waitedNode) =>
|
|
146
|
-
{
|
|
147
|
-
Stack<BaseNode> waitedNodes = new Stack<BaseNode>();
|
|
148
|
-
foreach(var n in waitedNode.GetExecuteAfterNodes())
|
|
149
|
-
waitedNodes.Push(n);
|
|
150
|
-
WaitedRun(waitedNodes);
|
|
151
|
-
waitableNode.onProcessFinished = null;
|
|
152
|
-
};
|
|
153
|
-
break;
|
|
154
|
-
case IConditionalNode cNode:
|
|
155
|
-
foreach(var n in cNode.GetExecutedNodes())
|
|
156
|
-
nodeToExecute.Push(n);
|
|
157
|
-
break;
|
|
158
|
-
default:
|
|
159
|
-
Debug.LogError($"Conditional node {node} not handled");
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
nodeDependenciesGathered.Remove(node);
|
|
164
|
-
}
|
|
165
|
-
else
|
|
166
|
-
{
|
|
167
|
-
nodeToExecute.Push(node);
|
|
168
|
-
nodeDependenciesGathered.Add(node);
|
|
169
|
-
foreach(var nonConditionalNode in GatherNonConditionalDependencies(node))
|
|
170
|
-
{
|
|
171
|
-
nodeToExecute.Push(nonConditionalNode);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
else
|
|
176
|
-
{
|
|
177
|
-
node.OnProcess();
|
|
178
|
-
yield return node;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Advance the execution of the graph of one node, mostly for debug. Doesn't work for WaitableNode's executeAfter port.
|
|
184
|
-
public void Step()
|
|
185
|
-
{
|
|
186
|
-
if (currentGraphExecution == null)
|
|
187
|
-
{
|
|
188
|
-
Stack<BaseNode> nodeToExecute = new Stack<BaseNode>();
|
|
189
|
-
if(startNodeList.Count > 0)
|
|
190
|
-
startNodeList.ForEach(s => nodeToExecute.Push(s));
|
|
191
|
-
|
|
192
|
-
currentGraphExecution = startNodeList.Count == 0 ? RunTheGraph() : RunTheGraph(nodeToExecute);
|
|
193
|
-
currentGraphExecution.MoveNext(); // Advance to the first node
|
|
194
|
-
}
|
|
195
|
-
else
|
|
196
|
-
if (!currentGraphExecution.MoveNext())
|
|
197
|
-
currentGraphExecution = null;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
using System.Collections;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
using UnityEditor;
|
|
5
|
-
using UnityEditor.UIElements;
|
|
6
|
-
using UnityEditor.Experimental.GraphView;
|
|
7
|
-
using UnityEngine.UIElements;
|
|
8
|
-
using GraphProcessor;
|
|
9
|
-
using NodeGraphProcessor.Examples;
|
|
10
|
-
|
|
11
|
-
[NodeCustomEditor(typeof(Comparison))]
|
|
12
|
-
public class ComparisonView : BaseNodeView
|
|
13
|
-
{
|
|
14
|
-
public override void Enable()
|
|
15
|
-
{
|
|
16
|
-
Comparison comparisonNode = nodeTarget as Comparison;
|
|
17
|
-
DrawDefaultInspector();
|
|
18
|
-
|
|
19
|
-
var inputA = new FloatField("In A") { value = comparisonNode.inA };
|
|
20
|
-
var inputB = new FloatField("In B") { value = comparisonNode.inB };
|
|
21
|
-
inputA.RegisterValueChangedCallback(v => {
|
|
22
|
-
owner.RegisterCompleteObjectUndo("Change InA value");
|
|
23
|
-
comparisonNode.inA = v.newValue;
|
|
24
|
-
});
|
|
25
|
-
inputB.RegisterValueChangedCallback(v => {
|
|
26
|
-
owner.RegisterCompleteObjectUndo("Change InB value");
|
|
27
|
-
comparisonNode.inB = v.newValue;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
nodeTarget.onAfterEdgeConnected += UpdateVisibleFields;
|
|
31
|
-
nodeTarget.onAfterEdgeDisconnected += UpdateVisibleFields;
|
|
32
|
-
|
|
33
|
-
UpdateVisibleFields(null);
|
|
34
|
-
|
|
35
|
-
void UpdateVisibleFields(SerializableEdge _)
|
|
36
|
-
{
|
|
37
|
-
var inA = nodeTarget.GetPort(nameof(comparisonNode.inA), null);
|
|
38
|
-
var inB = nodeTarget.GetPort(nameof(comparisonNode.inB), null);
|
|
39
|
-
|
|
40
|
-
controlsContainer.Add(inputA);
|
|
41
|
-
controlsContainer.Add(inputB);
|
|
42
|
-
|
|
43
|
-
if (inA.GetEdges().Count > 0)
|
|
44
|
-
controlsContainer.Remove(inputA);
|
|
45
|
-
if (inB.GetEdges().Count > 0)
|
|
46
|
-
controlsContainer.Remove(inputB);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
using System.Collections;
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
using UnityEditor.Experimental.GraphView;
|
|
5
|
-
using UnityEditor.UIElements;
|
|
6
|
-
using UnityEngine.UIElements;
|
|
7
|
-
using GraphProcessor;
|
|
8
|
-
using NodeGraphProcessor.Examples;
|
|
9
|
-
|
|
10
|
-
public class ConditionalProcessorView : PinnedElementView
|
|
11
|
-
{
|
|
12
|
-
ConditionalProcessor processor;
|
|
13
|
-
BaseGraphView graphView;
|
|
14
|
-
|
|
15
|
-
public ConditionalProcessorView() => title = "Conditional Processor";
|
|
16
|
-
|
|
17
|
-
protected override void Initialize(BaseGraphView graphView)
|
|
18
|
-
{
|
|
19
|
-
processor = new ConditionalProcessor(graphView.graph);
|
|
20
|
-
this.graphView = graphView;
|
|
21
|
-
|
|
22
|
-
graphView.computeOrderUpdated += processor.UpdateComputeOrder;
|
|
23
|
-
|
|
24
|
-
Button runButton = new Button(OnPlay) { name = "ActionButton", text = "Run" };
|
|
25
|
-
Button stepButton = new Button(OnStep) { name = "ActionButton", text = "Step" };
|
|
26
|
-
|
|
27
|
-
content.Add(runButton);
|
|
28
|
-
content.Add(stepButton);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
void OnPlay() => processor.Run();
|
|
32
|
-
|
|
33
|
-
void OnStep()
|
|
34
|
-
{
|
|
35
|
-
BaseNodeView view;
|
|
36
|
-
|
|
37
|
-
if (processor.currentGraphExecution != null)
|
|
38
|
-
{
|
|
39
|
-
// Unhighlight the last executed node
|
|
40
|
-
view = graphView.nodeViews.Find(v => v.nodeTarget == processor.currentGraphExecution.Current);
|
|
41
|
-
view.UnHighlight();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
processor.Step();
|
|
45
|
-
|
|
46
|
-
// Display debug infos, currentGraphExecution is modified in the Step() function above
|
|
47
|
-
if (processor.currentGraphExecution != null)
|
|
48
|
-
{
|
|
49
|
-
view = graphView.nodeViews.Find(v => v.nodeTarget == processor.currentGraphExecution.Current);
|
|
50
|
-
view.Highlight();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
using System.Collections.Generic;
|
|
2
|
-
using System.Reflection;
|
|
3
|
-
|
|
4
|
-
namespace NodeGraphProcessor.Examples
|
|
5
|
-
{
|
|
6
|
-
interface IConditionalNode
|
|
7
|
-
{
|
|
8
|
-
IEnumerable< ConditionalNode > GetExecutedNodes();
|
|
9
|
-
|
|
10
|
-
FieldInfo[] GetNodeFields(); // Provide a custom order for fields (so conditional links are always at the top of the node)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
using UnityEngine;
|
|
2
|
-
using GraphProcessor;
|
|
3
|
-
using NodeGraphProcessor.Examples;
|
|
4
|
-
|
|
5
|
-
public class RuntimeConditionalGraph : MonoBehaviour
|
|
6
|
-
{
|
|
7
|
-
[Header("Graph to Run on Start")]
|
|
8
|
-
public BaseGraph graph;
|
|
9
|
-
|
|
10
|
-
private ConditionalProcessor processor;
|
|
11
|
-
|
|
12
|
-
private void Start()
|
|
13
|
-
{
|
|
14
|
-
if(graph != null)
|
|
15
|
-
processor = new ConditionalProcessor(graph);
|
|
16
|
-
|
|
17
|
-
processor.Run();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
using System.Collections.Generic;
|
|
2
|
-
using System.Linq;
|
|
3
|
-
using System.Reflection;
|
|
4
|
-
using GraphProcessor;
|
|
5
|
-
|
|
6
|
-
namespace NodeGraphProcessor.Examples
|
|
7
|
-
{
|
|
8
|
-
[System.Serializable, NodeMenuItem("Conditional/Start")]
|
|
9
|
-
public class StartNode : BaseNode, IConditionalNode
|
|
10
|
-
{
|
|
11
|
-
[Output(name = "Executes")]
|
|
12
|
-
public ConditionalLink executes;
|
|
13
|
-
|
|
14
|
-
public override string name => "Start";
|
|
15
|
-
|
|
16
|
-
public IEnumerable< ConditionalNode > GetExecutedNodes()
|
|
17
|
-
{
|
|
18
|
-
// Return all the nodes connected to the executes port
|
|
19
|
-
return GetOutputNodes().Where(n => n is ConditionalNode).Select(n => n as ConditionalNode);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public override FieldInfo[] GetNodeFields() => base.GetNodeFields();
|
|
23
|
-
}
|
|
24
|
-
}
|