├── .gitignore
├── .idea
└── .idea.UnityUseful
│ ├── .idea
│ ├── .idea.UnityUseful.iml
│ ├── contentModel.xml
│ ├── encodings.xml
│ ├── indexLayout.xml
│ ├── modules.xml
│ ├── projectSettingsUpdater.xml
│ ├── vcs.xml
│ └── workspace.xml
│ └── riderModule.iml
├── Assets
├── VavilichevGD.meta
└── VavilichevGD
│ ├── Architecture.meta
│ ├── Architecture
│ ├── Storage.meta
│ └── Storage
│ │ ├── Example.meta
│ │ ├── Example
│ │ ├── Scenes.meta
│ │ ├── Scenes
│ │ │ ├── StorageExample.unity
│ │ │ └── StorageExample.unity.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ │ ├── StorageExample.cs
│ │ │ └── StorageExample.cs.meta
│ │ ├── README.md
│ │ ├── README.md.meta
│ │ ├── Scripts.meta
│ │ ├── Scripts
│ │ ├── CloudStorage.cs
│ │ ├── CloudStorage.cs.meta
│ │ ├── FileStorage.cs
│ │ ├── FileStorage.cs.meta
│ │ ├── GameData.cs
│ │ ├── GameData.cs.meta
│ │ ├── Storage.cs
│ │ ├── Storage.cs.meta
│ │ ├── Surrogates.meta
│ │ └── Surrogates
│ │ │ ├── QuaternionSerializationSurrogate.cs
│ │ │ ├── QuaternionSerializationSurrogate.cs.meta
│ │ │ ├── Vector2SerializationSurrogate.cs
│ │ │ ├── Vector2SerializationSurrogate.cs.meta
│ │ │ ├── Vector3SerializationSurrogate.cs
│ │ │ └── Vector3SerializationSurrogate.cs.meta
│ │ ├── Storage System 3.0.unitypackage
│ │ └── Storage System 3.0.unitypackage.meta
│ ├── Attributes.meta
│ ├── Attributes
│ ├── ExponentialView.meta
│ └── ExponentialView
│ │ ├── Example.meta
│ │ ├── Example
│ │ ├── Scenes.meta
│ │ ├── Scenes
│ │ │ ├── ExponentialViewExample.unity
│ │ │ └── ExponentialViewExample.unity.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ │ ├── ExponentialViewExample.cs
│ │ │ └── ExponentialViewExample.cs.meta
│ │ ├── ExponentialView v.1.03.unitypackage
│ │ ├── ExponentialView v.1.03.unitypackage.meta
│ │ ├── ReadMe.md
│ │ ├── ReadMe.md.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ ├── Editor.meta
│ │ ├── Editor
│ │ ├── ExponentialViewDrawer.cs
│ │ └── ExponentialViewDrawer.cs.meta
│ │ ├── ExponentialViewAttribute.cs
│ │ ├── ExponentialViewAttribute.cs.meta
│ │ ├── ExponentialViewDictionaryBase.cs
│ │ ├── ExponentialViewDictionaryBase.cs.meta
│ │ ├── ExponentialViewDictionaryEn.cs
│ │ ├── ExponentialViewDictionaryEn.cs.meta
│ │ ├── ExponentialViewDictionaryRu.cs
│ │ ├── ExponentialViewDictionaryRu.cs.meta
│ │ ├── ExponentialViewExtensions.cs
│ │ ├── ExponentialViewExtensions.cs.meta
│ │ ├── ExponentialViewTranslator.cs
│ │ ├── ExponentialViewTranslator.cs.meta
│ │ ├── ExponentialViewUtility.cs
│ │ └── ExponentialViewUtility.cs.meta
│ ├── Gameplay.meta
│ ├── Gameplay
│ ├── Dialogues.meta
│ ├── Dialogues
│ │ ├── DialogueGraph.meta
│ │ ├── DialogueGraph
│ │ │ ├── Resources.meta
│ │ │ ├── Resources
│ │ │ │ ├── DialogueGraph.uss
│ │ │ │ ├── DialogueGraph.uss.meta
│ │ │ │ ├── Node.uss
│ │ │ │ └── Node.uss.meta
│ │ │ ├── Scripts.meta
│ │ │ └── Scripts
│ │ │ │ ├── DialogueInfo.cs
│ │ │ │ ├── DialogueInfo.cs.meta
│ │ │ │ ├── DialogueNodeData.cs
│ │ │ │ ├── DialogueNodeData.cs.meta
│ │ │ │ ├── Editor.meta
│ │ │ │ ├── Editor
│ │ │ │ ├── DialogueGraph.cs
│ │ │ │ ├── DialogueGraph.cs.meta
│ │ │ │ ├── DialogueGraphView.cs
│ │ │ │ ├── DialogueGraphView.cs.meta
│ │ │ │ ├── DialogueInfoEditor.cs
│ │ │ │ ├── DialogueInfoEditor.cs.meta
│ │ │ │ ├── EditorDialogueNode.cs
│ │ │ │ ├── EditorDialogueNode.cs.meta
│ │ │ │ ├── GraphSaveUtility.cs
│ │ │ │ ├── GraphSaveUtility.cs.meta
│ │ │ │ ├── NodeSearchWindow.cs
│ │ │ │ └── NodeSearchWindow.cs.meta
│ │ │ │ ├── NodeLinkData.cs
│ │ │ │ └── NodeLinkData.cs.meta
│ │ ├── DialogueGraph_1.png
│ │ ├── DialogueGraph_1.png.meta
│ │ ├── DialogueGraph_2.png
│ │ ├── DialogueGraph_2.png.meta
│ │ ├── DialogueGraph_3.png
│ │ ├── DialogueGraph_3.png.meta
│ │ ├── DialogueGraph_4.png
│ │ ├── DialogueGraph_4.png.meta
│ │ ├── DialogueSystem.unitypackage
│ │ ├── DialogueSystem.unitypackage.meta
│ │ ├── Example.meta
│ │ ├── Example
│ │ │ ├── Prefabs.meta
│ │ │ ├── Prefabs
│ │ │ │ ├── ExampleRoot.prefab
│ │ │ │ └── ExampleRoot.prefab.meta
│ │ │ ├── Resources.meta
│ │ │ ├── Resources
│ │ │ │ ├── ExampleDialogueGraph.asset
│ │ │ │ └── ExampleDialogueGraph.asset.meta
│ │ │ ├── Scenes.meta
│ │ │ ├── Scenes
│ │ │ │ ├── DialoguesExample.unity
│ │ │ │ └── DialoguesExample.unity.meta
│ │ │ ├── Scripts.meta
│ │ │ └── Scripts
│ │ │ │ ├── DialogueExample.cs
│ │ │ │ ├── DialogueExample.cs.meta
│ │ │ │ ├── UIWidgetDialogueOptionExample.cs
│ │ │ │ ├── UIWidgetDialogueOptionExample.cs.meta
│ │ │ │ ├── UIWidgetDialogueOptionsExample.cs
│ │ │ │ └── UIWidgetDialogueOptionsExample.cs.meta
│ │ ├── README.md
│ │ ├── README.md.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ │ ├── Dialogue.cs
│ │ │ ├── Dialogue.cs.meta
│ │ │ ├── DialogueNode.cs
│ │ │ ├── DialogueNode.cs.meta
│ │ │ ├── DialogueOption.cs
│ │ │ ├── DialogueOption.cs.meta
│ │ │ ├── DialogueState.cs
│ │ │ ├── DialogueState.cs.meta
│ │ │ ├── DialogueTree.cs
│ │ │ └── DialogueTree.cs.meta
│ ├── FX.meta
│ ├── FX
│ │ ├── Scripts.meta
│ │ ├── Scripts
│ │ │ ├── FXGenerator.cs
│ │ │ ├── FXGenerator.cs.meta
│ │ │ ├── FXObject.cs
│ │ │ └── FXObject.cs.meta
│ │ ├── UI.meta
│ │ └── UI
│ │ │ ├── Examples.meta
│ │ │ ├── Examples
│ │ │ ├── Prefabs.meta
│ │ │ ├── Prefabs
│ │ │ │ ├── ExampleFXUIDistance.prefab
│ │ │ │ ├── ExampleFXUIDistance.prefab.meta
│ │ │ │ ├── ExampleFXUIDistanceAndOffset.prefab
│ │ │ │ ├── ExampleFXUIDistanceAndOffset.prefab.meta
│ │ │ │ ├── ExampleFXUIOffset.prefab
│ │ │ │ └── ExampleFXUIOffset.prefab.meta
│ │ │ ├── Scenes.meta
│ │ │ ├── Scenes
│ │ │ │ ├── ExampleFXUI.unity
│ │ │ │ └── ExampleFXUI.unity.meta
│ │ │ ├── Scripts.meta
│ │ │ └── Scripts
│ │ │ │ ├── ExampleFXUIGenerator.cs
│ │ │ │ └── ExampleFXUIGenerator.cs.meta
│ │ │ ├── FXUIAnimations.gif
│ │ │ ├── FXUIAnimations.gif.meta
│ │ │ ├── README.md
│ │ │ ├── README.md.meta
│ │ │ ├── Scripts.meta
│ │ │ ├── Scripts
│ │ │ ├── FXUIAnimation.cs
│ │ │ ├── FXUIAnimation.cs.meta
│ │ │ ├── FXUIAnimationDistance.cs
│ │ │ ├── FXUIAnimationDistance.cs.meta
│ │ │ ├── FXUIAnimationDistanceAndOffset.cs
│ │ │ ├── FXUIAnimationDistanceAndOffset.cs.meta
│ │ │ ├── FXUIAnimationOffset.cs
│ │ │ ├── FXUIAnimationOffset.cs.meta
│ │ │ ├── FXUIGenerator.cs
│ │ │ ├── FXUIGenerator.cs.meta
│ │ │ ├── FXUIObject.cs
│ │ │ └── FXUIObject.cs.meta
│ │ │ ├── UnityUIFXAnimation.unitypackage
│ │ │ └── UnityUIFXAnimation.unitypackage.meta
│ ├── ItemsContainer.meta
│ └── ItemsContainer
│ │ ├── Example.meta
│ │ ├── Example
│ │ ├── Scenes.meta
│ │ ├── Scenes
│ │ │ ├── ItemsContainerExample.unity
│ │ │ └── ItemsContainerExample.unity.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ │ ├── ItemExample.cs
│ │ │ ├── ItemExample.cs.meta
│ │ │ ├── ItemsContainerExample.cs
│ │ │ ├── ItemsContainerExample.cs.meta
│ │ │ ├── ItemsService.cs
│ │ │ ├── ItemsService.cs.meta
│ │ │ ├── UIItemCell.cs
│ │ │ ├── UIItemCell.cs.meta
│ │ │ ├── UIItemsContainerExample.cs
│ │ │ ├── UIItemsContainerExample.cs.meta
│ │ │ ├── UIItemsContainerLogger.cs
│ │ │ └── UIItemsContainerLogger.cs.meta
│ │ ├── ItemsContainer v.1.02.unitypackage
│ │ ├── ItemsContainer v.1.02.unitypackage.meta
│ │ ├── ReadMe.md
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ ├── Abstract.meta
│ │ ├── Abstract
│ │ ├── IItem.cs
│ │ ├── IItem.cs.meta
│ │ ├── IItemCell.cs
│ │ ├── IItemCell.cs.meta
│ │ ├── IItemsContainer.cs
│ │ └── IItemsContainer.cs.meta
│ │ ├── Data.meta
│ │ ├── Data
│ │ ├── ItemCellData.cs
│ │ ├── ItemCellData.cs.meta
│ │ ├── ItemCellStateChangeArgs.cs
│ │ ├── ItemCellStateChangeArgs.cs.meta
│ │ ├── ItemsContainerData.cs
│ │ ├── ItemsContainerData.cs.meta
│ │ ├── ItemsContainerErrorCode.cs
│ │ └── ItemsContainerErrorCode.cs.meta
│ │ ├── Extensions.meta
│ │ ├── Extensions
│ │ ├── ItemsCellExtensions.cs
│ │ ├── ItemsCellExtensions.cs.meta
│ │ ├── ItemsContainerExtensions.cs
│ │ └── ItemsContainerExtensions.cs.meta
│ │ ├── Item.cs
│ │ ├── Item.cs.meta
│ │ ├── ItemCell.cs
│ │ ├── ItemCell.cs.meta
│ │ ├── ItemsContainer.cs
│ │ └── ItemsContainer.cs.meta
│ ├── Tools.meta
│ ├── Tools
│ ├── Coroutines.meta
│ └── Coroutines
│ │ ├── Coroutines 1.05.unitypackage
│ │ ├── Coroutines 1.05.unitypackage.meta
│ │ ├── Scripts.meta
│ │ └── Scripts
│ │ ├── Coroutines.cs
│ │ └── Coroutines.cs.meta
│ ├── Utils.meta
│ └── Utils
│ ├── Attributes.meta
│ ├── Attributes
│ ├── ObjectsOfType.meta
│ ├── ObjectsOfType
│ │ ├── GameObjectOfTypeAttribute.cs
│ │ ├── GameObjectOfTypeAttribute.cs.meta
│ │ ├── GameObjectOfTypeDrawer.cs
│ │ ├── GameObjectOfTypeDrawer.cs.meta
│ │ ├── ObjectOfTypeAttributeBase.cs
│ │ ├── ObjectOfTypeAttributeBase.cs.meta
│ │ ├── ObjectOfTypeDrawerBase.cs
│ │ ├── ObjectOfTypeDrawerBase.cs.meta
│ │ ├── ReadMe.md
│ │ ├── ScriptableObjectOfTypeAttribute.cs
│ │ ├── ScriptableObjectOfTypeAttribute.cs.meta
│ │ ├── ScriptableObjectOfTypeDrawer.cs
│ │ └── ScriptableObjectOfTypeDrawer.cs.meta
│ ├── VavilichevGD. Attributes v. 0.11.unitypackage
│ └── VavilichevGD. Attributes v. 0.11.unitypackage.meta
│ ├── Editor.meta
│ ├── Editor
│ ├── Builder.meta
│ ├── Builder
│ │ ├── Android.meta
│ │ ├── Android
│ │ │ ├── AndroidBuildConfig.cs
│ │ │ ├── AndroidBuildConfig.cs.meta
│ │ │ ├── AndroidBuildHelper.cs
│ │ │ ├── AndroidBuildHelper.cs.meta
│ │ │ ├── Config.meta
│ │ │ └── Config
│ │ │ │ ├── AndroidBuildConfig.asset
│ │ │ │ └── AndroidBuildConfig.asset.meta
│ │ ├── EditorBuilder.unitypackage
│ │ ├── EditorBuilder.unitypackage.meta
│ │ ├── README.md
│ │ ├── README.md.meta
│ │ ├── ScreenChooseSettings.png
│ │ ├── ScreenChooseSettings.png.meta
│ │ ├── ScreenPlayerSettings.png
│ │ ├── ScreenPlayerSettings.png.meta
│ │ ├── ScreenSetupSettings.png
│ │ ├── ScreenSetupSettings.png.meta
│ │ ├── ScreenSwitchPlatform.png
│ │ └── ScreenSwitchPlatform.png.meta
│ ├── EditorHelper.cs
│ └── EditorHelper.cs.meta
│ ├── Math.meta
│ ├── Math
│ ├── Math.cs
│ └── Math.cs.meta
│ ├── Observable.meta
│ ├── Observable
│ ├── ObservableVariable.cs
│ └── ObservableVariable.cs.meta
│ ├── PoolMono.cs
│ ├── PoolMono.cs.meta
│ ├── SyncedTimer.meta
│ └── SyncedTimer
│ ├── Example.meta
│ ├── Example
│ ├── Prefabs.meta
│ ├── Prefabs
│ │ ├── TimerWidget.prefab
│ │ └── TimerWidget.prefab.meta
│ ├── Scenes.meta
│ ├── Scenes
│ │ ├── TimerExample.unity
│ │ └── TimerExample.unity.meta
│ ├── Scripts.meta
│ └── Scripts
│ │ ├── WidgetTimerExample.cs
│ │ └── WidgetTimerExample.cs.meta
│ ├── ReadMe.md
│ ├── Scripts.meta
│ ├── Scripts
│ ├── SyncedTimer.cs
│ ├── SyncedTimer.cs.meta
│ ├── TimeChangingSource.cs
│ ├── TimeChangingSource.cs.meta
│ ├── TimeInvoker.cs
│ ├── TimeInvoker.cs.meta
│ ├── TimerType.cs
│ └── TimerType.cs.meta
│ ├── SyncedTimer v.1.03.unitypackage
│ └── SyncedTimer v.1.03.unitypackage.meta
├── Packages
└── manifest.json
└── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityConnectSettings.asset
├── VFXManager.asset
└── XRSettings.asset
/.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 | # Asset meta data should only be ignored when the corresponding asset is also ignored
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 |
57 | # Crashlytics generated file
58 | crashlytics-build.properties
59 |
60 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/.idea.UnityUseful.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Library/PackageCache/com.unity.collab-proxy@1.2.16
7 | Library/PackageCache/com.unity.ext.nunit@1.0.0
8 | Library/PackageCache/com.unity.ide.rider@1.1.4
9 | Library/PackageCache/com.unity.ide.vscode@1.1.4
10 | Library/PackageCache/com.unity.test-framework@1.1.13
11 | Library/PackageCache/com.unity.textmeshpro@2.0.1
12 | Library/PackageCache/com.unity.timeline@1.2.14
13 | Packages
14 | ProjectSettings
15 |
16 |
17 | .git
18 | .idea
19 | Builds
20 | Library
21 | Logs
22 | Temp
23 | obj
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/projectSettingsUpdater.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.UnityUseful/riderModule.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7a4357f3a7cacb14e8c66c0442ed0757
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a6bca34dcfea3a748acf1fe489266091
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f4a55244d0853124b962612499860952
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ea10e28d6ab4768982e670895ae6671
3 | timeCreated: 1617970268
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3c4e8d9f02194260bfed0c1f5d4188aa
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example/Scenes/StorageExample.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 64342abbc1a0d1a4a9e727190db95e11
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a30dc172e97848828c6cf90d5f088971
3 | timeCreated: 1617969760
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example/Scripts/StorageExample.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.UI;
3 | using Random = UnityEngine.Random;
4 |
5 | namespace VavilichevGD.Architecture.StorageSystem.Example {
6 | public class StorageExample : MonoBehaviour {
7 |
8 | #region CONSTANTS
9 |
10 | private const string KEY_INT = "INTEGER";
11 | private const string KEY_SPEED = "SPEED";
12 | private const string KEY_FLOAT = "FLOAT";
13 | private const string KEY_VECTOR3 = "VECTOR3";
14 | private const string KEY_VECTOR2 = "VECTOR2";
15 | private const string KEY_VERSION = "VERSION";
16 |
17 | #endregion
18 |
19 | [SerializeField] private Button _buttonSaveAsync;
20 | [SerializeField] private Button _buttonLoadInstantly;
21 | [SerializeField] private Button _buttonLoadWithRoutine;
22 | [SerializeField] private Text _textLog;
23 |
24 | [SerializeField] private string _storageFileName = "GameState.save";
25 |
26 | private bool _savingComplete;
27 | private Storage _storage;
28 |
29 |
30 | #region LIFECYCLE
31 |
32 | private void Start() {
33 | _storage = new FileStorage(_storageFileName);
34 | _storage.Load();
35 | PrintData("loaded instantly at start", false);
36 |
37 | var loadedVersion = _storage.Get(KEY_VERSION);
38 | if (loadedVersion < 2) {
39 | _storage.Set(KEY_VERSION, 2);
40 | _storage.Set(KEY_SPEED, 100);
41 | Debug.Log("New version. Speed changed to 100");
42 | }
43 | }
44 |
45 | private void OnEnable() {
46 | _buttonSaveAsync.onClick.AddListener(OnSaveAsyncButtonClick);
47 | _buttonLoadInstantly.onClick.AddListener(OnLoadInstantlyButtonClick);
48 | _buttonLoadWithRoutine.onClick.AddListener(OnLoadWithRoutineButtonClick);
49 | }
50 |
51 | private void OnDisable() {
52 | _buttonSaveAsync.onClick.RemoveListener(OnSaveAsyncButtonClick);
53 | _buttonLoadInstantly.onClick.RemoveListener(OnLoadInstantlyButtonClick);
54 | _buttonLoadWithRoutine.onClick.RemoveListener(OnLoadWithRoutineButtonClick);
55 | }
56 |
57 | #endregion
58 |
59 |
60 |
61 | private void Update() {
62 | if (_savingComplete) {
63 | PrintData("saved async", true);
64 | Log($"Saving complete at: {Time.time}", true);
65 | _savingComplete = false;
66 | }
67 | }
68 |
69 | #region CALLBACKS
70 |
71 | private void OnSaveAsyncButtonClick() {
72 | Log($"Saving started: {Time.time}", false);
73 |
74 | _storage.Set(KEY_INT, Random.Range(0, 10));
75 | _storage.Set(KEY_FLOAT, Random.Range(0f, 10f));
76 | _storage.Set(KEY_VECTOR3, Vector3.left);
77 | _storage.Set(KEY_VECTOR2, Vector2.up);
78 | _storage.Set(KEY_VERSION, 2);
79 |
80 | _storage.SaveAsync(() => {
81 | // We cannot get Time.time (for logging the end of saving process)
82 | // because Unity doesn't support to do this in the side thread. That is why we use a simple flag.
83 | _savingComplete = true;
84 | });
85 | }
86 |
87 | private void OnLoadInstantlyButtonClick() {
88 | _storage.Load();
89 | PrintData("loaded instantly", false);
90 | }
91 |
92 | private void OnLoadWithRoutineButtonClick() {
93 | _storage.LoadWithRoutine(loadedData => PrintData("loaded with routine", false));
94 | }
95 |
96 | #endregion
97 |
98 |
99 |
100 | #region LOGGING
101 |
102 | private void PrintData(string process, bool append) {
103 | var loadedInt = _storage.Get(KEY_INT);
104 | var loadedSpeed = _storage.Get(KEY_SPEED);
105 | var loadedFloat = _storage.Get(KEY_FLOAT);
106 | var loadedVector3 = _storage.Get(KEY_VECTOR3);
107 | var loadedVector2 = _storage.Get(KEY_VECTOR2);
108 | var loadedVersion = _storage.Get(KEY_VERSION);
109 |
110 |
111 | Log($"GameData {process}:\n" +
112 | $"int = {loadedInt},\n" +
113 | $"speed = {loadedSpeed},\n" +
114 | $"float = {loadedFloat},\n" +
115 | $"vector3 = {loadedVector3},\n" +
116 | $"vector2 = {loadedVector2},\n" +
117 | $"version = {loadedVersion}", append);
118 | }
119 |
120 | private void Log(string text, bool append) {
121 | var logText = append ? _textLog.text + "\n" + text : text;
122 | _textLog.text = logText;
123 | }
124 |
125 | #endregion
126 |
127 | }
128 | }
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Example/Scripts/StorageExample.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ca1d40c061554b448a20c68c9bf021c6
3 | timeCreated: 1617962520
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/README.md:
--------------------------------------------------------------------------------
1 | # Storage system for Unity
2 |
3 | • Async operation supported (with callbacks)
4 | • Coroutine operation supported (with callbacks also)
5 | • Only local (file) storage realized now
6 | • The system is flexible and support expanding with a cloud storage really easy
7 | • Mobile friendly
8 | • Multiple storage containers supported
9 |
10 |
11 | ### v.3.0
12 | Even more flexible aproach to save the game data.
13 | **WARNING: If you want to update your storage system from v.2.12 to v.3.0, you will have to make some architecture changes. You cannot just update the asset.**
14 |
15 |
16 | Whats new:
17 | - You can save different blocks of data. It works like a container. Just create Storage instance (FileStorage or Cloud Storage (not implemented yet)) and save data into it. It will be convenient to separate game settings data that usually loads at the start of the game from game progress data that usually loads after main menu scene.
18 |
19 |
20 |
21 | ### v2.12
22 | More flexible approach to save the game data with key-value pair. Looks like Player Prefs, but it isn't the same. New version supports all serializable objects and stored in one place (file or cloud, cloud doesn't supported yet).
23 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bd11e1ae79232da438f344729b2bdbd4
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aff2881274473944e8df874277462fd4
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts/CloudStorage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 |
4 | namespace VavilichevGD.Architecture.StorageSystem {
5 | public class CloudStorage : Storage{
6 | protected override void SaveInternal() {
7 | throw new NotImplementedException();
8 | }
9 |
10 | protected override void SaveAsyncInternal(Action callback = null) {
11 | throw new NotImplementedException();
12 | }
13 |
14 | protected override Coroutine SaveWithRoutineInternal(Action callback = null) {
15 | throw new NotImplementedException();
16 | }
17 |
18 | protected override void LoadInternal() {
19 | throw new NotImplementedException();
20 | }
21 |
22 | protected override void LoadAsyncInternal(Action callback = null) {
23 | throw new NotImplementedException();
24 | }
25 |
26 | protected override Coroutine LoadWithRoutineInternal(Action callback = null) {
27 | throw new NotImplementedException();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts/CloudStorage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3ebb4b9fbc14a46aafec75e86b86f11
3 | timeCreated: 1625925097
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts/FileStorage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.IO;
4 | using System.Threading;
5 | using UnityEngine;
6 | using VavilichevGD.Tools;
7 |
8 | namespace VavilichevGD.Architecture.StorageSystem {
9 | public sealed class FileStorage : Storage{
10 |
11 | public string filePath { get; }
12 |
13 | public FileStorage(string fileName) {
14 | var folder = "Saves";
15 | var folderPath = $"{Application.persistentDataPath}/{folder}";
16 | if (!Directory.Exists(folderPath))
17 | Directory.CreateDirectory(folderPath);
18 |
19 | filePath = $"{folderPath}/{fileName}";
20 | }
21 |
22 |
23 | #region SAVE
24 |
25 | protected override void SaveInternal() {
26 | var file = File.Create(filePath);
27 | formatter.Serialize(file, data);
28 | file.Close();
29 | }
30 |
31 | protected override void SaveAsyncInternal(Action callback = null) {
32 | var thread = new Thread(() => SaveDataTaskThreaded(callback));
33 | thread.Start();
34 | }
35 |
36 | private void SaveDataTaskThreaded(Action callback) {
37 | Save();
38 | callback?.Invoke();
39 | }
40 |
41 | protected override Coroutine SaveWithRoutineInternal(Action callback = null) {
42 | return Coroutines.StartRoutine(SaveRoutine(callback));
43 |
44 | }
45 |
46 | private IEnumerator SaveRoutine(Action callback) {
47 | var threadEnded = false;
48 |
49 | SaveAsync(() => {
50 | threadEnded = true;
51 | });
52 |
53 | while (!threadEnded)
54 | yield return null;
55 |
56 | callback?.Invoke();
57 | }
58 |
59 | #endregion
60 |
61 |
62 |
63 | #region LOAD
64 |
65 | protected override void LoadInternal() {
66 | if (!File.Exists(filePath)) {
67 | var gameDataByDefault = new GameData();
68 | data = gameDataByDefault;
69 | Save();
70 | }
71 |
72 | var file = File.Open(filePath, FileMode.Open);
73 | data = (GameData) formatter.Deserialize(file);
74 | file.Close();
75 | }
76 |
77 |
78 | protected override void LoadAsyncInternal(Action callback = null) {
79 | var thread = new Thread(() => LoadDataTaskThreaded(callback));
80 | thread.Start();
81 | }
82 |
83 | private void LoadDataTaskThreaded(Action callback) {
84 | Load();
85 | callback?.Invoke(data);
86 | }
87 |
88 |
89 |
90 | protected override Coroutine LoadWithRoutineInternal(Action callback = null) {
91 | return Coroutines.StartRoutine(LoadRoutine(callback));
92 |
93 | }
94 |
95 | private IEnumerator LoadRoutine(Action callback) {
96 | var threadEnded = false;
97 | var gameData = new GameData();
98 |
99 | LoadAsync((loadedData) => {
100 | threadEnded = true;
101 | });
102 |
103 | while (!threadEnded)
104 | yield return null;
105 |
106 | callback?.Invoke(gameData);
107 | }
108 |
109 | #endregion
110 |
111 |
112 | }
113 | }
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts/FileStorage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8ee606e96d7f49b1a0e50bb26eddeb71
3 | timeCreated: 1625925087
--------------------------------------------------------------------------------
/Assets/VavilichevGD/Architecture/Storage/Scripts/GameData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace VavilichevGD.Architecture.StorageSystem {
6 | [Serializable]
7 | public sealed class GameData : ISerializationCallbackReceiver {
8 |
9 |
10 | public List keys;
11 | public List