File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,25 @@ Load Scriptable Objects via code
44## Usage
55
66### Creating ScriptableObject:
7+ Your ``` ScriptableObject ``` must implement ``` ILoadable ``` interface.
78
89``` csharp
910 [CreateAssetMenu (menuName = " Game/Configs/Player" )]
10- public class PlayerConfig : ScriptableObject
11+ public class PlayerConfig : ScriptableObject , ILoadable
1112 {
1213 [SerializeField ] private float _startHealth = 100 f ;
1314
1415 public float StartHealth => _startHealth ;
1516 }
1617```
1718
18- Now you need to create an asset and put it in Resources folder
19+ Now you need to create an asset.
1920
2021### Get Data from ScriptableObject:
2122
2223``` csharp
24+ using ToolBox .Loader ;
25+
2326 public class Player : MonoBehaviour
2427 {
2528 private float _health = 0 f ;
You can’t perform that action at this time.
0 commit comments