Maze / Library /PackageCache /com.unity.visualscripting@1.8.0 /Runtime /VisualScripting.Flow /Framework /Variables /SaveVariables.cs
| namespace Unity.VisualScripting | |
| { | |
| /// <summary> | |
| /// Forces saved variables to be saved to the PlayerPrefs. | |
| /// This is useful on WebGL where automatic save on quit is not supported. | |
| /// </summary> | |
| [] | |
| public sealed class SaveVariables : Unit | |
| { | |
| [] | |
| [] | |
| public ControlInput enter { get; private set; } | |
| [] | |
| [] | |
| public ControlOutput exit { get; private set; } | |
| protected override void Definition() | |
| { | |
| enter = ControlInput(nameof(enter), Enter); | |
| exit = ControlOutput(nameof(exit)); | |
| Succession(enter, exit); | |
| } | |
| private ControlOutput Enter(Flow arg) | |
| { | |
| SavedVariables.SaveDeclarations(SavedVariables.merged); | |
| return exit; | |
| } | |
| } | |
| } | |