// Copyright (c) Pixel Crushers. All rights reserved.
usingUnityEngine;
namespacePixelCrushers
{
/// <summary>
/// Abstract base class for a "saver", which is a component that contributes
/// to saved game data.
/// </summary>
publicabstractclassSaver:MonoBehaviour
{
[Tooltip("Save data under this key. If blank, use GameObject name.")]
[SerializeField]
privatestringm_key;
[Tooltip("Append the name of this saver type to the key.")]
[SerializeField]
privateboolm_appendSaverTypeToKey;
[Tooltip("Save when changing scenes to be able to restore saved state when returning to scene.")]
[SerializeField]
privateboolm_saveAcrossSceneChanges=true;
[Tooltip("When starting, restore this saver's state from current saved game data. Normally the save system restores state when loading games or changing scenes without this checkbox.")]
[SerializeField]
privateboolm_restoreStateOnStart=false;
protectedstringm_runtimeKey=null;
/// <summary>
/// Append the name of this saver type to the key.
/// </summary>
publicboolappendSaverTypeToKey
{
get{returnm_appendSaverTypeToKey;}
set{m_appendSaverTypeToKey=value;}
}
/// <summary>
/// Save data under this key. If blank, use GameObject name.