File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11# Configs
2- Scriptable Object Configs for data storage
2+ Load Scriptable Objects via code
33
44## Usage
55
6- Creating Config :
6+ Creating ScriptableObject :
77
88``` csharp
99 [CreateAssetMenu (menuName = " Game/Configs/Player" )]
10- public class PlayerConfig : Config
10+ public class PlayerConfig : ScriptableObject
1111 {
1212 [SerializeField ] private float _startHealth = 100 f ;
1313
@@ -17,7 +17,7 @@ Creating Config:
1717
1818Now you need to create an asset and put it in Resources folder
1919
20- Get Data from Config :
20+ Get Data from ScriptableObject :
2121
2222``` csharp
2323 public class Player : MonoBehaviour
@@ -26,7 +26,7 @@ Get Data from Config:
2626
2727 private void Awake ()
2828 {
29- _health = Config .Get <PlayerConfig >().StartHealth ;
29+ _health = Storage .Get <PlayerConfig >().StartHealth ;
3030 }
3131 }
3232```
You can’t perform that action at this time.
0 commit comments