We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfbeeae commit 5b1f30bCopy full SHA for 5b1f30b
1 file changed
README.md
@@ -1,2 +1,32 @@
1
# Configs
2
-Scriptable Object Configs
+Scriptable Object Configs for data storage
3
+
4
+## Usage
5
6
+Writing config:
7
8
+```csharp
9
+ [CreateAssetMenu(menuName = "Game/Configs/Player")]
10
+ public class PlayerConfig : Config
11
+ {
12
+ [SerializeField] private float _startPlayerHealth = 100f;
13
14
+ public float StartPlayerHealth => _startPlayerHealth;
15
+ }
16
+```
17
18
+Now you need to create an asset and put it in Resources folder
19
20
+Receive data:
21
22
23
+ public class Player : MonoBehaviour
24
25
+ private float _health = 0f;
26
27
+ private void Awake()
28
29
+ _health = Config.Get<PlayerConfig>().StartPlayerHealth;
30
31
32
0 commit comments