A game about forced loneliness, made by TACStudios
1using UnityEngine;
2
3namespace Unity.VisualScripting
4{
5 [AddComponentMenu("Visual Scripting/Script Machine")]
6 [RequireComponent(typeof(Variables))]
7 [DisableAnnotation]
8 [RenamedFrom("Bolt.FlowMachine")]
9 [RenamedFrom("Unity.VisualScripting.FlowMachine")]
10 [VisualScriptingHelpURL(typeof(ScriptMachine))]
11 public sealed class ScriptMachine : EventMachine<FlowGraph, ScriptGraphAsset>
12 {
13 public override FlowGraph DefaultGraph()
14 {
15 return FlowGraph.WithStartUpdate();
16 }
17
18 protected override void OnEnable()
19 {
20 if (hasGraph)
21 {
22 graph.StartListening(reference);
23 }
24
25 base.OnEnable();
26 }
27
28 protected override void OnInstantiateWhileEnabled()
29 {
30 if (hasGraph)
31 {
32 graph.StartListening(reference);
33 }
34
35 base.OnInstantiateWhileEnabled();
36 }
37
38 protected override void OnUninstantiateWhileEnabled()
39 {
40 base.OnUninstantiateWhileEnabled();
41
42 if (hasGraph)
43 {
44 graph.StopListening(reference);
45 }
46 }
47
48 protected override void OnDisable()
49 {
50 base.OnDisable();
51
52 if (hasGraph)
53 {
54 graph.StopListening(reference);
55 }
56 }
57
58 [ContextMenu("Show Data...")]
59 protected override void ShowData()
60 {
61 base.ShowData();
62 }
63 }
64}