Skip to content

CandyCoded/AppSettings

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

App Settings

⚙️ Get app specific settings from the OS.

npm

Unity Package Manager

https://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html

Git

{
  "dependencies": {
    "xyz.candycoded.appsettings": "https://github.com/CandyCoded/appsettings.git#v1.0.0",
    ...
  }
}

Scoped UPM Registry

{
  "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.

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html

  1. Right-click on the project in the project navigator
  2. Click New File...
  3. Search for Resources / Settings Bundle
  4. Click Next
  5. Rename the file if necessary
  6. Click Create
  7. Click on the newly created Settings.bundle/Root.plist file in the project navigator
  8. Make necessary changes

Reference the values from your app

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"));

    }

}

About

⚙️ Get app specific settings from the OS.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published