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