{"id":26252819,"url":"https://github.com/sov3rain/unity-flavors","last_synced_at":"2026-04-28T13:03:47.410Z","repository":{"id":282084808,"uuid":"947435529","full_name":"Sov3rain/unity-flavors","owner":"Sov3rain","description":"A flexible package for managing different flavors (configs) of your Unity app","archived":false,"fork":false,"pushed_at":"2025-03-12T17:38:03.000Z","size":215,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-01T12:10:20.519Z","etag":null,"topics":["build","flavors","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sov3rain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-12T17:23:45.000Z","updated_at":"2025-03-12T17:38:15.000Z","dependencies_parsed_at":"2025-03-12T18:36:16.351Z","dependency_job_id":"dbd1efcb-7052-4cc8-a071-a8c4f6332177","html_url":"https://github.com/Sov3rain/unity-flavors","commit_stats":null,"previous_names":["sov3rain/unity-flavors"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Sov3rain/unity-flavors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sov3rain%2Funity-flavors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sov3rain%2Funity-flavors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sov3rain%2Funity-flavors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sov3rain%2Funity-flavors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sov3rain","download_url":"https://codeload.github.com/Sov3rain/unity-flavors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sov3rain%2Funity-flavors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32381713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","flavors","unity","unity3d"],"created_at":"2025-03-13T17:28:21.064Z","updated_at":"2026-04-28T13:03:47.381Z","avatar_url":"https://github.com/Sov3rain.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Flavors\n\nA flexible package for managing different configurations (flavors) of your Unity application.\n\n## Overview\n\nUnity Flavors provides an easy way to maintain multiple variants of your application from a single codebase. This is particularly useful for:\n\n- Managing different build configurations (development, staging, production)\n- White-labeling your application with different branding\n- Creating free/premium versions with different features\n- Handling region-specific customizations\n\n## Features\n\n- Simple flavor creation and switching\n- Automatic define symbols for conditional compilation\n- Easy access to flavor-specific properties at runtime\n- Editor integration for seamless workflow\n- Configurable app identifiers, version numbers, and icons per flavor\n\n## Installation\n\nOpen the *Package Manager* window, and click the *+* icon, then click on *Add package from git url*. Copy and paste the\nfollowing url and click *Add*:\n\n```bash\nhttps://github.com/Sov3rain/unity-flavors.git?path=/Assets/unity-flavors#1.0.0\n```\n\nThis will tag the package with a specific version.\n\nYou can also install the SDK by downloading the `.unitypackage` from the [releases page](https://github.com/Sov3rain/unity-flavors/releases) and importing it into your project.\n\n## Getting Started\n\n### Creating a Flavor Manager\n\nBefore creating any flavors, you need to initialize the Flavor Manager:\n\n1. In the Unity menu, select `Flavors \u003e Create Flavor Manager`\n2. This will create a FlavorManager asset in your Resources folder\n\n### Creating Flavors\n\n1. In the Unity menu, select `Flavors \u003e Create Flavor`\n2. Enter a name for your flavor (e.g., \"Development\", \"Production\", \"FreeVersion\")\n3. Click either \"Create\" or \"Create and set as current\"\n\n### Switching Between Flavors\n\n1. In the Unity menu, select `Flavors \u003e Select Flavor`\n2. Click on the flavor you want to apply\n\n### Configuring a Flavor\n\nSelect a flavor asset in your Project window and configure its properties in the Inspector:\n\n#### Build Settings\n- **Product Name**: The name of your application\n- **Bundle Version**: The version string of your application\n- **Bundle Identifier**: The application identifier (e.g., \"com.company.app\")\n- **Icon**: The application icon\n\n#### Runtime Settings\n- **Properties**: Key-value pairs for flavor-specific runtime configuration\n\n## Usage Examples\n\n### Using Preprocessor Directives\n\nFlavors automatically create preprocessor directives based on the flavor name in the format `FLAVOR_FLAVORNAME`. You can use these to conditionally compile code:\n\n```csharp\n// This code will only compile when the \"Development\" flavor is active\n#if FLAVOR_DEVELOPMENT\n    Debug.Log(\"Running in development flavor\");\n    // Enable development-only features\n#endif\n\n// Different code paths for different flavors\n#if FLAVOR_PREMIUM\n    // Premium version features\n    EnablePremiumFeatures();\n#elif FLAVOR_FREE\n    // Free version features\n    ShowAds();\n#endif\n\n// Combining with other preprocessor directives\n#if UNITY_ANDROID \u0026\u0026 FLAVOR_CHINA\n    // China-specific Android code\n    InitializeChineseServices();\n#endif\n```\n\n### Accessing Flavor Properties at Runtime\n\nDefine properties in your Flavor asset's inspector, then access them at runtime:\n\n```csharp\nusing UnityEngine;\nusing UnityFlavors;\n\npublic class ExampleComponent : MonoBehaviour\n{\n    void Start()\n    {\n        // Get string properties\n        string apiUrl = FlavorManager.Instance.GetString(\"ApiUrl\", \"https://default-api.com\");\n        string welcomeMessage = FlavorManager.Instance.GetString(\"WelcomeMessage\", \"Hello!\");\n        \n        // Get numeric properties\n        int maxUsers = FlavorManager.Instance.GetInt(\"MaxUsers\", 10);\n        float cooldownTime = FlavorManager.Instance.GetFloat(\"CooldownTime\", 5.0f);\n        \n        // Use the properties\n        Debug.Log($\"Welcome message: {welcomeMessage}\");\n        Debug.Log($\"API URL: {apiUrl}\");\n        Debug.Log($\"Max users: {maxUsers}\");\n        Debug.Log($\"Cooldown: {cooldownTime}s\");\n    }\n}\n```\n\n### Checking Current Flavor\n\nYou can check which flavor is currently active:\n\n```csharp\nusing UnityEngine;\nusing UnityFlavors;\n\npublic class FlavorChecker : MonoBehaviour\n{\n    void Start()\n    {\n        if (FlavorManager.Instance.IsCurrentFlavor(\"Development\"))\n        {\n            Debug.Log(\"Running Development flavor\");\n        }\n        \n        // Display current flavor name\n        Debug.Log($\"Current flavor: {FlavorManager.Instance.Current.name}\");\n    }\n}\n```\n\n## Best Practices\n\n1. **Create a default flavor** - Always have a default flavor with sensible defaults\n2. **Use common property keys** - Maintain consistency in property keys across flavors\n3. **Organize flavor assets** - Keep flavor assets in a dedicated folder\n4. **Document your flavors** - Keep notes on what each flavor is for\n5. **Test all flavors** - Regularly test builds with different flavors\n\n## Troubleshooting\n\n### Define Symbols Not Working\n\nIf preprocessor directives aren't working:\n\n1. Select `Flavors \u003e Refresh Define Symbols` from the menu\n2. Ensure your flavor name doesn't contain special characters\n3. Check if the flavor is properly set as current\n\n### Properties Not Found\n\nIf your properties aren't accessible at runtime:\n\n1. Make sure the FlavorManager asset is in the Resources folder\n2. Verify that the property keys match exactly (case-sensitive)\n3. Check that you've properly set a current flavor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsov3rain%2Funity-flavors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsov3rain%2Funity-flavors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsov3rain%2Funity-flavors/lists"}