-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.json
More file actions
142 lines (142 loc) · 46.6 KB
/
index.json
File metadata and controls
142 lines (142 loc) · 46.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
"api/editor/Aarthificial.Safekeeper.Editor.AssetLocationAttributePropertyDrawer.html": {
"href": "api/editor/Aarthificial.Safekeeper.Editor.AssetLocationAttributePropertyDrawer.html",
"title": "Class AssetLocationAttributePropertyDrawer | Safekeeper",
"keywords": "Class AssetLocationAttributePropertyDrawer Namespace Aarthificial.Safekeeper.Editor Assembly Aarthificial.Safekeeper.Editor.dll [CustomPropertyDrawer(typeof(AssetLocationAttribute))] public class AssetLocationAttributePropertyDrawer : PropertyDrawer Inheritance object GUIDrawer PropertyDrawer AssetLocationAttributePropertyDrawer Inherited Members PropertyDrawer.CreatePropertyGUI(SerializedProperty) PropertyDrawer.CanCacheInspectorGUI(SerializedProperty) PropertyDrawer.attribute PropertyDrawer.fieldInfo object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods ApplyLocation(AssetLocationAttribute, SerializedProperty) public static void ApplyLocation(AssetLocationAttribute attribute, SerializedProperty property) Parameters attribute AssetLocationAttribute property SerializedProperty GetPropertyHeight(SerializedProperty, GUIContent) Override this method to specify how tall the GUI for this field is in pixels. public override float GetPropertyHeight(SerializedProperty property, GUIContent label) Parameters property SerializedProperty The SerializedProperty to make the custom GUI for. label GUIContent The label of this property. Returns float The height in pixels. OnGUI(Rect, SerializedProperty, GUIContent) Override this method to make your own IMGUI based GUI for the property. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) Parameters position Rect Rectangle on the screen to use for the property GUI. property SerializedProperty The SerializedProperty to make the custom GUI for. label GUIContent The label of this property."
},
"api/editor/Aarthificial.Safekeeper.Editor.html": {
"href": "api/editor/Aarthificial.Safekeeper.Editor.html",
"title": "Namespace Aarthificial.Safekeeper.Editor | Safekeeper",
"keywords": "Namespace Aarthificial.Safekeeper.Editor Classes AssetLocationAttributePropertyDrawer ObjectLocationAttributePropertyDrawer SafekeeperEditor SaveLocationModificationProcessor"
},
"api/editor/Aarthificial.Safekeeper.Editor.ObjectLocationAttributePropertyDrawer.html": {
"href": "api/editor/Aarthificial.Safekeeper.Editor.ObjectLocationAttributePropertyDrawer.html",
"title": "Class ObjectLocationAttributePropertyDrawer | Safekeeper",
"keywords": "Class ObjectLocationAttributePropertyDrawer Namespace Aarthificial.Safekeeper.Editor Assembly Aarthificial.Safekeeper.Editor.dll [CustomPropertyDrawer(typeof(ObjectLocationAttribute))] public class ObjectLocationAttributePropertyDrawer : PropertyDrawer Inheritance object GUIDrawer PropertyDrawer ObjectLocationAttributePropertyDrawer Inherited Members PropertyDrawer.CreatePropertyGUI(SerializedProperty) PropertyDrawer.CanCacheInspectorGUI(SerializedProperty) PropertyDrawer.attribute PropertyDrawer.fieldInfo object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods ApplyLocation(ObjectLocationAttribute, SerializedProperty) public static void ApplyLocation(ObjectLocationAttribute attribute, SerializedProperty property) Parameters attribute ObjectLocationAttribute property SerializedProperty GetPropertyHeight(SerializedProperty, GUIContent) Override this method to specify how tall the GUI for this field is in pixels. public override float GetPropertyHeight(SerializedProperty property, GUIContent label) Parameters property SerializedProperty The SerializedProperty to make the custom GUI for. label GUIContent The label of this property. Returns float The height in pixels. OnGUI(Rect, SerializedProperty, GUIContent) Override this method to make your own IMGUI based GUI for the property. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) Parameters position Rect Rectangle on the screen to use for the property GUI. property SerializedProperty The SerializedProperty to make the custom GUI for. label GUIContent The label of this property."
},
"api/editor/Aarthificial.Safekeeper.Editor.SafekeeperEditor.html": {
"href": "api/editor/Aarthificial.Safekeeper.Editor.SafekeeperEditor.html",
"title": "Class SafekeeperEditor | Safekeeper",
"keywords": "Class SafekeeperEditor Namespace Aarthificial.Safekeeper.Editor Assembly Aarthificial.Safekeeper.Editor.dll public class SafekeeperEditor : EditorWindow Inheritance object Object ScriptableObject EditorWindow SafekeeperEditor Inherited Members EditorWindow.BeginWindows() EditorWindow.EndWindows() EditorWindow.ShowNotification(GUIContent) EditorWindow.ShowNotification(GUIContent, double) EditorWindow.RemoveNotification() EditorWindow.ShowTab() EditorWindow.Focus() EditorWindow.ShowUtility() EditorWindow.ShowPopup() EditorWindow.ShowModalUtility() EditorWindow.ShowAsDropDown(Rect, Vector2) EditorWindow.Show() EditorWindow.Show(bool) EditorWindow.ShowAuxWindow() EditorWindow.ShowModal() EditorWindow.GetWindow(Type, bool, string, bool) EditorWindow.GetWindow(Type, bool, string) EditorWindow.GetWindow(Type, bool) EditorWindow.GetWindow(Type) EditorWindow.GetWindowWithRect(Type, Rect, bool, string) EditorWindow.GetWindowWithRect(Type, Rect, bool) EditorWindow.GetWindowWithRect(Type, Rect) EditorWindow.GetWindow<T>() EditorWindow.GetWindow<T>(bool) EditorWindow.GetWindow<T>(bool, string) EditorWindow.GetWindow<T>(string) EditorWindow.GetWindow<T>(string, bool) EditorWindow.GetWindow<T>(bool, string, bool) EditorWindow.GetWindow<T>(params Type[]) EditorWindow.GetWindow<T>(string, params Type[]) EditorWindow.GetWindow<T>(string, bool, params Type[]) EditorWindow.CreateWindow<T>(params Type[]) EditorWindow.CreateWindow<T>(string, params Type[]) EditorWindow.HasOpenInstances<T>() EditorWindow.FocusWindowIfItsOpen(Type) EditorWindow.FocusWindowIfItsOpen<T>() EditorWindow.GetWindowWithRect<T>(Rect) EditorWindow.GetWindowWithRect<T>(Rect, bool) EditorWindow.GetWindowWithRect<T>(Rect, bool, string) EditorWindow.GetWindowWithRect<T>(Rect, bool, string, bool) EditorWindow.SaveChanges() EditorWindow.DiscardChanges() EditorWindow.Close() EditorWindow.Repaint() EditorWindow.SendEvent(Event) EditorWindow.GetExtraPaneTypes() EditorWindow.TryGetOverlay(string, out Overlay) EditorWindow.OnBackingScaleFactorChanged() EditorWindow.rootVisualElement EditorWindow.wantsMouseMove EditorWindow.wantsMouseEnterLeaveWindow EditorWindow.wantsLessLayoutEvents EditorWindow.autoRepaintOnSceneChange EditorWindow.maximized EditorWindow.hasFocus EditorWindow.docked EditorWindow.focusedWindow EditorWindow.mouseOverWindow EditorWindow.hasUnsavedChanges EditorWindow.saveChangesMessage EditorWindow.minSize EditorWindow.maxSize EditorWindow.title EditorWindow.titleContent EditorWindow.depthBufferBits EditorWindow.antiAlias EditorWindow.position ScriptableObject.SetDirty() ScriptableObject.CreateInstance(string) ScriptableObject.CreateInstance(Type) ScriptableObject.CreateInstance<T>() Object.GetInstanceID() Object.GetHashCode() Object.Equals(object) Object.Instantiate(Object, Vector3, Quaternion) Object.Instantiate(Object, Vector3, Quaternion, Transform) Object.Instantiate(Object) Object.Instantiate(Object, Transform) Object.Instantiate(Object, Transform, bool) Object.Instantiate<T>(T) Object.Instantiate<T>(T, Vector3, Quaternion) Object.Instantiate<T>(T, Vector3, Quaternion, Transform) Object.Instantiate<T>(T, Transform) Object.Instantiate<T>(T, Transform, bool) Object.Destroy(Object, float) Object.Destroy(Object) Object.DestroyImmediate(Object, bool) Object.DestroyImmediate(Object) Object.FindObjectsOfType(Type) Object.FindObjectsOfType(Type, bool) Object.FindObjectsByType(Type, FindObjectsSortMode) Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode) Object.DontDestroyOnLoad(Object) Object.DestroyObject(Object, float) Object.DestroyObject(Object) Object.FindSceneObjectsOfType(Type) Object.FindObjectsOfTypeIncludingAssets(Type) Object.FindObjectsOfType<T>() Object.FindObjectsByType<T>(FindObjectsSortMode) Object.FindObjectsOfType<T>(bool) Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode) Object.FindObjectOfType<T>() Object.FindObjectOfType<T>(bool) Object.FindFirstObjectByType<T>() Object.FindAnyObjectByType<T>() Object.FindFirstObjectByType<T>(FindObjectsInactive) Object.FindAnyObjectByType<T>(FindObjectsInactive) Object.FindObjectsOfTypeAll(Type) Object.FindObjectOfType(Type) Object.FindFirstObjectByType(Type) Object.FindAnyObjectByType(Type) Object.FindObjectOfType(Type, bool) Object.FindFirstObjectByType(Type, FindObjectsInactive) Object.FindAnyObjectByType(Type, FindObjectsInactive) Object.ToString() Object.name Object.hideFlags object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object)"
},
"api/editor/Aarthificial.Safekeeper.Editor.SaveLocationModificationProcessor.html": {
"href": "api/editor/Aarthificial.Safekeeper.Editor.SaveLocationModificationProcessor.html",
"title": "Class SaveLocationModificationProcessor | Safekeeper",
"keywords": "Class SaveLocationModificationProcessor Namespace Aarthificial.Safekeeper.Editor Assembly Aarthificial.Safekeeper.Editor.dll public class SaveLocationModificationProcessor : AssetModificationProcessor Inheritance object AssetModificationProcessor SaveLocationModificationProcessor Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()"
},
"api/editor/index.html": {
"href": "api/editor/index.html",
"title": "Editor API | Safekeeper",
"keywords": "Editor API"
},
"api/runtime/Aarthificial.Safekeeper.Attributes.AssetLocationAttribute.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Attributes.AssetLocationAttribute.html",
"title": "Class AssetLocationAttribute | Safekeeper",
"keywords": "Class AssetLocationAttribute Namespace Aarthificial.Safekeeper.Attributes Assembly Aarthificial.Safekeeper.dll Generates a SaveLocation for the ScriptableObject that owns this property. public class AssetLocationAttribute : PropertyAttribute Inheritance object Attribute PropertyAttribute AssetLocationAttribute Inherited Members PropertyAttribute.order Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Examples public class MyScriptableObject : ScriptableObject { [AssetLocation(\"my-assets\")] public SaveLocation Location; } Remarks The GUID of the ScriptableObject will be used as the object ID. The chunk ID can be set in the attribute's constructor and defaults to \"assets\". Constructors AssetLocationAttribute(string) public AssetLocationAttribute(string chunkId = \"assets\") Parameters chunkId string Fields ChunkId public readonly string ChunkId Field Value string"
},
"api/runtime/Aarthificial.Safekeeper.Attributes.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Attributes.html",
"title": "Namespace Aarthificial.Safekeeper.Attributes | Safekeeper",
"keywords": "Namespace Aarthificial.Safekeeper.Attributes Classes AssetLocationAttribute Generates a SaveLocation for the ScriptableObject that owns this property. ObjectLocationAttribute Generates a SaveLocation for the MonoBehaviour that owns this property."
},
"api/runtime/Aarthificial.Safekeeper.Attributes.ObjectLocationAttribute.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Attributes.ObjectLocationAttribute.html",
"title": "Class ObjectLocationAttribute | Safekeeper",
"keywords": "Class ObjectLocationAttribute Namespace Aarthificial.Safekeeper.Attributes Assembly Aarthificial.Safekeeper.dll Generates a SaveLocation for the MonoBehaviour that owns this property. public class ObjectLocationAttribute : PropertyAttribute Inheritance object Attribute PropertyAttribute ObjectLocationAttribute Inherited Members PropertyAttribute.order Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Examples public class MyComponent : MonoBehaviour { [ObjectLocation] public SaveLocation Location; } Remarks The GUID of the scene that this object belongs to will be used as the chunk ID. The object ID will be extracted from GlobalObjectId. This ensures that the location is unique to the object. If IsPrefab is true, the chunk ID will be set to \"prefabs\" and the prefab ID will be used as the object ID. In this case, the location will be shared among all instances of the prefab. Constructors ObjectLocationAttribute(bool) public ObjectLocationAttribute(bool isPrefab = false) Parameters isPrefab bool Fields IsPrefab public readonly bool IsPrefab Field Value bool"
},
"api/runtime/Aarthificial.Safekeeper.html": {
"href": "api/runtime/Aarthificial.Safekeeper.html",
"title": "Namespace Aarthificial.Safekeeper | Safekeeper",
"keywords": "Namespace Aarthificial.Safekeeper Classes SaveControllerBase A handle to the save data. SaveData A basic implementation of ISaveData that uses JSON serialization. Structs SaveLocation Represents a location in the save data. Interfaces ISaveData A common interface for representing the save data. Enums SaveMode Controls where the data is saved/loaded from."
},
"api/runtime/Aarthificial.Safekeeper.ISaveData.html": {
"href": "api/runtime/Aarthificial.Safekeeper.ISaveData.html",
"title": "Interface ISaveData | Safekeeper",
"keywords": "Interface ISaveData Namespace Aarthificial.Safekeeper Assembly Aarthificial.Safekeeper.dll A common interface for representing the save data. public interface ISaveData Methods GetChunk(string) Get the chunk with the given ID or create a new one if it doesn't exist. Dictionary<string, string> GetChunk(string chunkId) Parameters chunkId string The chunk ID. Returns Dictionary<string, string> The retrieved chunk. GetChunkIds() Get the IDs of all existing chunks. IEnumerable<string> GetChunkIds() Returns IEnumerable<string> Read<T>(SaveLocation) Read the save data from the given location. T Read<T>(SaveLocation location) where T : new() Parameters location SaveLocation The location to read from. Returns T A new instance of the data type. Type Parameters T The type of the data. Read<T>(SaveLocation, T) Read the save data from the given location into the given target. bool Read<T>(SaveLocation location, T target) Parameters location SaveLocation The location to read from. target T The target to read into. Returns bool Whether the data was read. Type Parameters T The type of the data. Write(SaveLocation, object) Write the given value to the given location. void Write(SaveLocation location, object value) Parameters location SaveLocation The location to write to. value object The value to write."
},
"api/runtime/Aarthificial.Safekeeper.Loaders.DummySaveLoader.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Loaders.DummySaveLoader.html",
"title": "Class DummySaveLoader | Safekeeper",
"keywords": "Class DummySaveLoader Namespace Aarthificial.Safekeeper.Loaders Assembly Aarthificial.Safekeeper.dll A dummy save loader that does nothing. public class DummySaveLoader : ISaveLoader Inheritance object DummySaveLoader Implements ISaveLoader Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods Create() Create the save data for this save. public Task<ISaveData> Create() Returns Task<ISaveData> The newly created save data. Remarks This method is used if the save does not exist yet. It should not save the data to the persistent storage, only create it. This data will later be passed to Save(ISaveData). Delete() Remove this save from the persistent storage. public Task Delete() Returns Task Exists() Check if the save has already been created. public Task<bool> Exists() Returns Task<bool> Whether the save exists. GetName() Get the name of this save. public Task<string> GetName() Returns Task<string> The name of this save. Remarks Used exclusively for debugging purposes. Load() Load the data from the persistent storage. public Task<ISaveData> Load() Returns Task<ISaveData> The loaded data. Save(ISaveData) Save the data to the persistent storage. public Task Save(ISaveData data) Parameters data ISaveData The data to save. Returns Task"
},
"api/runtime/Aarthificial.Safekeeper.Loaders.FileSaveLoader.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Loaders.FileSaveLoader.html",
"title": "Class FileSaveLoader | Safekeeper",
"keywords": "Class FileSaveLoader Namespace Aarthificial.Safekeeper.Loaders Assembly Aarthificial.Safekeeper.dll Stores saves in the persistent data path. public class FileSaveLoader : ISaveLoader Inheritance object FileSaveLoader Implements ISaveLoader Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Remarks The saves are stored locally in a saves directory located in the persistent data path. Constructors FileSaveLoader(string) public FileSaveLoader(string fileName) Parameters fileName string Methods Create() Create the save data for this save. public Task<ISaveData> Create() Returns Task<ISaveData> The newly created save data. Remarks This method is used if the save does not exist yet. It should not save the data to the persistent storage, only create it. This data will later be passed to Save(ISaveData). Delete() Remove this save from the persistent storage. public Task Delete() Returns Task Exists() Check if the save has already been created. public Task<bool> Exists() Returns Task<bool> Whether the save exists. GetName() Get the name of this save. public Task<string> GetName() Returns Task<string> The name of this save. Remarks Used exclusively for debugging purposes. Load() Load the data from the persistent storage. public Task<ISaveData> Load() Returns Task<ISaveData> The loaded data. Save(ISaveData) Save the data to the persistent storage. public Task Save(ISaveData data) Parameters data ISaveData The data to save. Returns Task"
},
"api/runtime/Aarthificial.Safekeeper.Loaders.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Loaders.html",
"title": "Namespace Aarthificial.Safekeeper.Loaders | Safekeeper",
"keywords": "Namespace Aarthificial.Safekeeper.Loaders Classes DummySaveLoader A dummy save loader that does nothing. FileSaveLoader Stores saves in the persistent data path. Interfaces ISaveLoader A common interface for saving and loading data in the persistent storage."
},
"api/runtime/Aarthificial.Safekeeper.Loaders.ISaveLoader.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Loaders.ISaveLoader.html",
"title": "Interface ISaveLoader | Safekeeper",
"keywords": "Interface ISaveLoader Namespace Aarthificial.Safekeeper.Loaders Assembly Aarthificial.Safekeeper.dll A common interface for saving and loading data in the persistent storage. public interface ISaveLoader Methods Create() Create the save data for this save. Task<ISaveData> Create() Returns Task<ISaveData> The newly created save data. Remarks This method is used if the save does not exist yet. It should not save the data to the persistent storage, only create it. This data will later be passed to Save(ISaveData). Delete() Remove this save from the persistent storage. Task Delete() Returns Task Exists() Check if the save has already been created. Task<bool> Exists() Returns Task<bool> Whether the save exists. GetName() Get the name of this save. Task<string> GetName() Returns Task<string> The name of this save. Remarks Used exclusively for debugging purposes. Load() Load the data from the persistent storage. Task<ISaveData> Load() Returns Task<ISaveData> The loaded data. Save(ISaveData) Save the data to the persistent storage. Task Save(ISaveData data) Parameters data ISaveData The data to save. Returns Task"
},
"api/runtime/Aarthificial.Safekeeper.SaveControllerBase.html": {
"href": "api/runtime/Aarthificial.Safekeeper.SaveControllerBase.html",
"title": "Class SaveControllerBase | Safekeeper",
"keywords": "Class SaveControllerBase Namespace Aarthificial.Safekeeper Assembly Aarthificial.Safekeeper.dll A handle to the save data. public class SaveControllerBase Inheritance object SaveControllerBase Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors SaveControllerBase(ISaveLoader) public SaveControllerBase(ISaveLoader loader) Parameters loader ISaveLoader Fields Name public string Name Field Value string Properties Data The save data. public ISaveData Data { get; } Property Value ISaveData Remarks The data can only be accessed after the save has been loaded for the first time. Otherwise it returns an empty SaveData. Exists Whether the save exists. public bool Exists { get; } Property Value bool IsLoading Whether the save is currently being loaded. public bool IsLoading { get; } Property Value bool Methods Create() Create the save if it doesn't exist. public Task Create() Returns Task Delete() Delete the save. public Task Delete() Returns Task Initialize() Initialize this save controller. public void Initialize() Remarks This process loads the basic information about the save, such as its name and whether it exists. It does not load the data itself. Load(SaveMode) Load the game state. public Task Load(SaveMode mode = SaveMode.MemoryOnly) Parameters mode SaveMode Returns Task OnDelete() Invoked when the save is deleted. protected virtual void OnDelete() OnLoad() Invoked when the save is loaded from the memory. protected virtual void OnLoad() Remarks This method is guaranteed to be called before the ISaveStores are notified. It can be used to load global data unrelated to scenes. OnSave() Invoked when the save is being saved to the memory. protected virtual void OnSave() Remarks This method is called after ISaveStores are notified. It can be used to save global data unrelated to scenes. Save(SaveMode) Save the game state. public Task Save(SaveMode mode = SaveMode.MemoryOnly) Parameters mode SaveMode Returns Task Events Saved public event Action Saved Event Type Action Saving public event Action Saving Event Type Action"
},
"api/runtime/Aarthificial.Safekeeper.SaveData.html": {
"href": "api/runtime/Aarthificial.Safekeeper.SaveData.html",
"title": "Class SaveData | Safekeeper",
"keywords": "Class SaveData Namespace Aarthificial.Safekeeper Assembly Aarthificial.Safekeeper.dll A basic implementation of ISaveData that uses JSON serialization. public class SaveData : ISaveData Inheritance object SaveData Implements ISaveData Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods GetChunk(string) Get the chunk with the given ID or create a new one if it doesn't exist. public Dictionary<string, string> GetChunk(string chunkId = null) Parameters chunkId string The chunk ID. Returns Dictionary<string, string> The retrieved chunk. GetChunkIds() Get the IDs of all existing chunks. public IEnumerable<string> GetChunkIds() Returns IEnumerable<string> Read<T>(SaveLocation) Read the save data from the given location. public T Read<T>(SaveLocation location) where T : new() Parameters location SaveLocation The location to read from. Returns T A new instance of the data type. Type Parameters T The type of the data. Read<T>(SaveLocation, T) Read the save data from the given location into the given target. public bool Read<T>(SaveLocation location, T target) Parameters location SaveLocation The location to read from. target T The target to read into. Returns bool Whether the data was read. Type Parameters T The type of the data. Write(SaveLocation, object) Write the given value to the given location. public void Write(SaveLocation location, object value) Parameters location SaveLocation The location to write to. value object The value to write."
},
"api/runtime/Aarthificial.Safekeeper.SaveLocation.html": {
"href": "api/runtime/Aarthificial.Safekeeper.SaveLocation.html",
"title": "Struct SaveLocation | Safekeeper",
"keywords": "Struct SaveLocation Namespace Aarthificial.Safekeeper Assembly Aarthificial.Safekeeper.dll Represents a location in the save data. [Serializable] public struct SaveLocation Inherited Members ValueType.Equals(object) ValueType.GetHashCode() ValueType.ToString() object.Equals(object, object) object.GetType() object.ReferenceEquals(object, object) Constructors SaveLocation(string, string) public SaveLocation(string chunkId, string objectId) Parameters chunkId string objectId string Fields ChunkId The ID of the chunk. public string ChunkId Field Value string ObjectId The ID of the object. public string ObjectId Field Value string"
},
"api/runtime/Aarthificial.Safekeeper.SaveMode.html": {
"href": "api/runtime/Aarthificial.Safekeeper.SaveMode.html",
"title": "Enum SaveMode | Safekeeper",
"keywords": "Enum SaveMode Namespace Aarthificial.Safekeeper Assembly Aarthificial.Safekeeper.dll Controls where the data is saved/loaded from. public enum SaveMode Fields Full = 2 When loading, the data from the persistent storage is fetched to memory and then loaded onto game objects. When saving, the data from game objects is saved to memory and then committed to the persistent storage. MemoryOnly = 0 When loading, the data from memory is loaded onto game objects. When saving, the data from game objects is saved to memory. PersistentOnly = 1 When loading, the data from the persistent storage is fetched to memory. When saving, the data from memory is committed to the persistent storage."
},
"api/runtime/Aarthificial.Safekeeper.Stores.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Stores.html",
"title": "Namespace Aarthificial.Safekeeper.Stores | Safekeeper",
"keywords": "Namespace Aarthificial.Safekeeper.Stores Classes SaveStoreDispatcher A helper component that registers and unregisters all ISaveStores on the same game object. SaveStoreRegistry A static registry for ISaveStores. Interfaces ISaveStore An interface with callbacks for saving and loading."
},
"api/runtime/Aarthificial.Safekeeper.Stores.ISaveStore.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Stores.ISaveStore.html",
"title": "Interface ISaveStore | Safekeeper",
"keywords": "Interface ISaveStore Namespace Aarthificial.Safekeeper.Stores Assembly Aarthificial.Safekeeper.dll An interface with callbacks for saving and loading. public interface ISaveStore Examples Registering a store manually: public class MySaveStore : MonoBehaviour, ISaveStore { private struct StoredData { } public void OnEnable() { SaveStoreRegistry.Register(this); } public void OnDisable() { SaveStoreRegistry.Unregister(this); } public void OnLoad(SaveControllerBase save) { var data = save.Data.Read<StoredData>(); // apply data to this object; } public void OnSave(SaveControllerBase save) { var data = new StoredData(); // fill data with this object's data; save.Data.Write(data); } } Using the dispatcher component: [RequireComponent(typeof(SaveStoreDispatcher))] public class MySaveStore : MonoBehaviour, ISaveStore { private struct StoredData { } public void OnLoad(SaveControllerBase save) { var data = save.Data.Read<StoredData>(); // apply data to this object; } public void OnSave(SaveControllerBase save) { var data = new StoredData(); // fill data with this object's data; save.Data.Write(data); } } Remarks Objects implementing this interface should be registered with SaveStoreRegistry. It can be done manually or by adding the SaveStoreDispatcher component to the same game object. Methods OnLoad(SaveControllerBase) Invoked when the data is loaded from the memory. void OnLoad(SaveControllerBase save) Parameters save SaveControllerBase The current save controller. OnSave(SaveControllerBase) Invoked right before the data is saved to the memory. void OnSave(SaveControllerBase save) Parameters save SaveControllerBase The current save controller."
},
"api/runtime/Aarthificial.Safekeeper.Stores.SaveStoreDispatcher.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Stores.SaveStoreDispatcher.html",
"title": "Class SaveStoreDispatcher | Safekeeper",
"keywords": "Class SaveStoreDispatcher Namespace Aarthificial.Safekeeper.Stores Assembly Aarthificial.Safekeeper.dll A helper component that registers and unregisters all ISaveStores on the same game object. public class SaveStoreDispatcher : MonoBehaviour Inheritance object Object Component Behaviour MonoBehaviour SaveStoreDispatcher Inherited Members MonoBehaviour.IsInvoking() MonoBehaviour.CancelInvoke() MonoBehaviour.Invoke(string, float) MonoBehaviour.InvokeRepeating(string, float, float) MonoBehaviour.CancelInvoke(string) MonoBehaviour.IsInvoking(string) MonoBehaviour.StartCoroutine(string) MonoBehaviour.StartCoroutine(string, object) MonoBehaviour.StartCoroutine(IEnumerator) MonoBehaviour.StartCoroutine_Auto(IEnumerator) MonoBehaviour.StopCoroutine(IEnumerator) MonoBehaviour.StopCoroutine(Coroutine) MonoBehaviour.StopCoroutine(string) MonoBehaviour.StopAllCoroutines() MonoBehaviour.print(object) MonoBehaviour.useGUILayout MonoBehaviour.runInEditMode Behaviour.enabled Behaviour.isActiveAndEnabled Component.GetComponent(Type) Component.GetComponent<T>() Component.TryGetComponent(Type, out Component) Component.TryGetComponent<T>(out T) Component.GetComponent(string) Component.GetComponentInChildren(Type, bool) Component.GetComponentInChildren(Type) Component.GetComponentInChildren<T>(bool) Component.GetComponentInChildren<T>() Component.GetComponentsInChildren(Type, bool) Component.GetComponentsInChildren(Type) Component.GetComponentsInChildren<T>(bool) Component.GetComponentsInChildren<T>(bool, List<T>) Component.GetComponentsInChildren<T>() Component.GetComponentsInChildren<T>(List<T>) Component.GetComponentInParent(Type, bool) Component.GetComponentInParent(Type) Component.GetComponentInParent<T>(bool) Component.GetComponentInParent<T>() Component.GetComponentsInParent(Type, bool) Component.GetComponentsInParent(Type) Component.GetComponentsInParent<T>(bool) Component.GetComponentsInParent<T>(bool, List<T>) Component.GetComponentsInParent<T>() Component.GetComponents(Type) Component.GetComponents(Type, List<Component>) Component.GetComponents<T>(List<T>) Component.GetComponents<T>() Component.CompareTag(string) Component.SendMessageUpwards(string, object, SendMessageOptions) Component.SendMessageUpwards(string, object) Component.SendMessageUpwards(string) Component.SendMessageUpwards(string, SendMessageOptions) Component.SendMessage(string, object) Component.SendMessage(string) Component.SendMessage(string, object, SendMessageOptions) Component.SendMessage(string, SendMessageOptions) Component.BroadcastMessage(string, object, SendMessageOptions) Component.BroadcastMessage(string, object) Component.BroadcastMessage(string) Component.BroadcastMessage(string, SendMessageOptions) Component.transform Component.gameObject Component.tag Object.GetInstanceID() Object.GetHashCode() Object.Equals(object) Object.Instantiate(Object, Vector3, Quaternion) Object.Instantiate(Object, Vector3, Quaternion, Transform) Object.Instantiate(Object) Object.Instantiate(Object, Transform) Object.Instantiate(Object, Transform, bool) Object.Instantiate<T>(T) Object.Instantiate<T>(T, Vector3, Quaternion) Object.Instantiate<T>(T, Vector3, Quaternion, Transform) Object.Instantiate<T>(T, Transform) Object.Instantiate<T>(T, Transform, bool) Object.Destroy(Object, float) Object.Destroy(Object) Object.DestroyImmediate(Object, bool) Object.DestroyImmediate(Object) Object.FindObjectsOfType(Type) Object.FindObjectsOfType(Type, bool) Object.FindObjectsByType(Type, FindObjectsSortMode) Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode) Object.DontDestroyOnLoad(Object) Object.DestroyObject(Object, float) Object.DestroyObject(Object) Object.FindSceneObjectsOfType(Type) Object.FindObjectsOfTypeIncludingAssets(Type) Object.FindObjectsOfType<T>() Object.FindObjectsByType<T>(FindObjectsSortMode) Object.FindObjectsOfType<T>(bool) Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode) Object.FindObjectOfType<T>() Object.FindObjectOfType<T>(bool) Object.FindFirstObjectByType<T>() Object.FindAnyObjectByType<T>() Object.FindFirstObjectByType<T>(FindObjectsInactive) Object.FindAnyObjectByType<T>(FindObjectsInactive) Object.FindObjectsOfTypeAll(Type) Object.FindObjectOfType(Type) Object.FindFirstObjectByType(Type) Object.FindAnyObjectByType(Type) Object.FindObjectOfType(Type, bool) Object.FindFirstObjectByType(Type, FindObjectsInactive) Object.FindAnyObjectByType(Type, FindObjectsInactive) Object.ToString() Object.name Object.hideFlags object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object)"
},
"api/runtime/Aarthificial.Safekeeper.Stores.SaveStoreRegistry.html": {
"href": "api/runtime/Aarthificial.Safekeeper.Stores.SaveStoreRegistry.html",
"title": "Class SaveStoreRegistry | Safekeeper",
"keywords": "Class SaveStoreRegistry Namespace Aarthificial.Safekeeper.Stores Assembly Aarthificial.Safekeeper.dll A static registry for ISaveStores. public static class SaveStoreRegistry Inheritance object SaveStoreRegistry Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Methods Clear() Clear the registry. public static bool Clear() Returns bool Whether any stores were removed. Remarks Ideally, stores should remove themselves from the registry. During development, it may be useful to use this method to check if all stores are properly removed and log a warning otherwise. OnLoad(SaveControllerBase) Invoke OnLoad(SaveControllerBase) on all registered stores. public static void OnLoad(SaveControllerBase save) Parameters save SaveControllerBase The current save controller. OnSave(SaveControllerBase) Invoke OnSave(SaveControllerBase) on all registered stores. public static void OnSave(SaveControllerBase save) Parameters save SaveControllerBase Register(ISaveStore) Register a store. public static void Register(ISaveStore store) Parameters store ISaveStore The store to register. Unregister(ISaveStore) Unregister a store. public static void Unregister(ISaveStore store) Parameters store ISaveStore The store to unregister."
},
"api/runtime/index.html": {
"href": "api/runtime/index.html",
"title": "Runtime API | Safekeeper",
"keywords": "Runtime API"
},
"docs/concepts.html": {
"href": "docs/concepts.html",
"title": "Basic concepts | Safekeeper",
"keywords": "Basic concepts To understand how Safekeeper works, it's important to think about where the save data is stored. The following diagram illustrates the complete process of first loading the data and then saving it back: sequenceDiagram participant P as Persistent Storage participant M as Memory participant G as Game State P->>M: Load(SaveMode.PersistentOnly) Note over P,M: Fetching the data M->>G: Load(SaveMode.MemoryOnly) G->>M: Save(SaveMode.MemoryOnly) M->>P: Save(SaveMode.PersistentOnly) Note over P,M: Committing the data Persistent storage The persistent storage is the place where the actual save data is stored. It can be a file on the disk, a browser's local storage, a cloud, etc. Once the data is stored here, it will persist even after the game is closed. From the player's perspective, the game has been saved only if it has been committed to the persistent storage. Memory The memory is a staging area for our save data. When saving the game state we start by serializing it into the memory. The game can then continue as usual while the data is asynchronously committed to the persistent storage. Game state As the name suggests, the game state is the current state of our game as represented by game objects. Once the save data is loaded into the memory, we can deserialize it and apply the values to the objects in the scene. Saving and loading In the diagram above, loading means moving the save data from left to right. Analogically, saving means moving the date in the opposite direction. Note that we don't need to always go all the way. For example, sometimes it may be useful to save the data only in the memory. Imagine the following scenario: The player is in Scene A and knocks over a vase. They then leave Scene A and move to Scene B. We'd like to store the information about the vase so that when the player returns to Scene A it's in the same state they left it in. At the same time, our game uses a checkpoint system, where the game is saved only in key moments of the story. We don't want to save it each time the player switches scenes. In this case, saving the game only in the memory would be a good solution. When the player returns to Scene A, we can load the data from the memory and apply it to the vase. But only commit it to the persistent storage when the player reaches a checkpoint. Additionally, we can allow the player to go back to the previous checkpoint by purging the in-memory data and loading it again from the persistent storage. Save Controllers In Safekeeper, each save slot is represented by an instance of the SaveControllerBase class. It serves as a handle to the underlying data and provides methods to save, load, and clear the slot. When instantiating a new save controller, you need to provide it with an ISaveLoader. The loader is responsible for communicating with the persistent storage. Safekeeper comes with a few built-in loaders, but you can also implement your own: FileSaveLoader - Loads and saves the data to a file on the disk using Unity's persistent storage path. DummySaveLoader - Does nothing. Useful for testing. After the save controller is instantiated, you need to initialize it by calling the Initialize method. This is an asynchronous operation, so it may take a while for the controller to be ready. You can await the returned task or check its status by reading the IsLoading property. Note The controller uses a semaphore so its safe to call other methods before the initialization is complete. They will be queued and executed once the controller is ready. Save data Once the save controller has been initialized and the persistent data has been fetched for the first time, you can access the in-memory data by reading the Data property. It provides a few method for reading and writing the data, similarly to Unity's JsonUtility: class StoredData { public int health; public int mana; } var location = new SaveLocation(\"global\", \"player\"); // Reading the data as a new instance: var data = controller.Data.Read<StoredData>(location); // Reading the data into an existing instance: controller.Data.Read(location, data); // Writing the data: controller.Data.Write(location, data); Save locations In order to read and write the data, we need to specify the SaveLocation. It's a simple structure that contains two strings: chunkId and objectId. For organizational purposes, objects store in the save data are grouped into chunks. This allows us to reuse Unity's GlobalObjectId to automatically generate unique locations for our objects. If you want to automatically generate the location for a component, add ObjectLocationAttribute to a serialized SaveLocation field: public class MyComponent : MonoBehaviour { [ObjectLocation] public SaveLocation Location; } For ScriptableObjects, you can use AssetLocationAttribute: public class MyScriptableObject : ScriptableObject { [AssetLocation(\"my-assets\")] public SaveLocation Location; }"
},
"docs/example.html": {
"href": "docs/example.html",
"title": "Full example | Safekeeper",
"keywords": "Full example Below is a minimal example of a scene manager that uses safekeeper. Presumably, this MonoBehaviour is attached to a game object that persists throughout the whole game: public class SceneManager : MonoBehaviour { private SaveControllerBase _controller; private void Awake() { _controller = new SaveControllerBase( new FileSaveLoader(\"slot1\") ); _controller.Initialize(); } public IEnumerator LoadScene(string scenePath) { // Save the current state to memory yield return WaitForTask(_controller.Save()); // Switch the scene yield return SceneManager.LoadSceneAsync(scenePath); // Load the state from memory yield return WaitForTask(_controller.Load()); } public IEnumerator SaveGame() { // Save the current state to memory and commit it to the persistent storage yield return WaitForTask(_controller.Save(SaveMode.Full)); } public IEnumerator ResetGame() { // Reset memory with the data from the persistent storage yield return WaitForTask(_controller.Load(SaveMode.PersistentOnly)); // Reload the scene yield return SceneManager.LoadSceneAsync( SceneManager.GetActiveScene().path ); // Load the state from memory yield return WaitForTask(_controller.Load()); } private IEnumerator WaitForTask(Task task) { while (!task.IsCompleted) { yield return null; } if (task.IsFaulted) { ExceptionDispatchInfo.Capture(task.Exception).Throw(); } } } With this setup, you can easily save the state of your game by implementing the ISaveStore interface and registering it with the SaveStoreRegistry: public class SavedTransform : MonoBehaviour, ISaveStore { private class StoredData { public Vector3 position; public Quaternion rotation; } [ObjectLocation] [SerializeField] private SaveLocation _location; private StoredData _data = new(); public void OnEnable() { SaveStoreRegistry.Register(this); } public void OnDisable() { SaveStoreRegistry.Unregister(this); } // OnLoad will be invoked right after the scene is loaded. // Before `Start` but after `OnEnable`. public void OnLoad(SaveControllerBase save) { if (save.Data.Read(_location, _data)) { transform.position = _data.position; transform.rotation = _data.rotation; } } // OnLoad will be invoked right before the scene in unloaded or whenever // the game is saved. public void OnSave(SaveControllerBase save) { _data.position = transform.position; _data.rotation = transform.rotation; save.Data.Write(_location, data); } }"
},
"docs/installation.html": {
"href": "docs/installation.html",
"title": "Installation | Safekeeper",
"keywords": "Installation After getting access to our GitHub organization, you will be able to install Safekeeper through Unity's Package Manager. Click the \"+\" button in the top left corner and select \"Add package from git URL...\": Paste the following URL into the input field: https://github.com/aarthificial-gamedev/safekeeper.git If you encounter any problems please refer to the Unity's installation guide or reach out on our Discord server."
},
"index.html": {
"href": "index.html",
"title": "Safekeeper",
"keywords": "Safekeeper Safekeeper is a simple save system for Unity. It's an opinionated solution designed mostly for non-procedural, adventure games. An individual playthrough is stored in its own slot. Every time the game is saved the previous state is overwritten. The game can have multiple slots to store simultaneous playthroughs. Currently, the number of available slots needs to be known in advance. The player can't declare new slots. They can only select one of the existing ones and either: Start a new playthrough. Continue an existing one. Clear the slot. This limitation comes from the fact that you'd need a way to store the information about the slots themselves. Safekeeper doesn't have an out-of-the-box solution for that. You could, however, try to implement this functionality yourself. Note Safekeeper is not open source yet. Currently, it's available only to my Compute tier supporters on Patreon and YouTube. Already a supporter? Follow the instructions to get access to the latest version."
}
}