https://github.com/unity-package/remote-config-manager-unity
Tool support use firebase remote config for game unity
https://github.com/unity-package/remote-config-manager-unity
firebase-remote-config remoteconfig unity unity-package unity-packages unity3d
Last synced: 24 days ago
JSON representation
Tool support use firebase remote config for game unity
- Host: GitHub
- URL: https://github.com/unity-package/remote-config-manager-unity
- Owner: unity-package
- License: mit
- Created: 2024-07-03T05:04:25.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-05-13T03:26:52.000Z (27 days ago)
- Last Synced: 2025-05-13T04:25:01.903Z (27 days ago)
- Topics: firebase-remote-config, remoteconfig, unity, unity-package, unity-packages, unity3d
- Language: C#
- Homepage:
- Size: 16.6 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What
- Tool support use firebase remote config for game unity
## How To Install### Add the line below to `Packages/manifest.json`
for version `1.0.2`
```json
"com.wolf-org.remote-config":"https://github.com/unity-package/remote-config-manager-unity.git#1.0.2",
```
dependency `extensions-unity-1.0.5`
```json
"com.wolf-org.extensions":"https://github.com/unity-package/extensions-unity.git#1.0.5",
```
If you use [game-data-unity](https://github.com/wolf-package/game-data-unity), add the library below and define symbol `VIRTUESKY_DATA`
```json
"com.wolf-org.game-data":"https://github.com/unity-package/game-data-unity.git#1.0.2",
```## Use
- Add `Define symbol` to use remote config (`VIRTUESKY_FIREBASE`, `VIRTUESKY_FIREBASE_REMOTECONFIG`)
- Attach `FirebaseRemoteConfigManager` to scene (don't destroy). Please add a `Remote Config Data` to the list, then enter the key, select the corresponding data type (int, bool, string), enter the default value. Finally, click `Generate Remote Data` when you have finished setup.

- After clicking `Generate Remote Data`, the `RemoteData.cs` script will be automatically generated and formatted as below.
```csharp
namespace VirtueSky.RemoteConfigs
{
public struct RemoteData
{
public const string KEY_RMC_LEVEL_TURN_ON_INTER_ADS = "RMC_LEVEL_TURN_ON_INTER_ADS";
public const int DEFAULT_RMC_LEVEL_TURN_ON_INTER_ADS = 5;
public static int RMC_LEVEL_TURN_ON_INTER_ADS => VirtueSky.DataStorage.GameData.Get(KEY_RMC_LEVEL_TURN_ON_INTER_ADS, DEFAULT_RMC_LEVEL_TURN_ON_INTER_ADS);
public const string KEY_RMC_INTER_CAPPING_LEVEL = "RMC_INTER_CAPPING_LEVEL";
public const int DEFAULT_RMC_INTER_CAPPING_LEVEL = 2;
public static int RMC_INTER_CAPPING_LEVEL => VirtueSky.DataStorage.GameData.Get(KEY_RMC_INTER_CAPPING_LEVEL, DEFAULT_RMC_INTER_CAPPING_LEVEL);
public const string KEY_RMC_INTER_CAPPING_TIME = "RMC_INTER_CAPPING_TIME";
public const int DEFAULT_RMC_INTER_CAPPING_TIME = 8;
public static int RMC_INTER_CAPPING_TIME => VirtueSky.DataStorage.GameData.Get(KEY_RMC_INTER_CAPPING_TIME, DEFAULT_RMC_INTER_CAPPING_TIME);
public const string KEY_RMC_ON_OFF_INTER = "RMC_ON_OFF_INTER";
public const bool DEFAULT_RMC_ON_OFF_INTER = true;
public static bool RMC_ON_OFF_INTER => VirtueSky.DataStorage.GameData.Get(KEY_RMC_ON_OFF_INTER, DEFAULT_RMC_ON_OFF_INTER);
public const string KEY_RMC_ON_OFF_BANNER = "RMC_ON_OFF_BANNER";
public const bool DEFAULT_RMC_ON_OFF_BANNER = true;
public static bool RMC_ON_OFF_BANNER => VirtueSky.DataStorage.GameData.Get(KEY_RMC_ON_OFF_BANNER, DEFAULT_RMC_ON_OFF_BANNER);
public const string KEY_RMC_LEVEL_SHOW_RATE_AND_REVIEW = "RMC_LEVEL_SHOW_RATE_AND_REVIEW";
public const int DEFAULT_RMC_LEVEL_SHOW_RATE_AND_REVIEW = 3;
public static int RMC_LEVEL_SHOW_RATE_AND_REVIEW => VirtueSky.DataStorage.GameData.Get(KEY_RMC_LEVEL_SHOW_RATE_AND_REVIEW, DEFAULT_RMC_LEVEL_SHOW_RATE_AND_REVIEW);
public const string KEY_RMC_ON_OFF_RATE_AND_REVIEW = "RMC_ON_OFF_RATE_AND_REVIEW";
public const bool DEFAULT_RMC_ON_OFF_RATE_AND_REVIEW = true;
public static bool RMC_ON_OFF_RATE_AND_REVIEW => VirtueSky.DataStorage.GameData.Get(KEY_RMC_ON_OFF_RATE_AND_REVIEW, DEFAULT_RMC_ON_OFF_RATE_AND_REVIEW);
public const string KEY_RMC_VERSION_UPDATE = "RMC_VERSION_UPDATE";
public const string DEFAULT_RMC_VERSION_UPDATE = "1.0";
public static string RMC_VERSION_UPDATE => VirtueSky.DataStorage.GameData.Get(KEY_RMC_VERSION_UPDATE, DEFAULT_RMC_VERSION_UPDATE);
public const string KEY_RMC_CONTENT_UPDATE = "RMC_CONTENT_UPDATE";
public const string DEFAULT_RMC_CONTENT_UPDATE = "Update Content";
public static string RMC_CONTENT_UPDATE => VirtueSky.DataStorage.GameData.Get(KEY_RMC_CONTENT_UPDATE, DEFAULT_RMC_CONTENT_UPDATE);
}
}```
- Handle
From the `RemoteData` script, you can retrieve `key data`, `default values`, and `data` fetched from firebase remote configuration.
Example
```csharp
void HandleBannerAds()
{
if (RemoteData.RMC_ON_OFF_BANNER)
{
// show banner ads
}
}```