A game about forced loneliness, made by TACStudios
1namespace Unity.VisualScripting
2{
3 /// <summary>
4 /// Forces saved variables to be saved to the PlayerPrefs.
5 /// This is useful on WebGL where automatic save on quit is not supported.
6 /// </summary>
7 [UnitCategory("Variables")]
8 public sealed class SaveVariables : Unit
9 {
10 [DoNotSerialize]
11 [PortLabelHidden]
12 public ControlInput enter { get; private set; }
13
14 [DoNotSerialize]
15 [PortLabelHidden]
16 public ControlOutput exit { get; private set; }
17
18 protected override void Definition()
19 {
20 enter = ControlInput(nameof(enter), Enter);
21 exit = ControlOutput(nameof(exit));
22
23 Succession(enter, exit);
24 }
25
26 private ControlOutput Enter(Flow arg)
27 {
28 SavedVariables.SaveDeclarations(SavedVariables.merged);
29 return exit;
30 }
31 }
32}