├── Odin Serializer ├── Version.txt ├── AOT │ ├── link.xml │ ├── Lasm.Bolt.UniversalSaver.OdinSerializer.dll │ ├── link.xml.meta │ └── Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta ├── JIT │ ├── Lasm.Bolt.UniversalSaver.OdinSerializer.dll │ └── Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta ├── EditorOnly │ ├── Lasm.Bolt.UniversalSaver.OdinSerializer.dll │ ├── OdinSerializer.xml.meta │ └── Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta ├── License.txt.meta ├── Version.txt.meta ├── AOT.meta ├── JIT.meta ├── EditorOnly.meta └── License.txt ├── universal_save_root ├── Editor ├── universal_save_editor_root ├── Resources │ ├── Icons │ │ ├── universal_save.png │ │ ├── universal_save@Pro.png │ │ ├── universal_save.png.meta │ │ └── universal_save@Pro.png.meta │ └── Icons.meta ├── Widgets.meta ├── universal_save_editor_root.meta ├── Descriptors.meta ├── Resources.meta ├── Odin Serializer.meta ├── IconUtilities.cs.meta ├── Widgets │ ├── GetUniversalVariableWidget.cs.meta │ ├── HasUniversalVariableWidget.cs.meta │ ├── SetUniversalVariableWidget.cs.meta │ ├── RemoveUniversalVariableWidget.cs.meta │ ├── SaveUniversalVariablesWidget.cs.meta │ ├── GetUniversalVariableWidget.cs │ ├── HasUniversalVariableWidget.cs │ ├── SetUniversalVariableWidget.cs │ ├── RemoveUniversalVariableWidget.cs │ └── SaveUniversalVariablesWidget.cs ├── Descriptors │ ├── UniversalSaveUnitDescriptor.cs.meta │ ├── CreateUniversalSaveDescriptor.cs.meta │ ├── SaveUniversalVariableDescriptor.cs.meta │ ├── CreateUniversalSaveDescriptor.cs │ ├── SaveUniversalVariableDescriptor.cs │ └── UniversalSaveUnitDescriptor.cs ├── Odin Serializer │ ├── OdinBuildAutomation.cs.meta │ └── OdinBuildAutomation.cs └── IconUtilities.cs ├── .gitattributes ├── LICENSE.meta ├── README.md.meta ├── universal_save_root.meta ├── Editor.meta ├── Runtime.meta ├── Runtime ├── Types.meta ├── Units.meta ├── UniversalSave.cs.meta ├── Types │ ├── ObjectList.cs.meta │ ├── ObjectDictionary.cs.meta │ ├── ObjectList.cs │ └── ObjectDictionary.cs ├── Units │ ├── UniversalSaveUnit.cs.meta │ ├── UniversalVariable.cs.meta │ ├── ClearUniversalSave.cs.meta │ ├── CreateUniversalSave.cs.meta │ ├── DeleteUniversalSave.cs.meta │ ├── GetUniversalVariable.cs.meta │ ├── HasUniversalVariable.cs.meta │ ├── LoadUniversalVariables.cs.meta │ ├── SaveUniversalVariables.cs.meta │ ├── SetUniversalVariable.cs.meta │ ├── UniversalSaveExists.cs.meta │ ├── RemoveUniversalVariable.cs.meta │ ├── UniversalSaveUnit.cs │ ├── UniversalVariable.cs │ ├── ClearUniversalSave.cs │ ├── GetUniversalVariable.cs │ ├── HasUniversalVariable.cs │ ├── RemoveUniversalVariable.cs │ ├── SetUniversalVariable.cs │ ├── DeleteUniversalSave.cs │ ├── CreateUniversalSave.cs │ ├── LoadUniversalVariables.cs │ ├── UniversalSaveExists.cs │ └── SaveUniversalVariables.cs └── UniversalSave.cs ├── Odin Serializer.meta ├── README.md ├── LICENSE └── .gitignore /Odin Serializer/Version.txt: -------------------------------------------------------------------------------- 1 | 1.1.1.0 -------------------------------------------------------------------------------- /universal_save_root: -------------------------------------------------------------------------------- 1 | DO NOT DELETE - USED TO FIND ROOT OF FOLDER -------------------------------------------------------------------------------- /Editor/universal_save_editor_root: -------------------------------------------------------------------------------- 1 | DO NOT DELETE - USED TO FIND ROOT OF FOLDER -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Odin Serializer/AOT/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Editor/Resources/Icons/universal_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LifeandStyleMedia/UniversalSave/HEAD/Editor/Resources/Icons/universal_save.png -------------------------------------------------------------------------------- /Editor/Resources/Icons/universal_save@Pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LifeandStyleMedia/UniversalSave/HEAD/Editor/Resources/Icons/universal_save@Pro.png -------------------------------------------------------------------------------- /Odin Serializer/AOT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LifeandStyleMedia/UniversalSave/HEAD/Odin Serializer/AOT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll -------------------------------------------------------------------------------- /Odin Serializer/JIT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LifeandStyleMedia/UniversalSave/HEAD/Odin Serializer/JIT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae18e27dc83a86c4b9a04f7ba426e719 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1816990f8f0a4124493f5b603187be95 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Odin Serializer/EditorOnly/Lasm.Bolt.UniversalSaver.OdinSerializer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LifeandStyleMedia/UniversalSave/HEAD/Odin Serializer/EditorOnly/Lasm.Bolt.UniversalSaver.OdinSerializer.dll -------------------------------------------------------------------------------- /universal_save_root.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 405b9bc01704e224fbf6855b3548a616 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c59a825583ebeb4cb7d2df660994982 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer/License.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad4b7d508a38f904796f804d0747c4c5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Odin Serializer/Version.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd15c0a34b464814a809a2a58689baec 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e326ae7eabb657b4495d02914ab9b25e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Widgets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff30cfa2a79588542bfa3f89b454c43b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/universal_save_editor_root.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40561c518aa28f348930c2ff0cfce2d3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Odin Serializer/AOT/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4781c5951c98f4180cebec21de6321 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Types.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5143e467373764845ac8848e57045f98 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Units.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c87f74b3b573414096869035596f50f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Descriptors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512355e10832c3c42ae3b796d6d3e9c3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5116e35adf6ef7e47aca14bdeb55e722 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7008d1a32cd15a428a0983d0f481784 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer/AOT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cd27269f9f5d1d45aeb6405bcc2bc02 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer/JIT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4fc0ff7a0efbd464eb0bbab6ac1b1e6e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Odin Serializer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46695a0e7598f1b4985bc8f43d7b0b4a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Resources/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d0248a9438542e46b6fe9f5c5976180 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer/EditorOnly.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf72347515b9509478ededd5bf976bbe 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Odin Serializer/EditorOnly/OdinSerializer.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e62aba90a02b1eb4cbc6a6b5cbe031ff 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Universal Save 2 | Custom Units for saving Binary, JSON, and Nodes with Odin Serializer in Unity Visual Scripting (For Bolt, goto the 'bolt' branch). 3 | 4 | ![Universal Save](https://user-images.githubusercontent.com/7036136/102176889-5cda4600-3e70-11eb-8071-9c8152d5d893.png) 5 | -------------------------------------------------------------------------------- /Editor/IconUtilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0b2cc413c1f0254ba809b0dba2cdcbd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/UniversalSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc686868901687046b6d60e4bd756048 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Types/ObjectList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a1d5d576686790479dd2839dcb82e04 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Types/ObjectDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfaad3621ebdf354e87df2b802cc3f62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/UniversalSaveUnit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0eaee64407eadd4587f9efa607f89a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/UniversalVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fb654ae58a9a5348ac039b3f7b06d8d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/ClearUniversalSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe22db58c00d3e41ac476b66dbd8087 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/CreateUniversalSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 592f218116c0e6e4284353c4516da783 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/DeleteUniversalSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dac35f95ee9ff6d4aa0dca904e24e972 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/GetUniversalVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a26566582f8e032428644c40b7bed60f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/HasUniversalVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c11263e7bdf1b7142bfc80cae92f730c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/LoadUniversalVariables.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75020e720a1e5164d9c7f7796a5129de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/SaveUniversalVariables.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c7e09a15a9f79744858c8b17d55174d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/SetUniversalVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a53151db78b36db4bb4938530c9ed8e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/UniversalSaveExists.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b6f66a9f11ea644dafca4158b623182 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Widgets/GetUniversalVariableWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfb93a8d891d50d41ae98ce30eac2adb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Widgets/HasUniversalVariableWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e06290300c330bd41a48e4cd3083b980 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Widgets/SetUniversalVariableWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab427d1d22254c64a8311c3b5db54793 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Units/RemoveUniversalVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2a08f9173a3a08458e4707915f51f03 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Descriptors/UniversalSaveUnitDescriptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2b5ab0eda103bd4982abafef0137952 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Odin Serializer/OdinBuildAutomation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10bb8a573f1ef2b43951103e9e575d62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Widgets/RemoveUniversalVariableWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 202c17d050a03d247849fcb0ff67456c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Widgets/SaveUniversalVariablesWidget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70b2103ae5e116242b38789ce7feb6ed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Descriptors/CreateUniversalSaveDescriptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc87a275f74e1be47baac01cc210c290 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Descriptors/SaveUniversalVariableDescriptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cc3c3ac56209484f9d2dc258845aa5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Types/ObjectList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.VisualScripting; 3 | using System.Collections.Generic; 4 | 5 | namespace Lasm.Bolt.UniversalSaver 6 | { 7 | /// 8 | /// An AOTDictuonary replacement that can be serialized and saved. 9 | /// 10 | [Serializable][Inspectable][IncludeInSettings(true)] 11 | public sealed class ObjectList : List { } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Runtime/Types/ObjectDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Unity.VisualScripting; 3 | using System.Collections.Generic; 4 | 5 | namespace Lasm.Bolt.UniversalSaver 6 | { 7 | /// 8 | /// An AOTDictuonary replacement that can be serialized and saved. 9 | /// 10 | [Serializable][Inspectable] 11 | [IncludeInSettings(true)] 12 | public sealed class ObjectDictionary : Dictionary { } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Runtime/Units/UniversalSaveUnit.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver 4 | { 5 | /// 6 | /// The root of all Universal Save Units. Does nothing on its own. Used for consistancy for units and the editors. 7 | /// 8 | [RenamedFrom("Lasm.BoltExtensions.IO.BinarySaveUnit")] 9 | [RenamedFrom("Lasm.BoltExtensions.BinarySaveUnit")] 10 | [RenamedFrom("Lasm.UAlive.BinarySaveUnit")] 11 | public abstract class UniversalSaveUnit : Unit 12 | { 13 | protected override void Definition() 14 | { 15 | 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Editor/Widgets/GetUniversalVariableWidget.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// The visuals and visual behaviour of a GetUniversalVariable Unit. 7 | /// 8 | [Widget(typeof(GetUniversalVariable))] 9 | public sealed class GetUniversalVariableWidget : UnitWidget 10 | { 11 | public GetUniversalVariableWidget(FlowCanvas canvas, GetUniversalVariable unit) : base(canvas, unit) 12 | { 13 | } 14 | 15 | /// 16 | /// Overrides the color of this unit to be Teal like other variable units. 17 | /// 18 | protected override NodeColorMix baseColor => NodeColorMix.TealReadable; 19 | } 20 | } -------------------------------------------------------------------------------- /Editor/Widgets/HasUniversalVariableWidget.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// The visuals and visual behaviour of a HasUniversalVariable Unit. 7 | /// 8 | [Widget(typeof(HasUniversalVariable))] 9 | public sealed class HasUniversalVariableWidget : UnitWidget 10 | { 11 | public HasUniversalVariableWidget(FlowCanvas canvas, HasUniversalVariable unit) : base(canvas, unit) 12 | { 13 | } 14 | 15 | /// 16 | /// Overrides the color of this unit to be Teal like other variable units. 17 | /// 18 | protected override NodeColorMix baseColor => NodeColorMix.TealReadable; 19 | } 20 | } -------------------------------------------------------------------------------- /Editor/Widgets/SetUniversalVariableWidget.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// The visuals and visual behaviour of a SetUniversalVariable Unit. 7 | /// 8 | [Widget(typeof(SetUniversalVariable))] 9 | public sealed class SetUniversalVariableWidget : UnitWidget 10 | { 11 | public SetUniversalVariableWidget(FlowCanvas canvas, SetUniversalVariable unit) : base(canvas, unit) 12 | { 13 | } 14 | 15 | /// 16 | /// Overrides the color of this unit to be Teal like other variable units. 17 | /// 18 | protected override NodeColorMix baseColor => NodeColorMix.TealReadable; 19 | } 20 | } -------------------------------------------------------------------------------- /Editor/Widgets/RemoveUniversalVariableWidget.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// The visuals and visual behaviour of a RemoveUniversalVariable Unit. 7 | /// 8 | [Widget(typeof(RemoveUniversalVariable))] 9 | public sealed class RemoveUniversalVariableWidget : UnitWidget 10 | { 11 | public RemoveUniversalVariableWidget(FlowCanvas canvas, RemoveUniversalVariable unit) : base(canvas, unit) 12 | { 13 | } 14 | 15 | /// 16 | /// Overrides the color of this unit to be Teal like other variable units. 17 | /// 18 | protected override NodeColorMix baseColor => NodeColorMix.TealReadable; 19 | } 20 | } -------------------------------------------------------------------------------- /Editor/Descriptors/CreateUniversalSaveDescriptor.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// A descriptor for a CreateUniversalSave Unit. 7 | /// 8 | [Descriptor(typeof(CreateUniversalSave))] 9 | public sealed class CreateUniversalSaveDescriptor : UniversalSaveUnitDescriptor 10 | { 11 | public CreateUniversalSaveDescriptor(CreateUniversalSave target) : base(target) 12 | { 13 | } 14 | 15 | protected override void DefinedPort(IUnitPort port, UnitPortDescription description) 16 | { 17 | base.DefinedPort(port, description); 18 | 19 | for (int i = 0; i < ((CreateUniversalSave)target).count; i++) 20 | { 21 | if (port.key == "name_" + i.ToString()) description.showLabel = false; 22 | if (port.key == "value_" + i.ToString()) description.label = "Value"; 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Editor/Descriptors/SaveUniversalVariableDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using Unity.VisualScripting; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Lasm.Bolt.UniversalSaver.Editor 8 | { 9 | /// 10 | /// A descriptor for a Save Universal Variable Unit. 11 | /// 12 | [Descriptor(typeof(SaveUniversalVariables))] 13 | public sealed class SaveUniversalVariablesDescriptor : UniversalSaveUnitDescriptor 14 | { 15 | public SaveUniversalVariablesDescriptor(SaveUniversalVariables target) : base(target) 16 | { 17 | } 18 | 19 | protected override void DefinedPort(IUnitPort port, UnitPortDescription description) 20 | { 21 | base.DefinedPort(port, description); 22 | 23 | for (int i = 0; i < ((SaveUniversalVariables)target).count; i++) 24 | { 25 | if (port.key == "name_" + i.ToString()) description.showLabel = false; 26 | if (port.key == "value_" + i.ToString()) description.label = "Value"; 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Editor/Descriptors/UniversalSaveUnitDescriptor.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver.Editor 4 | { 5 | /// 6 | /// A descriptor for all UniversalSaveUnits. Provides the fetching and application of the icon for these units. 7 | /// 8 | [Descriptor(typeof(UniversalSaveUnit))] 9 | public class UniversalSaveUnitDescriptor : UnitDescriptor 10 | { 11 | private EditorTexture tex; 12 | 13 | public UniversalSaveUnitDescriptor(UniversalSaveUnit target) : base(target) 14 | { 15 | } 16 | 17 | protected override EditorTexture DefinedIcon() 18 | { 19 | if (tex == null) tex = EditorTexture.Single(IconUtilities.Load("UniversalSave", "universal_save", "universal_save_editor_root")); 20 | return tex; 21 | } 22 | 23 | protected override EditorTexture DefaultIcon() 24 | { 25 | if (tex == null) tex = EditorTexture.Single(IconUtilities.Load("UniversalSave", "universal_save", "universal_save_editor_root")); 26 | return tex; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Life and Style Media, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Runtime/Units/UniversalVariable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.VisualScripting; 4 | using UnityEngine; 5 | 6 | namespace Lasm.Bolt.UniversalSaver 7 | { 8 | /// 9 | /// A single variable that is the data type for UniversalSaves to store in its internal dictionary. 10 | /// 11 | [Inspectable] 12 | [RenamedFrom("Lasm.BoltExtensions.IO.BinaryVariable")] 13 | [RenamedFrom("Lasm.BoltExtensions.BinaryVariable")] 14 | [RenamedFrom("Lasm.UAlive.BinaryVariable")] 15 | public sealed class UniversalVariable 16 | { 17 | /// 18 | /// Assign a name and value upon creating a new variable. 19 | /// 20 | public UniversalVariable(string name, object value) 21 | { 22 | this.name = name; 23 | this.value = value; 24 | } 25 | 26 | /// 27 | /// The name of the variable. 28 | /// 29 | [Inspectable] 30 | public string name; 31 | 32 | /// 33 | /// The variables value. 34 | /// 35 | [Inspectable] 36 | public object value; 37 | } 38 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /Runtime/Units/ClearUniversalSave.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver 4 | { 5 | /// 6 | /// Clears all variables of a Universal Save object. 7 | /// 8 | [RenamedFrom("Lasm.BoltExtensions.IO.ClearBinarySave")] 9 | [RenamedFrom("Lasm.BoltExtensions.ClearBinarySave")] 10 | [RenamedFrom("Lasm.UAlive.ClearBinarySave")] 11 | [UnitCategory("IO")] 12 | public sealed class ClearUniversalSave : UniversalSaveUnit 13 | { 14 | /// 15 | /// The Control Input port to enter when we want to clear the UniversalSaves variables. 16 | /// 17 | [DoNotSerialize][PortLabelHidden] 18 | public ControlInput enter; 19 | 20 | /// 21 | /// The Control Output port invoked when clearing is complete. 22 | /// 23 | [DoNotSerialize] 24 | [PortLabelHidden] 25 | public ControlOutput exit; 26 | 27 | /// 28 | /// The Value Input port of the UniversalSave. 29 | /// 30 | [DoNotSerialize] 31 | public ValueInput save; 32 | 33 | protected override void Definition() 34 | { 35 | save = ValueInput("save"); 36 | enter = ControlInput("enter", (flow) => { flow.GetValue(save).variables.Clear(); return exit; }); 37 | exit = ControlOutput("exit"); 38 | 39 | Succession(enter, exit); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Odin Serializer/JIT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e5c4dc801abf024d8093e5d9ccaf756 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 1 20 | Exclude Linux64: 0 21 | Exclude OSXUniversal: 0 22 | Exclude WebGL: 1 23 | Exclude Win: 0 24 | Exclude Win64: 0 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | DefaultValueInitialized: true 37 | OS: AnyOS 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: x86_64 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86_64 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 1 54 | settings: 55 | CPU: x86 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 1 60 | settings: 61 | CPU: x86_64 62 | - first: 63 | Windows Store Apps: WindowsStoreApps 64 | second: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | userData: 69 | assetBundleName: 70 | assetBundleVariant: 71 | -------------------------------------------------------------------------------- /Odin Serializer/EditorOnly/Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e2c96f8e3081b6408c5bc2b4c2d91d0 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 0 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 1 22 | Exclude WebGL: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | DefaultValueInitialized: true 37 | OS: AnyOS 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: None 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | - first: 63 | Windows Store Apps: WindowsStoreApps 64 | second: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | userData: 69 | assetBundleName: 70 | assetBundleVariant: 71 | -------------------------------------------------------------------------------- /Odin Serializer/AOT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be1b295ae7ef3f54694850379fe8aa57 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 1 20 | Exclude Linux64: 1 21 | Exclude OSXUniversal: 1 22 | Exclude WebGL: 0 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | - first: 26 | Any: 27 | second: 28 | enabled: 0 29 | settings: {} 30 | - first: 31 | Editor: Editor 32 | second: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | DefaultValueInitialized: true 37 | OS: AnyOS 38 | - first: 39 | Standalone: Linux64 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: None 44 | - first: 45 | Standalone: OSXUniversal 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: None 50 | - first: 51 | Standalone: Win 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: None 56 | - first: 57 | Standalone: Win64 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | - first: 63 | WebGL: WebGL 64 | second: 65 | enabled: 1 66 | settings: {} 67 | - first: 68 | Windows Store Apps: WindowsStoreApps 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: AnyCPU 73 | userData: 74 | assetBundleName: 75 | assetBundleVariant: 76 | -------------------------------------------------------------------------------- /Runtime/Units/GetUniversalVariable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Unity.VisualScripting; 5 | 6 | namespace Lasm.Bolt.UniversalSaver 7 | { 8 | /// 9 | /// A Unit that sets a variable value of a UniversalSave instance. 10 | /// 11 | [UnitCategory("IO")] 12 | [RenamedFrom("Lasm.BoltExtensions.IO.GetBinaryVariable")] 13 | [RenamedFrom("Lasm.BoltExtensions.GetBinaryVariable")] 14 | [RenamedFrom("Lasm.UAlive.GetBinaryVariable")] 15 | public sealed class GetUniversalVariable : UniversalSaveUnit 16 | { 17 | /// 18 | /// The Value Input port for the instance of the Universal Save we are getting the variable of. 19 | /// 20 | [DoNotSerialize] 21 | [PortLabel("Save")] 22 | public ValueInput binary; 23 | 24 | /// 25 | /// The name of the variable. 26 | /// 27 | [DoNotSerialize][PortLabelHidden] 28 | public ValueInput variableName; 29 | 30 | /// 31 | /// The returned value of this variable. 32 | /// 33 | [DoNotSerialize][PortLabelHidden] 34 | public ValueOutput value; 35 | 36 | protected override void Definition() 37 | { 38 | binary = ValueInput(nameof(binary)); 39 | variableName = ValueInput(nameof(variableName), string.Empty); 40 | value = ValueOutput(nameof(value), GetVariable); 41 | 42 | Requirement(binary, value); 43 | Requirement(variableName, value); 44 | } 45 | 46 | private object GetVariable(Flow flow) 47 | { 48 | return flow.GetValue(binary).Get(flow.GetValue(variableName)); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Runtime/Units/HasUniversalVariable.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using Unity.VisualScripting; 4 | using UnityEngine; 5 | 6 | namespace Lasm.Bolt.UniversalSaver 7 | { 8 | /// 9 | /// A Unit to check if a Universal Save has a paticular variable. 10 | /// 11 | [UnitCategory("IO")] 12 | [RenamedFrom("Lasm.BoltExtensions.IO.HasBinaryVariable")] 13 | [RenamedFrom("Lasm.BoltExtensions.HasBinaryVariable")] 14 | [RenamedFrom("Lasm.UAlive.HasBinaryVariable")] 15 | public sealed class HasUniversalVariable : UniversalSaveUnit 16 | { 17 | /// 18 | /// The Value Input port for the instance of the Universal Save we are checking the variable exists in. 19 | /// 20 | [DoNotSerialize] 21 | [PortLabel("Save")] 22 | public ValueInput binary; 23 | 24 | /// 25 | /// The name of the variable. 26 | /// 27 | [DoNotSerialize] 28 | [PortLabelHidden] 29 | public ValueInput variableName; 30 | 31 | /// 32 | /// Returns true if the variable exists in the Universal Save. 33 | /// 34 | [DoNotSerialize] 35 | [PortLabelHidden] 36 | public ValueOutput result; 37 | 38 | protected override void Definition() 39 | { 40 | binary = ValueInput(nameof(binary)); 41 | variableName = ValueInput(nameof(variableName), string.Empty); 42 | result = ValueOutput(nameof(result), HasVariable); 43 | 44 | Requirement(binary, result); 45 | Requirement(variableName, result); 46 | } 47 | 48 | private bool HasVariable(Flow flow) 49 | { 50 | return flow.GetValue(binary).Has(flow.GetValue(variableName)); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Editor/Widgets/SaveUniversalVariablesWidget.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | using UnityEngine; 3 | 4 | namespace Lasm.Bolt.UniversalSaver.Editor 5 | { 6 | [Widget(typeof(SaveUniversalVariables))] 7 | public sealed class SaveUniversalVariablesWidget : UnitWidget 8 | { 9 | public SaveUniversalVariablesWidget(FlowCanvas canvas, SaveUniversalVariables unit) : base(canvas, unit) 10 | { 11 | } 12 | 13 | protected override bool showHeaderAddon => true; 14 | protected override void DrawHeaderAddon() 15 | { 16 | if (!unit.promoteToInputPort) 17 | { 18 | var formatRect = position; 19 | formatRect.x += 42; 20 | formatRect.y += 22; 21 | formatRect.width = 60; 22 | formatRect.height = 20; 23 | 24 | var countLabelRect = position; 25 | countLabelRect.x += 42; 26 | countLabelRect.y += 42; 27 | countLabelRect.width = 40; 28 | countLabelRect.height = 20; 29 | 30 | var countRect = position; 31 | countRect.x += 84; 32 | countRect.y += 42; 33 | countRect.width = 40; 34 | countRect.height = 20; 35 | 36 | LudiqGUI.Inspector(metadata["format"], formatRect, GUIContent.none); 37 | GUI.Label(countLabelRect, "Count"); 38 | 39 | Inspector.BeginBlock(metadata, position); 40 | LudiqGUI.Inspector(metadata["count"], countRect, GUIContent.none); 41 | if (Inspector.EndBlock(metadata)) 42 | { 43 | unit.Define(); 44 | } 45 | } 46 | } 47 | 48 | protected override float GetHeaderAddonHeight(float width) 49 | { 50 | return unit.promoteToInputPort ? 0 : 38; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Runtime/Units/RemoveUniversalVariable.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver 4 | { 5 | /// 6 | /// A Unit that removes a variable from a UniversalSave. 7 | /// 8 | [UnitCategory("IO")] 9 | [RenamedFrom("Lasm.BoltExtensions.IO.RemoveBinaryVariable")] 10 | [RenamedFrom("Lasm.BoltExtensions.RemoveBinaryVariable")] 11 | [RenamedFrom("Lasm.UAlive.RemoveBinaryVariable")] 12 | public sealed class RemoveUniversalVariable : UniversalSaveUnit 13 | { 14 | /// 15 | /// The Control Input port we enter when we want to remove a variable. 16 | /// 17 | [DoNotSerialize][PortLabelHidden] 18 | public ControlInput enter; 19 | 20 | /// 21 | /// The Control Output port invoked when removing the variable is complete. 22 | /// 23 | [DoNotSerialize][PortLabelHidden] 24 | public ControlOutput exit; 25 | 26 | /// 27 | /// The Value Input port for the instance of the Universal Save we are removing the variable from. 28 | /// 29 | [DoNotSerialize] 30 | [PortLabel("Save")] 31 | public ValueInput binary; 32 | 33 | /// 34 | /// The name of the variable. 35 | /// 36 | [DoNotSerialize] 37 | [PortLabelHidden] 38 | public ValueInput variableName; 39 | 40 | protected override void Definition() 41 | { 42 | enter = ControlInput("enter", RemoveVariable); 43 | binary = ValueInput(nameof(binary)); 44 | variableName = ValueInput(nameof(variableName), string.Empty); 45 | exit = ControlOutput("exit"); 46 | 47 | Succession(enter, exit); 48 | Requirement(binary, enter); 49 | Requirement(variableName, enter); 50 | } 51 | 52 | private ControlOutput RemoveVariable(Flow flow) 53 | { 54 | flow.GetValue(binary).Remove(flow.GetValue(variableName)); 55 | return exit; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Editor/IconUtilities.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections.Generic; 4 | 5 | namespace Lasm.Bolt.UniversalSaver.Editor 6 | { 7 | public static class IconUtilities 8 | { 9 | private static Dictionary> collections = new Dictionary>(); 10 | 11 | public static Texture2D Load(string collection, string name, string rootFileName) 12 | { 13 | if (!collections.ContainsKey(collection)) 14 | { 15 | collections.Add(collection, new Dictionary()); 16 | } 17 | 18 | if (collections[collection].ContainsKey(name)) 19 | { 20 | return GetStateTexture(collection, name); 21 | } 22 | 23 | var path = PathOf(rootFileName) + "Resources/Icons/"; 24 | var multiTex = new MultiTexture(); 25 | 26 | multiTex.personal = AssetDatabase.LoadAssetAtPath(path + name + ".png"); 27 | multiTex.pro = AssetDatabase.LoadAssetAtPath(path + name + "@Pro.png"); 28 | 29 | collections[collection].Add(name, multiTex); 30 | 31 | return GetStateTexture(collection, name); 32 | } 33 | 34 | private static Texture2D GetStateTexture(string collection, string name) 35 | { 36 | if (EditorGUIUtility.isProSkin) 37 | { 38 | if (collections[collection][name].pro == null) 39 | { 40 | return collections[collection][name].personal; 41 | } 42 | 43 | return collections[collection][name].pro; 44 | } 45 | 46 | return collections[collection][name].personal; 47 | } 48 | 49 | private static string PathOf(string fileName) 50 | { 51 | var files = UnityEditor.AssetDatabase.FindAssets(fileName); 52 | if (files.Length == 0) return string.Empty; 53 | var assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(files[0]).Replace(fileName, string.Empty); 54 | return assetPath; 55 | } 56 | 57 | public class MultiTexture 58 | { 59 | public Texture2D personal; 60 | public Texture2D pro; 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Runtime/Units/SetUniversalVariable.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | 3 | namespace Lasm.Bolt.UniversalSaver 4 | { 5 | /// 6 | /// A Unit that sets a variable value of a UniversalSave instance. 7 | /// 8 | [UnitCategory("IO")] 9 | [RenamedFrom("Lasm.BoltExtensions.IO.SetBinaryVariable")] 10 | [RenamedFrom("Lasm.BoltExtensions.SetBinaryVariable")] 11 | [RenamedFrom("Lasm.UAlive.SetBinaryVariable")] 12 | public sealed class SetUniversalVariable : UniversalSaveUnit 13 | { 14 | /// 15 | /// The Control Input port we enter when we want to set a variable. 16 | /// 17 | [DoNotSerialize][PortLabelHidden] 18 | public ControlInput enter; 19 | 20 | /// 21 | /// The Control Output port invoked when setting the variable is complete. 22 | /// 23 | [DoNotSerialize][PortLabelHidden] 24 | public ControlOutput exit; 25 | 26 | /// 27 | /// The Value Input port for the instance of the Universal Save we are setting the variable on. 28 | /// 29 | [DoNotSerialize] 30 | [PortLabel("Save")] 31 | public ValueInput binary; 32 | 33 | /// 34 | /// The name of this variable. 35 | /// 36 | [DoNotSerialize] 37 | [PortLabelHidden] 38 | public ValueInput variableName; 39 | 40 | /// 41 | /// The value for this variable. 42 | /// 43 | [DoNotSerialize] 44 | [PortLabelHidden] 45 | public ValueInput value; 46 | 47 | protected override void Definition() 48 | { 49 | enter = ControlInput("enter", SetVariable); 50 | binary = ValueInput(nameof(binary)); 51 | variableName = ValueInput(nameof(variableName), string.Empty); 52 | value = ValueInput(nameof(value)); 53 | exit = ControlOutput("exit"); 54 | 55 | Requirement(binary, enter); 56 | Requirement(value, enter); 57 | Requirement(variableName, enter); 58 | 59 | Succession(enter, exit); 60 | } 61 | 62 | private ControlOutput SetVariable(Flow flow) 63 | { 64 | flow.GetValue(binary).Set(flow.GetValue(variableName), flow.GetValue(value)); 65 | return exit; 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Runtime/Units/DeleteUniversalSave.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Unity.VisualScripting; 3 | 4 | namespace Lasm.Bolt.UniversalSaver 5 | { 6 | /// 7 | /// Deletes a Universal Save file from a path. 8 | /// 9 | [UnitCategory("IO")] 10 | [UnitTitle("Delete Save")] 11 | [RenamedFrom("Lasm.BoltExtensions.IO.DeleteBinarySave")] 12 | [RenamedFrom("Lasm.BoltExtensions.DeleteBinarySave")] 13 | [RenamedFrom("Lasm.UAlive.IO.DeleteBinarySave")] 14 | public class DeleteUniversalSave : UniversalSaveUnit 15 | { 16 | /// 17 | /// Uses the OS application path (Persistant Data Path) if true. 18 | /// 19 | [Serialize] 20 | [Inspectable] 21 | [InspectorToggleLeft] 22 | public bool usePersistantDataPath = true; 23 | 24 | [Serialize] 25 | private bool isInit; 26 | 27 | /// 28 | /// The Value Input port for a custom path. Shown only when usePersistantDataPath is false. 29 | /// 30 | [DoNotSerialize] 31 | public ValueInput path; 32 | 33 | /// 34 | /// The filename and file extension of this save. 35 | /// 36 | [DoNotSerialize] 37 | public ValueInput fileName; 38 | 39 | /// 40 | /// The Control Input port to enter when you want to delete the save. 41 | /// 42 | [DoNotSerialize] 43 | public ControlInput delete; 44 | 45 | /// 46 | /// The Control Output port invoked when deleting is complete. 47 | /// 48 | [DoNotSerialize] 49 | public ControlOutput complete; 50 | 51 | public override void AfterAdd() 52 | { 53 | base.AfterAdd(); 54 | 55 | if (!isInit) 56 | { 57 | usePersistantDataPath = true; 58 | Define(); 59 | isInit = true; 60 | } 61 | } 62 | 63 | protected override void Definition() 64 | { 65 | if (!usePersistantDataPath) path = ValueInput("path", string.Empty); 66 | fileName = ValueInput(nameof(fileName), string.Empty); 67 | 68 | complete = ControlOutput("complete"); 69 | delete = ControlInput("delete", (flow) => { 70 | UniversalSave.Delete((usePersistantDataPath) ? Application.persistentDataPath + "/" + flow.GetValue(fileName) : flow.GetValue(path) + "/" + flow.GetValue(fileName)); 71 | return complete; 72 | }); 73 | 74 | Requirement(fileName, delete); 75 | Succession(delete, complete); 76 | } 77 | 78 | } 79 | } -------------------------------------------------------------------------------- /Runtime/Units/CreateUniversalSave.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Unity.VisualScripting; 3 | using UnityEngine; 4 | using Lasm.Bolt.UniversalSaver.OdinSerializer; 5 | 6 | namespace Lasm.Bolt.UniversalSaver 7 | { 8 | /// 9 | /// A Unit for creating a new Universal Save. 10 | /// 11 | [UnitCategory("IO")] 12 | [RenamedFrom("Lasm.BoltExtensions.IO.CreateBinarySave")] 13 | [RenamedFrom("Lasm.BoltExtensions.CreateBinarySave")] 14 | [RenamedFrom("Lasm.UAlive.CreateBinarySave")] 15 | public sealed class CreateUniversalSave : UniversalSaveUnit 16 | { 17 | [Inspectable] 18 | [UnitHeaderInspectable] 19 | [Serialize] 20 | public DataFormat format = DataFormat.Binary; 21 | 22 | [Serialize] 23 | private int _count; 24 | 25 | /// 26 | /// The amount of variables to initialize with. 27 | /// 28 | [Inspectable] 29 | [UnitHeaderInspectable("Count")] 30 | public int count { get { return _count; } set { _count = Mathf.Clamp(value, 0, 100); } } 31 | 32 | /// 33 | /// The newly created UniversalSave. 34 | /// 35 | [DoNotSerialize] 36 | [PortLabel("Save")] 37 | public ValueOutput binarySave; 38 | 39 | /// 40 | /// Value Input ports for the names of the initialized variables. 41 | /// 42 | [DoNotSerialize] 43 | public List names = new List(); 44 | 45 | /// 46 | /// Value Input ports for the values of the initialized variables. 47 | /// 48 | [DoNotSerialize] 49 | public List values = new List(); 50 | 51 | protected override void Definition() 52 | { 53 | values.Clear(); 54 | 55 | DefineVariablePorts(); 56 | 57 | binarySave = ValueOutput("_binary", GetUniversalOutput); 58 | } 59 | 60 | private void DefineVariablePorts() 61 | { 62 | for (int i = 0; i < count; i++) 63 | { 64 | var namePort = ValueInput("name_" + i.ToString(), string.Empty); 65 | var valuePort = ValueInput("value_" + i.ToString()); 66 | names.Add(namePort); 67 | values.Add(valuePort); 68 | } 69 | } 70 | 71 | private UniversalSave GetUniversalOutput(Flow flow) 72 | { 73 | var binary = new UniversalSave(); 74 | binary.dataFormat = format; 75 | 76 | for (int i = 0; i < count; i++) 77 | { 78 | binary.variables.Add(flow.GetValue(names[i]), flow.GetValue(values[i])); 79 | } 80 | 81 | return binary; 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /Editor/Resources/Icons/universal_save.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3877c3115240d7e449ba1ec3ee60e2a2 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: -1 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: -1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 1 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 0 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 32 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 0 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | - serializedVersion: 3 77 | buildTarget: Standalone 78 | maxTextureSize: 32 79 | resizeAlgorithm: 0 80 | textureFormat: -1 81 | textureCompression: 0 82 | compressionQuality: 50 83 | crunchedCompression: 0 84 | allowsAlphaSplitting: 0 85 | overridden: 0 86 | androidETC2FallbackOverride: 0 87 | forceMaximumCompressionQuality_BC6H_BC7: 0 88 | spriteSheet: 89 | serializedVersion: 2 90 | sprites: [] 91 | outline: [] 92 | physicsShape: [] 93 | bones: [] 94 | spriteID: 5e97eb03825dee720800000000000000 95 | internalID: 0 96 | vertices: [] 97 | indices: 98 | edges: [] 99 | weights: [] 100 | secondaryTextures: [] 101 | spritePackingTag: 102 | pSDRemoveMatte: 0 103 | pSDShowRemoveMatteOption: 0 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Editor/Resources/Icons/universal_save@Pro.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac2677aee6009074781e3d648f3ac931 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: -1 37 | mipBias: -100 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: -1 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 1 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 0 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 32 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 0 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | - serializedVersion: 3 77 | buildTarget: Standalone 78 | maxTextureSize: 32 79 | resizeAlgorithm: 0 80 | textureFormat: -1 81 | textureCompression: 0 82 | compressionQuality: 50 83 | crunchedCompression: 0 84 | allowsAlphaSplitting: 0 85 | overridden: 0 86 | androidETC2FallbackOverride: 0 87 | forceMaximumCompressionQuality_BC6H_BC7: 0 88 | spriteSheet: 89 | serializedVersion: 2 90 | sprites: [] 91 | outline: [] 92 | physicsShape: [] 93 | bones: [] 94 | spriteID: 5e97eb03825dee720800000000000000 95 | internalID: 0 96 | vertices: [] 97 | indices: 98 | edges: [] 99 | weights: [] 100 | secondaryTextures: [] 101 | spritePackingTag: 102 | pSDRemoveMatte: 0 103 | pSDShowRemoveMatteOption: 0 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Runtime/Units/LoadUniversalVariables.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Unity.VisualScripting; 5 | using Lasm.Bolt.UniversalSaver.OdinSerializer; 6 | 7 | namespace Lasm.Bolt.UniversalSaver 8 | { 9 | /// 10 | /// Loads a Universal Save and returns the variables and values of it. 11 | /// 12 | [UnitCategory("IO")] 13 | [UnitTitle("Load Universal Variables")] 14 | [RenamedFrom("Lasm.BoltExtensions.IO.LoadBinaryVariables")] 15 | [RenamedFrom("Lasm.BoltExtensions.LoadBinaryVariables")] 16 | [RenamedFrom("Lasm.UAlive.LoadBinaryVariables")] 17 | public sealed class LoadUniversalVariables : UniversalSaveUnit 18 | { 19 | [Inspectable] 20 | [UnitHeaderInspectable] 21 | [Serialize] 22 | public DataFormat format = DataFormat.Binary; 23 | 24 | /// 25 | /// Uses the OS application path (Persistant Data Path) if true. 26 | /// 27 | [Serialize] 28 | [Inspectable] 29 | [InspectorToggleLeft] 30 | public bool usePersistantDataPath = true; 31 | 32 | [Serialize] 33 | private bool isInit; 34 | 35 | /// 36 | /// The Value Input port for a custom path. Shown only when usePersistantDataPath is false. 37 | /// 38 | [DoNotSerialize] 39 | public ValueInput path; 40 | 41 | /// 42 | /// The filename and file extension of this save. 43 | /// 44 | [DoNotSerialize] 45 | public ValueInput fileName; 46 | 47 | /// 48 | /// The Value Output port of the 49 | /// 50 | [DoNotSerialize] 51 | [PortLabel("Save")] 52 | public ValueOutput binary; 53 | 54 | /// 55 | /// 56 | /// 57 | [DoNotSerialize] 58 | public ControlInput load; 59 | 60 | /// 61 | /// 62 | /// 63 | [DoNotSerialize] 64 | public ControlOutput complete; 65 | 66 | public override void AfterAdd() 67 | { 68 | base.AfterAdd(); 69 | 70 | if (!isInit) 71 | { 72 | usePersistantDataPath = true; 73 | Define(); 74 | isInit = true; 75 | } 76 | } 77 | 78 | protected override void Definition() 79 | { 80 | if (!usePersistantDataPath) path = ValueInput("path", string.Empty); 81 | fileName = ValueInput(nameof(fileName), string.Empty); 82 | binary = ValueOutput(nameof(binary)); 83 | 84 | complete = ControlOutput("complete"); 85 | load = ControlInput("load", (flow) => { 86 | flow.SetValue(binary, UniversalSave.Load((usePersistantDataPath) ? Application.persistentDataPath + "/" + flow.GetValue(fileName) : flow.GetValue(path) + "/" + flow.GetValue(fileName), format)); 87 | return complete; 88 | }); 89 | 90 | Requirement(fileName, binary); 91 | Requirement(fileName, load); 92 | Succession(load, complete); 93 | } 94 | 95 | } 96 | } -------------------------------------------------------------------------------- /Runtime/Units/UniversalSaveExists.cs: -------------------------------------------------------------------------------- 1 | using Unity.VisualScripting; 2 | using UnityEngine; 3 | using System.IO; 4 | 5 | namespace Lasm.Bolt.UniversalSaver 6 | { 7 | /// 8 | /// A Unit that checks if a Universal Save exists in the chosen path. 9 | /// 10 | [UnitCategory("IO")] 11 | [UnitTitle("Universal Exists")] 12 | [RenamedFrom("Lasm.BoltExtensions.IO.BinarySaveExists")] 13 | [RenamedFrom("Lasm.BoltExtensions.BinarySaveExists")] 14 | [RenamedFrom("Lasm.UAlive.BinarySaveExists")] 15 | public sealed class UniversalSaveExists : UniversalSaveUnit 16 | { 17 | /// 18 | /// Uses the OS application path (Persistant Data Path) if true. 19 | /// 20 | [Serialize] 21 | [Inspectable] 22 | [InspectorToggleLeft] 23 | public bool usePersistantDataPath = true; 24 | 25 | [Serialize] 26 | private bool isInit; 27 | 28 | /// 29 | /// The Value Input port for a custom path. Shown only when usePersistantDataPath is false. 30 | /// 31 | [DoNotSerialize] 32 | public ValueInput path; 33 | 34 | /// 35 | /// The filename and file extension of this save. 36 | /// 37 | [DoNotSerialize] 38 | public ValueInput fileName; 39 | 40 | /// 41 | /// The input to enter when we want to check if this save exists. 42 | /// 43 | [DoNotSerialize] 44 | public ControlInput check; 45 | 46 | /// 47 | /// The output control that is invoked when the save does exist. 48 | /// 49 | [DoNotSerialize] 50 | public ControlOutput @true; 51 | 52 | /// 53 | /// The output control that is invoked when the save does not exist. 54 | /// 55 | [DoNotSerialize] 56 | public ControlOutput @false; 57 | 58 | public override void AfterAdd() 59 | { 60 | base.AfterAdd(); 61 | 62 | if (!isInit) 63 | { 64 | usePersistantDataPath = true; 65 | Define(); 66 | isInit = true; 67 | } 68 | } 69 | 70 | protected override void Definition() 71 | { 72 | check = ControlInput("check", SaveExists); 73 | if (!usePersistantDataPath) path = ValueInput("path", string.Empty); 74 | fileName = ValueInput(nameof(fileName), string.Empty); 75 | 76 | @true = ControlOutput("true"); 77 | @false = ControlOutput("false"); 78 | 79 | if (!usePersistantDataPath) Requirement(path, check); 80 | Requirement(fileName, check); 81 | Succession(check, @true); 82 | Succession(check, @false); 83 | } 84 | 85 | /// 86 | /// The method executed upon the Check port being entered. Checks if the save exists at path and filename. 87 | /// > 88 | public ControlOutput SaveExists(Flow flow) 89 | { 90 | if (File.Exists((usePersistantDataPath) ? Application.persistentDataPath + "/" + flow.GetValue(fileName) : flow.GetValue(path) + "/" + flow.GetValue(fileName))) 91 | { 92 | return @true; 93 | } 94 | 95 | return @false; 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /Runtime/UniversalSave.cs: -------------------------------------------------------------------------------- 1 | using Lasm.Bolt.UniversalSaver.OdinSerializer; 2 | using System; 3 | using Unity.VisualScripting; 4 | using System.IO; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | namespace Lasm.Bolt.UniversalSaver 9 | { 10 | /// 11 | /// The underlying type of the Universal Save system. This is the type that will be saved and loaded with all the data you assigned. 12 | /// 13 | [Serializable] 14 | [RenamedFrom("Lasm.BoltExtensions.IO.BinarySave")] 15 | [RenamedFrom("Lasm.BoltExtensions.BinarySave")] 16 | [RenamedFrom("Lasm.UAlive.BinarySave")] 17 | [IncludeInSettings(true)][Inspectable] 18 | public sealed class UniversalSave 19 | { 20 | [Inspectable] 21 | [Serialize] 22 | public DataFormat dataFormat = DataFormat.Binary; 23 | 24 | /// 25 | /// All the save variables. 26 | /// 27 | [RenamedFrom("Lasm.BoltExtensions.IO.BinarySave.saves")] 28 | [RenamedFrom("Lasm.UAlive.BinarySave.saves")] 29 | [Inspectable][InspectorWide] 30 | [Serialize] 31 | public Dictionary variables = new Dictionary(); 32 | 33 | /// 34 | /// The amount of saved variables in this save. 35 | /// 36 | public int Count => variables.Count; 37 | 38 | /// 39 | /// Load a binary save from a given path. 40 | /// 41 | /// 42 | internal static UniversalSave Load(string path, DataFormat dataFormat) 43 | { 44 | if (File.Exists(path)) 45 | { 46 | Dictionary dictionary = null; 47 | UniversalSave universalSave = null; 48 | 49 | using (var fileStream = new FileStream(path, FileMode.Open)) 50 | { 51 | dictionary = SerializationUtility.DeserializeValue>(SerializationUtility.CreateReader(fileStream, new DeserializationContext(), dataFormat)); 52 | } 53 | 54 | if (dictionary != null) 55 | { 56 | return new UniversalSave() { variables = dictionary }; 57 | } 58 | 59 | using (var fileStream = new FileStream(path, FileMode.Open)) 60 | { 61 | universalSave = SerializationUtility.DeserializeValue(SerializationUtility.CreateReader(fileStream, new DeserializationContext(), dataFormat)); 62 | } 63 | 64 | if (universalSave != null) 65 | { 66 | return universalSave; 67 | } 68 | } 69 | 70 | return null; 71 | } 72 | 73 | /// 74 | /// Save a binary save to a file path. 75 | /// 76 | internal static void Save(string path, UniversalSave universalSave) 77 | { 78 | string filelessPath = string.Empty; 79 | 80 | if (path.Contains("/")) 81 | { 82 | filelessPath = path.Remove(path.LastIndexOf("/")); 83 | } 84 | else 85 | { 86 | filelessPath = path.Remove(path.LastIndexOf(@"\")); 87 | } 88 | 89 | if (!Directory.Exists(filelessPath)) Directory.CreateDirectory(filelessPath); 90 | 91 | using (var fileStream = new FileStream(path, FileMode.Create)) 92 | { 93 | SerializationUtility.SerializeValue>(universalSave.variables, SerializationUtility.CreateWriter(fileStream, new SerializationContext(), universalSave.dataFormat)); 94 | } 95 | } 96 | 97 | public static byte[] GetBytes(UniversalSave universalSave) 98 | { 99 | return SerializationUtility.SerializeValue(universalSave, universalSave.dataFormat); 100 | } 101 | 102 | public static UniversalSave FromBytes(byte[] bytes, DataFormat format) 103 | { 104 | return SerializationUtility.DeserializeValue(bytes, format); 105 | } 106 | 107 | /// 108 | /// Deletes a file if it exists. 109 | /// 110 | internal static void Delete(string path) 111 | { 112 | if (File.Exists(path)) File.Delete(path); 113 | } 114 | 115 | 116 | /// 117 | /// Get a variable from this Universal Save. 118 | /// 119 | internal object Get(string name) 120 | { 121 | return variables[name]; 122 | } 123 | 124 | /// 125 | /// Checks if this Universal Save has a variable. 126 | /// 127 | internal bool Has(string name) 128 | { 129 | return variables.ContainsKey(name); 130 | } 131 | 132 | /// 133 | /// Removes a variable from the Universal Save. 134 | /// 135 | internal void Remove(string name) 136 | { 137 | variables.Remove(name); 138 | } 139 | 140 | /// 141 | /// Sets a value of a Universal Save variable. 142 | /// 143 | internal void Set(string name, object value) 144 | { 145 | if (variables.ContainsKey(name)) 146 | { 147 | variables[name] = value; 148 | } 149 | else 150 | { 151 | variables.Add(name, value); 152 | } 153 | } 154 | } 155 | } 156 | 157 | -------------------------------------------------------------------------------- /Editor/Odin Serializer/OdinBuildAutomation.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | namespace Lasm.Bolt.UniversalSaver.OdinSerializer.Utilities.Editor 3 | { 4 | using Lasm.Bolt.UniversalSaver.OdinSerializer.Editor; 5 | using UnityEditor; 6 | using UnityEditor.Build; 7 | using System.IO; 8 | using System; 9 | using System.Collections.Generic; 10 | using Lasm.Bolt.UniversalSaver.OdinSerializer.Utilities; 11 | using System.Reflection; 12 | #if UNITY_2018_1_OR_NEWER 13 | using UnityEditor.Build.Reporting; 14 | using UnityEngine; 15 | #endif 16 | 17 | public static class OdinBuildAutomation 18 | { 19 | private static readonly string EditorAssemblyPath; 20 | private static readonly string JITAssemblyPath; 21 | private static readonly string AOTAssemblyPath; 22 | private static readonly string GenerateAssembliesDir; 23 | 24 | static OdinBuildAutomation() 25 | { 26 | var odinSerializerDir = new DirectoryInfo(typeof(AssemblyImportSettingsUtilities).Assembly.GetAssemblyDirectory()) 27 | .Parent.FullName.Replace('\\', '/').Replace("//", "/").TrimEnd('/'); 28 | 29 | var unityDataPath = Environment.CurrentDirectory.Replace("\\", "//").Replace("//", "/").TrimEnd('/'); 30 | 31 | if (!odinSerializerDir.StartsWith(unityDataPath)) 32 | { 33 | throw new FileNotFoundException("The referenced Odin Serializer assemblies are not inside the current Unity project - cannot use build automation script!"); 34 | } 35 | 36 | odinSerializerDir = odinSerializerDir.Substring(unityDataPath.Length).TrimStart('/'); 37 | 38 | EditorAssemblyPath = odinSerializerDir + "/EditorOnly/Lasm.Bolt.UniversalSaver.OdinSerializer.dll"; 39 | AOTAssemblyPath = odinSerializerDir + "/AOT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll"; 40 | JITAssemblyPath = odinSerializerDir + "/JIT/Lasm.Bolt.UniversalSaver.OdinSerializer.dll"; 41 | GenerateAssembliesDir = odinSerializerDir + "/Generated"; 42 | 43 | if (!File.Exists(EditorAssemblyPath)) throw new FileNotFoundException("Make sure all release configurations specified in the Visual Studio project are built.", EditorAssemblyPath); 44 | else if (!File.Exists(AOTAssemblyPath)) throw new FileNotFoundException("Make sure all release configurations specified in the Visual Studio project are built.", AOTAssemblyPath); 45 | else if (!File.Exists(JITAssemblyPath)) throw new FileNotFoundException("Make sure all release configurations specified in the Visual Studio project are built.", JITAssemblyPath); 46 | } 47 | 48 | private static string GetAssemblyDirectory(this Assembly assembly) 49 | { 50 | string filePath = new Uri(assembly.CodeBase).LocalPath; 51 | return Path.GetDirectoryName(filePath); 52 | } 53 | 54 | public static void OnPreprocessBuild() 55 | { 56 | BuildTarget platform = EditorUserBuildSettings.activeBuildTarget; 57 | 58 | try 59 | { 60 | // The EditorOnly dll should aways have the same import settings. But lets just make sure. 61 | AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, EditorAssemblyPath, OdinAssemblyImportSettings.IncludeInEditorOnly); 62 | 63 | if (AssemblyImportSettingsUtilities.IsJITSupported( 64 | platform, 65 | AssemblyImportSettingsUtilities.GetCurrentScriptingBackend(), 66 | AssemblyImportSettingsUtilities.GetCurrentApiCompatibilityLevel())) 67 | { 68 | AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, AOTAssemblyPath, OdinAssemblyImportSettings.ExcludeFromAll); 69 | AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, JITAssemblyPath, OdinAssemblyImportSettings.IncludeInBuildOnly); 70 | } 71 | else 72 | { 73 | AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, AOTAssemblyPath, OdinAssemblyImportSettings.IncludeInBuildOnly); 74 | AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, JITAssemblyPath, OdinAssemblyImportSettings.ExcludeFromAll); 75 | 76 | // Generates dll that contains all serialized generic type variants needed at runtime. 77 | List types; 78 | if (AOTSupportUtilities.ScanProjectForSerializedTypes(out types)) 79 | { 80 | types.Add(typeof(DataFormat)); 81 | AOTSupportUtilities.GenerateDLL(GenerateAssembliesDir, "Lasm.Bolt.UniversalSaver.OdinAOTSupport", types); 82 | } 83 | } 84 | } 85 | finally 86 | { 87 | AssetDatabase.SaveAssets(); 88 | AssetDatabase.Refresh(); 89 | } 90 | } 91 | 92 | public static void OnPostprocessBuild() 93 | { 94 | // Delete Generated AOT support dll after build so it doesn't pollute the project. 95 | if (Directory.Exists(GenerateAssembliesDir)) 96 | { 97 | Directory.Delete(GenerateAssembliesDir, true); 98 | File.Delete(GenerateAssembliesDir + ".meta"); 99 | AssetDatabase.Refresh(); 100 | } 101 | } 102 | } 103 | 104 | #if UNITY_2018_1_OR_NEWER 105 | public class OdinPreBuildAutomation : IPreprocessBuildWithReport 106 | #else 107 | public class OdinPreBuildAutomation : IPreprocessBuild 108 | #endif 109 | { 110 | public int callbackOrder { get { return -1000; } } 111 | 112 | #if UNITY_2018_1_OR_NEWER 113 | public void OnPreprocessBuild(BuildReport report) 114 | { 115 | OdinBuildAutomation.OnPreprocessBuild(); 116 | } 117 | #else 118 | public void OnPreprocessBuild(BuildTarget target, string path) 119 | { 120 | OdinBuildAutomation.OnPreprocessBuild(); 121 | } 122 | #endif 123 | } 124 | 125 | #if UNITY_2018_1_OR_NEWER 126 | public class OdinPostBuildAutomation : IPostprocessBuildWithReport 127 | #else 128 | public class OdinPostBuildAutomation : IPostprocessBuild 129 | #endif 130 | { 131 | public int callbackOrder { get { return -1000; } } 132 | 133 | #if UNITY_2018_1_OR_NEWER 134 | public void OnPostprocessBuild(BuildReport report) 135 | { 136 | OdinBuildAutomation.OnPostprocessBuild(); 137 | } 138 | #else 139 | public void OnPostprocessBuild(BuildTarget target, string path) 140 | { 141 | OdinBuildAutomation.OnPostprocessBuild(); 142 | 143 | } 144 | #endif 145 | } 146 | } 147 | #endif -------------------------------------------------------------------------------- /Runtime/Units/SaveUniversalVariables.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Unity.VisualScripting; 3 | using UnityEngine; 4 | using Lasm.Bolt.UniversalSaver.OdinSerializer; 5 | 6 | namespace Lasm.Bolt.UniversalSaver 7 | { 8 | /// 9 | /// A Unit that saves the Universal Variables to the path of your choosing. 10 | /// 11 | [UnitTitle("Save Universal Variables")] 12 | [UnitCategory("IO")] 13 | [RenamedFrom("Lasm.BoltExtensions.IO.SaveBinaryVariables")] 14 | [RenamedFrom("Lasm.BoltExtensions.SaveBinaryVariables")] 15 | [RenamedFrom("Lasm.UAlive.SaveBinaryVariables")] 16 | public sealed class SaveUniversalVariables : UniversalSaveUnit 17 | { 18 | [Inspectable] 19 | [Serialize] 20 | public DataFormat format = DataFormat.Binary; 21 | 22 | /// 23 | /// Uses the OS application path (Persistant Data Path) if true. 24 | /// 25 | [Serialize] 26 | [Inspectable] 27 | [InspectorToggleLeft] 28 | public bool usePersistantDataPath = true; 29 | 30 | /// 31 | /// Adds variables of a Universal Save or newly created variables on this Unit, 32 | /// to the current Universal Save, if they don't exist. If they do exist, the value will be overwritten. 33 | /// 34 | [Serialize] 35 | [Inspectable] 36 | [InspectorToggleLeft] 37 | public bool append = false; 38 | 39 | /// 40 | /// Makes the saved data come from an external source, by providing an input port for a Universal Save on the unit. 41 | /// 42 | [Serialize] 43 | [Inspectable] 44 | [InspectorToggleLeft] 45 | public bool promoteToInputPort = true; 46 | 47 | [Serialize] 48 | private int _count; 49 | 50 | /// 51 | /// The amount of variables to create when saving. 52 | /// 53 | [Inspectable] 54 | public int count { get { return _count; } set { _count = Mathf.Clamp(value, 0, 100); } } 55 | 56 | /// 57 | /// The path to the Universal Save. 58 | /// 59 | [DoNotSerialize] 60 | public ValueInput path; 61 | 62 | /// 63 | /// The filename and extension for the path of the Universal Save. 64 | /// 65 | [DoNotSerialize] 66 | public ValueInput fileName; 67 | 68 | /// 69 | /// The Universal Save input port show when promoteToInputPort is true. 70 | /// 71 | [DoNotSerialize] 72 | [PortLabel("Save")] 73 | public ValueInput binarySave; 74 | 75 | /// 76 | /// The output result of the Universal Save we just saved. 77 | /// 78 | [DoNotSerialize] 79 | public ValueOutput binarySaveOut; 80 | 81 | private UniversalSave lastSave; 82 | 83 | /// 84 | /// The name ports for the Units save variables. 85 | /// 86 | [DoNotSerialize] 87 | public List names = new List(); 88 | 89 | /// 90 | /// The value ports for the Units save variables. 91 | /// 92 | [DoNotSerialize] 93 | public List values = new List(); 94 | 95 | /// 96 | /// The Control Input port to enter when saving. 97 | /// 98 | [DoNotSerialize] 99 | public ControlInput save; 100 | 101 | /// 102 | /// The Control Output port invoked when saving is complete. 103 | /// 104 | [DoNotSerialize] 105 | public ControlOutput complete; 106 | 107 | protected override void Definition() 108 | { 109 | values.Clear(); 110 | 111 | if (promoteToInputPort) binarySave = ValueInput("binary"); 112 | 113 | if (!usePersistantDataPath) path = ValueInput("path", string.Empty); 114 | fileName = ValueInput("fileName", string.Empty); 115 | 116 | complete = ControlOutput("complete"); 117 | DefineSaveControlPort(); 118 | if (!promoteToInputPort) DefineVariablePorts(); 119 | 120 | binarySaveOut = ValueOutput("_binary", GetUniversalOutput); 121 | 122 | Requirement(fileName, save); 123 | Succession(save, complete); 124 | } 125 | 126 | private void DefineVariablePorts() 127 | { 128 | for (int i = 0; i < count; i++) 129 | { 130 | var namePort = ValueInput("name_" + i.ToString(), string.Empty); 131 | var valuePort = ValueInput("value_" + i.ToString()); 132 | names.Add(namePort); 133 | values.Add(valuePort); 134 | Requirement(namePort, save); 135 | Requirement(valuePort, save); 136 | } 137 | } 138 | 139 | private void DefineSaveControlPort() 140 | { 141 | save = ControlInput("save", SaveUniversal); 142 | } 143 | 144 | private void Save(Flow flow, UniversalSave binary) 145 | { 146 | UniversalSave.Save(GetPath(flow), binary); 147 | } 148 | 149 | private ControlOutput SaveUniversal(Flow flow) 150 | { 151 | var binary = promoteToInputPort == true ? flow.GetValue(binarySave) : new UniversalSave() { dataFormat = format }; 152 | var loadedSave = append ? UniversalSave.Load(GetPath(flow), format) : null; 153 | 154 | if (!promoteToInputPort) 155 | { 156 | for (int i = 0; i < values.Count; i++) 157 | { 158 | if (!string.IsNullOrEmpty(values[i].key)) 159 | { 160 | binary.Set(flow.GetValue(names[i]), flow.GetValue(values[i])); 161 | } 162 | } 163 | } 164 | 165 | if (loadedSave != null) 166 | { 167 | if (!promoteToInputPort) 168 | { 169 | for (int i = 0; i < binary.Count; i++) 170 | { 171 | if (!string.IsNullOrEmpty(values[i].key)) 172 | { 173 | loadedSave.Set(flow.GetValue(names[i]), flow.GetValue(values[i])); 174 | } 175 | } 176 | } 177 | else 178 | { 179 | var saveKeys = binary.variables.Keys.ToArrayPooled(); 180 | var saveValues = binary.variables.Values.ToArrayPooled(); 181 | 182 | for (int i = 0; i < binary.Count; i++) 183 | { 184 | loadedSave.Set(saveKeys[i], saveValues[i]); 185 | } 186 | 187 | } 188 | 189 | Save(flow, loadedSave); 190 | 191 | lastSave = loadedSave; 192 | } 193 | else 194 | { 195 | Save(flow, binary); 196 | lastSave = binary; 197 | } 198 | 199 | 200 | return complete; 201 | } 202 | 203 | private string GetPath(Flow flow) 204 | { 205 | return (usePersistantDataPath) ? Application.persistentDataPath + "/" + flow.GetValue(fileName) : flow.GetValue(path) + "/" + flow.GetValue(fileName); 206 | } 207 | 208 | private UniversalSave GetUniversalOutput(Flow flow) 209 | { 210 | return lastSave; 211 | } 212 | } 213 | 214 | } -------------------------------------------------------------------------------- /Odin Serializer/License.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS --------------------------------------------------------------------------------