⚙️ Get app specific settings from the OS.
https://docs.unity3d.com/Packages/[email protected]/manual/index.html
{
"dependencies": {
"xyz.candycoded.appsettings": "https://github.com/CandyCoded/appsettings.git#v1.0.0",
...
}
}
{
"dependencies": {
"xyz.candycoded.appsettings": "1.0.0",
...
},
"scopedRegistries": [
{
"name": "candycoded",
"url": "https://registry.npmjs.com",
"scopes": ["xyz.candycoded"]
}
]
}
Note: This will have to be done on each new build so safe the
.bundle
file somewhere outside theBuilds/
folder.
- Right-click on the project in the project navigator
- Click New File...
- Search for Resources / Settings Bundle
- Click Next
- Rename the file if necessary
- Click Create
- Click on the newly created Settings.bundle/Root.plist file in the project navigator
- Make necessary changes
Note: The key used is the field Identifier in the Settings.bundle/Root.plist file.
using CandyCoded.AppSettings;
using UnityEngine;
public class TestAppSettings : MonoBehaviour
{
private void Start()
{
Debug.Log(AppSettings.GetFloat("version"));
}
}