From 6122675df65456f5dd1f827d926c9e37febc177e Mon Sep 17 00:00:00 2001 From: Hertzole Date: Sun, 12 Jun 2022 23:47:01 +0200 Subject: [PATCH] Prepared for release --- .github/workflows/dev-package.yml | 2 +- .github/workflows/package.yml | 30 +++++++++++++ ...en Mode Setting.asset => Fullscreen.asset} | 2 +- ...tting.asset.meta => Fullscreen.asset.meta} | 0 ... Language Setting.asset => Language.asset} | 2 +- ...Setting.asset.meta => Language.asset.meta} | 0 ...olution Setting.asset => Resolution.asset} | 2 +- ...tting.asset.meta => Resolution.asset.meta} | 0 Assets/Settings Manager.asset | 4 +- README.md | 42 ++++++++++++++++++- 10 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/package.yml rename Assets/{New Fullscreen Mode Setting.asset => Fullscreen.asset} (95%) rename Assets/{New Fullscreen Mode Setting.asset.meta => Fullscreen.asset.meta} (100%) rename Assets/{New Language Setting.asset => Language.asset} (96%) rename Assets/{New Language Setting.asset.meta => Language.asset.meta} (100%) rename Assets/{New Resolution Setting.asset => Resolution.asset} (95%) rename Assets/{New Resolution Setting.asset.meta => Resolution.asset.meta} (100%) diff --git a/.github/workflows/dev-package.yml b/.github/workflows/dev-package.yml index 7656235..17b99ed 100644 --- a/.github/workflows/dev-package.yml +++ b/.github/workflows/dev-package.yml @@ -1,4 +1,4 @@ -name: Devlopment Package +name: Development Package on: push: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..2f9eb19 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,30 @@ +name: Release Package + +on: + release: + types: + - published + +jobs: + package: + name: Deploy release package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Create release package branch + run: | + git branch -d package &> /dev/null || echo package branch not found + git subtree split -P "$PKG_ROOT" -b package + mv "Assets/Samples" /tmp/example + git checkout package + mkdir "Samples~" + mv /tmp/example/* "Samples~/" + git add "Samples~" + git config --global user.name 'github-bot' + git config --global user.email 'github-bot@users.noreply.github.com' + git commit -am "Packaged project" + git push -f -u origin package + env: + PKG_ROOT: "Packages/se.hertzole.settings-manager" diff --git a/Assets/New Fullscreen Mode Setting.asset b/Assets/Fullscreen.asset similarity index 95% rename from Assets/New Fullscreen Mode Setting.asset rename to Assets/Fullscreen.asset index 05dac23..179a8b1 100644 --- a/Assets/New Fullscreen Mode Setting.asset +++ b/Assets/Fullscreen.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1733b69937f84c0990b3a245c3a43003, type: 3} - m_Name: New Fullscreen Mode Setting + m_Name: Fullscreen m_EditorClassIdentifier: displayName: Fullscreen Mode displayNameLocalized: diff --git a/Assets/New Fullscreen Mode Setting.asset.meta b/Assets/Fullscreen.asset.meta similarity index 100% rename from Assets/New Fullscreen Mode Setting.asset.meta rename to Assets/Fullscreen.asset.meta diff --git a/Assets/New Language Setting.asset b/Assets/Language.asset similarity index 96% rename from Assets/New Language Setting.asset rename to Assets/Language.asset index 738f4e3..15ff3ea 100644 --- a/Assets/New Language Setting.asset +++ b/Assets/Language.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: ea58189d66ecb5a4f9ef2a773ac8bfe0, type: 3} - m_Name: New Language Setting + m_Name: Language m_EditorClassIdentifier: displayName: Language displayNameLocalized: diff --git a/Assets/New Language Setting.asset.meta b/Assets/Language.asset.meta similarity index 100% rename from Assets/New Language Setting.asset.meta rename to Assets/Language.asset.meta diff --git a/Assets/New Resolution Setting.asset b/Assets/Resolution.asset similarity index 95% rename from Assets/New Resolution Setting.asset rename to Assets/Resolution.asset index bf05d7c..2e4c0e4 100644 --- a/Assets/New Resolution Setting.asset +++ b/Assets/Resolution.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 909ba99dab6f4b8dbde28f05338d1ee2, type: 3} - m_Name: New Resolution Setting + m_Name: Resolution m_EditorClassIdentifier: displayName: Resolution displayNameLocalized: diff --git a/Assets/New Resolution Setting.asset.meta b/Assets/Resolution.asset.meta similarity index 100% rename from Assets/New Resolution Setting.asset.meta rename to Assets/Resolution.asset.meta diff --git a/Assets/Settings Manager.asset b/Assets/Settings Manager.asset index db03ac0..ced6e7d 100644 --- a/Assets/Settings Manager.asset +++ b/Assets/Settings Manager.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: Settings Manager m_EditorClassIdentifier: autoSaveSettings: 1 - loadSettingsOnBoot: 0 + loadSettingsOnBoot: 1 saveLocation: 0 savePath: settings fileName: settings.json @@ -58,4 +58,4 @@ MonoBehaviour: - rid: 8729629915173617764 type: {class: JsonSettingSerializer, ns: Hertzole.SettingsManager, asm: Hertzole.SettingsManager} data: - prettyPrint: 0 + prettyPrint: 1 diff --git a/README.md b/README.md index e81f1e7..2602c62 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,50 @@ # Unity Runtime Settings ### Experimental drop-in solution for runtime settings +⚠ This is very experimental as of right now! ⚠ + [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=unity-runtime-settings&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=unity-runtime-settings) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=unity-runtime-settings&metric=coverage)](https://sonarcloud.io/summary/new_code?id=unity-runtime-settings) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=unity-runtime-settings&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=unity-runtime-settings) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=unity-runtime-settings&metric=bugs)](https://sonarcloud.io/summary/new_code?id=unity-runtime-settings) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=unity-runtime-settings&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=unity-runtime-settings) -⚠ This is very experimental as of right now! ⚠ \ No newline at end of file +## ❓ What is this? + +Unity runtime settings is supposed to be a drop-in solution for managing runtime settings for your game. Settings like +resolution, audio volumes, graphics, etc. + +![Settings Manager in project settings](https://i.imgur.com/rvus6eV.png) + +![Example setting](https://i.imgur.com/7znry27.png) + +## 🔨 Quick Start + +1. Install the package either using a git link or OpenUPM. See installation section for instructions. +2. Open up your project settings inside Unity and create a new settings manager. +3. Create a setting in your project by right clicking - Create - Hertzole - Settings - the setting of your choice +4. Create a category in your settings manager and assign the settings. +5. Build your UI. I'd recommend importing the uGUI sample to see how you can create a simple UI for your settings. + +## 📦 Installation + +### OpenUPM (Recommended) +1. Add the OpenUPM reigstry. + Click in the menu bar Edit → Project Settings... → Package Manager + Add a new scoped registry with the following parameters: + Name: `OpenUPM` + URL: `https://package.openupm.com` + Scopes: + - `com.openupm` + - `se.hertzole.unity-runtime-settings` +2. Click apply and close the project settings. +3. Open up the package manager. + Click in the menu bar Window → Package Manager +4. Select `Packages: My Registries` in the menu bar of the package manager window. +5. You should see Unity Runtime Settings under the `Hertzole` section. Click on it and then press Install in the bottom right corner. + +### Unity package manager through git +1. Open up the Unity package manager +2. Click on the plus icon in the top left and "Add package from git url" +3. Paste in `https://github.com/Hertzole/unity-runtime-settings.git#package` + You can also paste in `https://github.com/Hertzole/unity-runtime-settings.git#dev-package` if you want the latest (but unstable!) changes. \ No newline at end of file