SlotExists

Summary: Check whether a named save slot exists.

Description

Check whether a named save slot exists. If the result is needed repeatedly, cache it and refresh it when slots change.

Declaration

C#
public static bool SlotExists(string slot);

Parameters

ParameterTypeDescription
slotstringName of the slot.

Returns

True if the slot exists.

Example

Create CheckProfileSlot.cs and attach it to an active GameObject. This example checks once whether the project has a save in the profile1 slot.

C#
using Gley.SaveSystem;
using UnityEngine;

public class CheckProfileSlot : MonoBehaviour
{
    private void Start()
    {
        bool exists = API.SlotExists("profile1");
        Debug.Log($"Profile slot exists: {exists}", this);
    }
}
On This Page