https://github.com/candycoded/appsettings
⚙️ Get app specific settings from the OS.
https://github.com/candycoded/appsettings
Last synced: about 1 year ago
JSON representation
⚙️ Get app specific settings from the OS.
- Host: GitHub
- URL: https://github.com/candycoded/appsettings
- Owner: CandyCoded
- License: mit
- Created: 2021-03-29T02:47:33.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-29T06:32:41.000Z (about 5 years ago)
- Last Synced: 2025-03-17T15:08:04.503Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# App Settings
> ⚙️ Get app specific settings from the OS.
[](https://www.npmjs.com/package/xyz.candycoded.appsettings)
### Unity Package Manager
#### Git
```json
{
"dependencies": {
"xyz.candycoded.appsettings": "https://github.com/CandyCoded/appsettings.git#v1.0.0",
...
}
}
```
#### Scoped UPM Registry
```json
{
"dependencies": {
"xyz.candycoded.appsettings": "1.0.0",
...
},
"scopedRegistries": [
{
"name": "candycoded",
"url": "https://registry.npmjs.com",
"scopes": ["xyz.candycoded"]
}
]
}
```
## Usage
### Create `Settings.bundle` in iOS project
> Note: This will have to be done on each new build so safe the `.bundle` file somewhere outside the `Builds/` folder.
1. Right-click on the project in the project navigator
1. Click **New File...**
1. Search for **Resources / Settings Bundle**
1. Click **Next**
1. Rename the file if necessary
1. Click **Create**
1. Click on the newly created **Settings.bundle/Root.plist** file in the project navigator
1. Make necessary changes
### Reference the values from your app
> Note: The key used is the field **Identifier** in the **Settings.bundle/Root.plist** file.
```csharp
using CandyCoded.AppSettings;
using UnityEngine;
public class TestAppSettings : MonoBehaviour
{
private void Start()
{
Debug.Log(AppSettings.GetFloat("version"));
}
}
```