{"id":26865859,"url":"https://github.com/codergamester/unity-uiservice","last_synced_at":"2026-01-06T11:21:39.696Z","repository":{"id":51829183,"uuid":"231986592","full_name":"CoderGamester/Unity-UiService","owner":"CoderGamester","description":"This package provides a service to help manage an Unity's, game UGUI","archived":false,"fork":false,"pushed_at":"2025-01-08T18:10:51.000Z","size":120,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T04:52:45.021Z","etag":null,"topics":["game-development","gamedev","ugui","ui","ui-components","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoderGamester.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-01-05T22:53:20.000Z","updated_at":"2025-01-08T18:06:25.000Z","dependencies_parsed_at":"2024-11-13T23:31:10.058Z","dependency_job_id":null,"html_url":"https://github.com/CoderGamester/Unity-UiService","commit_stats":null,"previous_names":["codergamester/unity-uiservice"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/CoderGamester/Unity-UiService","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2FUnity-UiService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2FUnity-UiService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2FUnity-UiService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2FUnity-UiService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderGamester","download_url":"https://codeload.github.com/CoderGamester/Unity-UiService/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderGamester%2FUnity-UiService/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268439626,"owners_count":24250671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["game-development","gamedev","ugui","ui","ui-components","unity","unity3d"],"created_at":"2025-03-31T04:52:48.642Z","updated_at":"2026-01-06T11:21:39.689Z","avatar_url":"https://github.com/CoderGamester.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GameLovers UI Service\n\n[![Unity Version](https://img.shields.io/badge/Unity-6000.0%2B-blue.svg)](https://unity3d.com/get-unity/download)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Version](https://img.shields.io/badge/version-1.0.0-green.svg)](CHANGELOG.md)\n\n\u003e **Quick Links**: [Installation](#installation) | [Quick Start](#quick-start) | [Documentation](docs/README.md) | [Examples](#examples) | [Troubleshooting](docs/troubleshooting.md)\n\n\u003c!-- TODO: Add a demo GIF or video showing the UiService in action --\u003e\n\u003c!-- Recommended content:\n     - Opening/closing UI presenters with animations\n     - Layer management demonstration\n     - Editor windows (Analytics Window, Hierarchy Window)\n     - UI Sets batch operations\n--\u003e\n\n![UiService Demo](docs/images/demo.gif)\n\n## Why Use This Package?\n\nManaging UI in Unity games often becomes a tangled mess of direct references, scattered open/close logic, and manual lifecycle management. This **UI Service** solves these pain points:\n\n| Problem | Solution |\n|---------|----------|\n| **Scattered UI logic** | Centralized service manages all UI lifecycle (load → open → close → unload) |\n| **Memory management headaches** | Addressables integration with automatic asset loading/unloading |\n| **Rigid UI hierarchies** | Layer-based organization with flexible depth sorting |\n| **Duplicated boilerplate** | Feature composition system extends behavior without inheritance complexity |\n| **Async loading complexity** | UniTask-powered async operations with cancellation support |\n| **No visibility into UI state** | Editor windows for real-time analytics, hierarchy debugging, and configuration |\n| **Difficult testing** | Injectable interfaces (`IUiService`, `IUiAssetLoader`) and built-in loaders enable easy mocking |\n\n**Built for production:** Used in real games with WebGL, mobile, and desktop support. Zero per-frame allocations in hot paths.\n\n### Key Features\n\n- **🎭 UI Model-View-Presenter Pattern** - Clean separation of UI logic with lifecycle management\n- **🎨 UI Toolkit Support** - Compatible with both uGUI and UI Toolkit\n- **🧩 Feature Composition** - Modular feature system for extending presenter behavior\n- **🔄 Async Loading** - Load UI assets asynchronously with UniTask support\n- **📦 UI Group Organization** - Organize UI elements by depth layers and in groups for batch operations\n- **💾 Memory Management** - Efficient loading/unloading of UI assets with Unity's Addressables system\n- **📊 Analytics \u0026 Performance Tracking** - Optional analytics system with dependency injection\n- **🛠️ Editor Tools** - Powerful editor windows for debugging and monitoring\n- **📱 Responsive Design** - Built-in support for device safe areas (e.g. iPhone dynamic island)\n\n---\n\n## System Requirements\n\n- **[Unity](https://unity.com/download)** (v6.0+) - To run the package\n- **[Unity Addressables](https://docs.unity3d.com/Packages/com.unity.addressables@latest)** (v2.6.0+) - For async asset loading\n- **[UniTask](https://github.com/Cysharp/UniTask)** (v2.5.10+) - For efficient async operations\n\nDependencies are automatically resolved when installing via Unity Package Manager.\n\n### Compatibility Matrix\n\n| Unity Version | Status | Notes |\n|---------------|--------|-------|\n| 6000.3.x (Unity 6) | ✅ Fully Tested | Primary development target |\n| 6000.0.x (Unity 6) | ✅ Fully Tested | Fully supported |\n| 2022.3 LTS | ⚠️ Untested | May require minor adaptations |\n\n| Platform | Status | Notes |\n|----------|--------|-------|\n| Standalone (Windows/Mac/Linux) | ✅ Supported | Full feature support |\n| WebGL | ✅ Supported | Requires UniTask (no Task.Delay) |\n| Mobile (iOS/Android) | ✅ Supported | Full feature support |\n| Console | ⚠️ Untested | Should work with Addressables setup |\n\n## Installation\n\n### Via Unity Package Manager (Recommended)\n\n1. Open Unity Package Manager (`Window` → `Package Manager`)\n2. Click the `+` button and select `Add package from git URL`\n3. Enter the following URL:\n   ```\n   https://github.com/CoderGamester/com.gamelovers.uiservice.git\n   ```\n\n### Via manifest.json\n\nAdd the following line to your project's `Packages/manifest.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"com.gamelovers.uiservice\": \"https://github.com/CoderGamester/com.gamelovers.uiservice.git\"\n  }\n}\n```\n\n### Via OpenUPM\n\n```bash\nopenupm add com.gamelovers.uiservice\n```\n\n---\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Getting Started](docs/getting-started.md) | Installation, setup, and first presenter |\n| [Core Concepts](docs/core-concepts.md) | Presenters, layers, sets, features |\n| [API Reference](docs/api-reference.md) | Complete API documentation |\n| [Advanced Topics](docs/advanced.md) | Analytics, performance, helper views |\n| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |\n\n## Package Structure\n\n```\nRuntime/\n├── Loaders/\n│   ├── IUiAssetLoader.cs          # Asset loading interface\n│   ├── AddressablesUiAssetLoader.cs # Addressables implementation\n│   ├── PrefabRegistryUiAssetLoader.cs # Direct prefab references\n│   └── ResourcesUiAssetLoader.cs # Resources.Load implementation\n├── IUiService.cs          # Public API interface\n├── UiService.cs           # Core implementation\n├── UiPresenter.cs         # Base presenter classes\n├── UiConfigs.cs           # Configuration ScriptableObject\n├── Features/              # Composable features\n│   ├── TimeDelayFeature.cs\n│   ├── AnimationDelayFeature.cs\n│   └── UiToolkitPresenterFeature.cs\n└── Views/                 # Helper components\n\nEditor/\n├── UiConfigsEditor.cs     # Enhanced inspector\n├── UiAnalyticsWindow.cs   # Performance monitoring\n└── UiServiceHierarchyWindow.cs  # Live debugging\n```\n\n### Key Files\n\n| Component | Responsibility |\n|-----------|----------------|\n| **IUiService** | Public API surface for all UI operations |\n| **UiService** | Core implementation managing lifecycle, layers, and state |\n| **UiPresenter** | Base class for all UI views with lifecycle hooks |\n| **UiConfigs** | ScriptableObject storing UI configuration and sets |\n| **PrefabRegistryConfig** | Map address keys to UI Prefabs for direct reference |\n| **IUiAssetLoader** | Interface for custom asset loading strategies |\n| **AddressablesUiAssetLoader** | Handles Addressables integration for async loading |\n| **PrefabRegistryUiAssetLoader** | Simple loader for direct prefab references |\n| **ResourcesUiAssetLoader** | Loads UI from Unity's Resources folder |\n| **PresenterFeatureBase** | Base class for composable presenter behaviors |\n| **UiInstanceId** | Enables multiple instances of the same presenter type |\n\n---\n\n## Quick Start\n\n### 1. Create UI Configuration\n\n1. Right-click in Project View\n2. Navigate to `Create` → `ScriptableObjects` → `Configs` → `UiConfigs`\n3. Configure your UI presenters in the created asset\n\n### 2. Initialize the UI Service\n\n```csharp\nusing UnityEngine;\nusing GameLovers.UiService;\n\npublic class GameInitializer : MonoBehaviour\n{\n    [SerializeField] private UiConfigs _uiConfigs;\n    private IUiServiceInit _uiService;\n    \n    void Start()\n    {\n        _uiService = new UiService();\n        _uiService.Init(_uiConfigs);\n    }\n}\n```\n\n### 3. Create Your First UI Presenter\n\n```csharp\nusing UnityEngine;\nusing GameLovers.UiService;\n\npublic class MainMenuPresenter : UiPresenter\n{\n    [SerializeField] private Button _playButton;\n    \n    protected override void OnInitialized()\n    {\n        _playButton.onClick.AddListener(OnPlayClicked);\n    }\n    \n    protected override void OnOpened()\n    {\n        Debug.Log(\"Main menu opened!\");\n    }\n    \n    protected override void OnClosed()\n    {\n        Debug.Log(\"Main menu closed!\");\n    }\n    \n    private void OnPlayClicked()\n    {\n        Close(destroy: false);\n    }\n}\n```\n\n### 4. Open and Manage UI\n\n```csharp\n// Open UI\nvar mainMenu = await _uiService.OpenUiAsync\u003cMainMenuPresenter\u003e();\n\n// Check visibility\nif (_uiService.IsVisible\u003cMainMenuPresenter\u003e())\n{\n    Debug.Log(\"Main menu is visible\");\n}\n\n// Close UI\n_uiService.CloseUi\u003cMainMenuPresenter\u003e();\n```\n\n📖 **For complete setup guide, see [Getting Started](docs/getting-started.md)**\n\n---\n\n## Examples\n\nThe package includes sample implementations in the `Samples~` folder.\n\n### Importing Samples\n\n1. Open Unity Package Manager (`Window` → `Package Manager`)\n2. Select \"UI Service\" package\n3. Navigate to the \"Samples\" tab\n4. Click \"Import\" next to the sample you want\n\n### Available Samples\n\n| Sample | Description |\n|--------|-------------|\n| **BasicUiFlow** | Basic presenter lifecycle and button interactions |\n| **DataPresenter** | Data-driven UI with `UiPresenter\u003cT\u003e` |\n| **DelayedPresenter** | Time and animation delay features |\n| **UiToolkit** | UI Toolkit (UI Elements) integration |\n| **DelayedUiToolkit** | Multiple features combined |\n| **Analytics** | Performance tracking integration |\n\n---\n\n## Contributing\n\nWe welcome contributions! Here's how you can help:\n\n### Reporting Issues\n\n- Use the [GitHub Issues](https://github.com/CoderGamester/com.gamelovers.uiservice/issues) page\n- Include Unity version, package version, and reproduction steps\n- Attach relevant code samples, error logs, or screenshots\n\n### Development Setup\n\n1. Fork the repository on GitHub\n2. Clone your fork: `git clone https://github.com/yourusername/com.gamelovers.uiservice.git`\n3. Create a feature branch: `git checkout -b feature/amazing-feature`\n4. Make your changes with tests\n5. Commit: `git commit -m 'Add amazing feature'`\n6. Push: `git push origin feature/amazing-feature`\n7. Create a Pull Request\n\n### Code Guidelines\n\n- Follow [C# Coding Conventions](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions)\n- Add XML documentation to all public APIs\n- Include unit tests for new features\n- Update CHANGELOG.md for notable changes\n\n---\n\n## Support\n\n- **Issues**: [Report bugs or request features](https://github.com/CoderGamester/com.gamelovers.uiservice/issues)\n- **Discussions**: [Ask questions and share ideas](https://github.com/CoderGamester/com.gamelovers.uiservice/discussions)\n- **Changelog**: See [CHANGELOG.md](CHANGELOG.md) for version history\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n---\n\n**Made with ❤️ for the Unity community**\n\n*If this package helps your project, please consider giving it a ⭐ on GitHub!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodergamester%2Funity-uiservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodergamester%2Funity-uiservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodergamester%2Funity-uiservice/lists"}