Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Unload Profile#

Save & Load / Unload Profile

Description#

Unloads the current save and returns to the default values

Parameters#

Name Description
Scene The scene to load when resetting the save

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Unload Profile")]
    [Image(typeof(IconDiskSolid), ColorTheme.Type.TextLight, typeof(BadgeCross))]
    
    [Description("Unloads the current save and returns to the default values")]
    [Category("Save & Load/Unload Profile")]
    
    [Parameter("Scene", "The scene to load when resetting the save")]
    
    [Keywords("Reset", "Restart", "Main", "Menu")]
    
    [Serializable]
    public class InstructionCoreLoadUnload : Instruction
    {
        [SerializeField] private GetScene m_Scene = new GetScene();

        protected override string GetTitle(GameObject source) => $"Unload to {this.m_Scene}";

        protected override async Awaitable Run(Args args)
        {
            int sceneIndex = this.m_Scene.Get(args);
            await SaveLoadManager.Unload(sceneIndex);
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.