Load Profile#
Save & Load / Load Profile
Description#
Loads a previously saved game at a specific profile slot
Parameters#
| Name | Description |
|---|---|
| Profile | The profile slot to load from |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Load Profile")]
[Image(typeof(IconDiskSolid), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]
[Description("Loads a previously saved game at a specific profile slot")]
[Category("Save & Load/Load Profile")]
[Parameter("Profile", "The profile slot to load from")]
[Serializable]
public class InstructionCoreLoadProfile : Instruction
{
[SerializeField] private GetInteger m_Profile = new GetInteger();
protected override string GetTitle(GameObject source) => $"Load from {this.m_Profile}";
protected override async Awaitable Run(Args args)
{
int profile = this.m_Profile.GetInt(args);
await SaveLoadManager.Load(profile);
}
}
}