{"id":30754016,"url":"https://github.com/bwaynesu/bnav","last_synced_at":"2026-04-14T00:02:44.012Z","repository":{"id":310289000,"uuid":"1037130279","full_name":"bwaynesu/BNav","owner":"bwaynesu","description":"BNav is a Unity UI Navigation extension component designed to solve the limitations of Unity's built-in Navigation functionality. Through a grouping system and global settings, developers can control UI element navigation behavior more flexibly. ","archived":false,"fork":false,"pushed_at":"2025-08-17T02:36:40.000Z","size":827,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T04:18:25.242Z","etag":null,"topics":["components","grouping","navigation","selectable","ugui","ui","unity","unity-package","unity-plugin","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/bwaynesu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-08-13T05:41:05.000Z","updated_at":"2025-08-17T02:36:41.000Z","dependencies_parsed_at":"2025-08-17T04:19:02.916Z","dependency_job_id":"7a997418-bff7-47d5-ac57-da59d396caeb","html_url":"https://github.com/bwaynesu/BNav","commit_stats":null,"previous_names":["bwaynesu/bnav"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bwaynesu/BNav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwaynesu%2FBNav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwaynesu%2FBNav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwaynesu%2FBNav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwaynesu%2FBNav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwaynesu","download_url":"https://codeload.github.com/bwaynesu/BNav/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwaynesu%2FBNav/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273581183,"owners_count":25131393,"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-09-04T02:00:08.968Z","response_time":61,"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":["components","grouping","navigation","selectable","ugui","ui","unity","unity-package","unity-plugin","unity3d"],"created_at":"2025-09-04T09:02:26.417Z","updated_at":"2026-04-14T00:02:43.970Z","avatar_url":"https://github.com/bwaynesu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BNav - Unity UI Navigation with Group Management\n\n[![Release Version](https://img.shields.io/github/v/release/bwaynesu/BNav?include_prereleases)](https://github.com/bwaynesu/BNav/releases) \n[![Release Date](https://img.shields.io/github/release-date/bwaynesu/BNav.svg)](https://github.com/bwaynesu/BNav/releases)  \n[![Unity Version](https://img.shields.io/badge/Unity-2020.3%2B-blue.svg?style=flat\u0026logo=unity)](https://unity3d.com/get-unity/download) \n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) \n[![Twitter](https://img.shields.io/twitter/follow/bwaynesu.svg?label=Follow\u0026style=social)](https://x.com/intent/follow?screen_name=bwaynesu)\n\nBNav is a Unity UI navigation system that **organizes UI elements into groups** and provides smart navigation between them. Perfect for creating complex UI systems like menus, settings, and inventories where you need precise control over navigation flow.  \n\n\u003cimg height=\"400\" alt=\"Unity_2025-08-17_13-40-32\" src=\"https://github.com/user-attachments/assets/5ace8c02-1780-4544-9610-62757def95e5\" /\u003e\u003c/br\u003e\n\n## ✨ Key Features\n\n### 🏷️ **UI Group Management**\n- **Organize UI elements into named groups** (e.g., \"MainMenu\", \"MainMenu/Profile\", \"Settings\")  \n  \u003cimg width=\"300\" alt=\"set_group\" src=\"https://github.com/user-attachments/assets/5e0c0977-72b3-416c-b511-d6f67457a3f6\" /\u003e\n\n- **Control navigation between groups** - define which groups can navigate to which other groups  \n  \u003cimg width=\"600\" alt=\"Unity_2025-08-17_14-05-36\" src=\"https://github.com/user-attachments/assets/61e62418-f317-421d-ae81-f555c38367c5\" /\u003e\n\n- **Hierarchical group support** with parent/child relationships using \"/\" separator  \n  \u003cimg width=\"400\" alt=\"group_slash\" src=\"https://github.com/user-attachments/assets/38226f43-7115-416f-8434-9def7d9711f7\" /\u003e\n\n### 🎯 **Smart Navigation System**\n- **Intelligent target selection** based on distance, angle, and priority  \n  \u003cimg width=\"600\" alt=\"Unity_2025-08-17_14-25-03\" src=\"https://github.com/user-attachments/assets/9d749420-d802-459a-82ad-9b9e33018f48\" /\u003e\n\n- **Customizable search cones** for each direction (0-1 range, where 0.5 ≈ 120°)  \n  \u003cimg width=\"600\" alt=\"Unity_2025-08-17_14-32-45\" src=\"https://github.com/user-attachments/assets/278e811b-b9ea-4303-8297-42657faaaa2a\" /\u003e\n\n- **Ignore ranges** to exclude certain areas from navigation calculations  \n  \u003cimg width=\"600\" alt=\"Unity_2025-08-17_14-42-51\" src=\"https://github.com/user-attachments/assets/e7ca97ed-5779-4370-bcc6-091c33060cb0\" /\u003e\n\n- **Global vs Local direction modes** (screen coordinates vs object transform)  \n  \u003cimg width=\"600\" alt=\"Unity_2025-08-17_15-01-27\" src=\"https://github.com/user-attachments/assets/d5b7671b-7087-4b2b-8d94-55ad636e57f7\" /\u003e\n\n### 🔄 **Fallback Navigation**\n- **Backup navigation targets** when no direct target is found\n- **Perfect for loop navigation** (e.g., last item jumps to first item)\n- **Per-direction fallback lists** (Up, Down, Left, Right)  \n\nhttps://github.com/user-attachments/assets/0bee79db-19fc-4b26-9417-ff13e099c5d7\n\n### 🎨 **Visual Development Tools**\n- **Scene view gizmos** showing navigation connections and search ranges\n- **Custom inspector** with group management and debugging tools\n- **Real-time navigation preview** during play mode\n\n## 🚀 Quick Start\n\n### Installation\n\n1. **Unity Package Manager**\n    - Open `Window` \u003e `Package Manager`\n    - Click `+` \u003e `Install package from git URL...`\n    - Enter: `https://github.com/bwaynesu/BNav.git?path=Assets/BNav`\n\n2. **Manual Installation**\n    - Download the latest `.unitypackage` from the [Releases](https://github.com/bwaynesu/BNav/releases) page\n    - In Unity, double-click the `.unitypackage` or use `Assets \u003e Import Package \u003e Custom Package...` to import\n\n### Basic Setup\n\n1. **Add `BNavigation` Component**\n    - Attach to any GameObject with a Selectable component (Button, Toggle, etc.)\n\n2. **Create Groups**\n    - Use `Project Settings` \u003e `BNav Settings` or open Global Settings from the `BNavigation` Component\n    - Use the `Add New Group` tool to create groups\n    - Assign the `Belong Group` field in the `BNavigation` Component to organize your UI elements\n\n3. **Configure Group Navigation Rules**\n    - Open the Global Settings asset\n    - Define which groups can navigate to other groups\n\n## 📖 Core Concepts\n\n### Group Management System\n\nThe heart of BNav is organizing UI elements into groups and controlling navigation between them.\n\n```csharp\n// Example group structure:\n\"MainMenu\"           // Main menu buttons (e.g. Play, Settings, Profile, Exit)\n\"MainMenu/Profile\"   // Player profile group (e.g. switch character, edit nickname)\n\"MainMenu/Settings\"  // Settings submenu group (e.g. Audio, Video, Controls)\n\"MainMenu/Settings/Audio\"  // Audio settings group (e.g. volume slider, mute button)\n\"MainMenu/Settings/Video\"  // Video settings group\n```\n\n### Global Settings Configuration\n\nCreate navigation rules between groups:\n\n```csharp\n// In BNavGlobalSettings:\n\"MainMenu\" → [\"MainMenu/Profile\", \"MainMenu/Settings\"]\n\"MainMenu/Settings\" → [\"MainMenu/Settings/Audio\", \"MainMenu/Settings/Video\"]\n\"MainMenu/Settings/Audio\" → [\"MainMenu/Settings\"]\n\"MainMenu/Settings/Video\" → [\"MainMenu/Settings\"]\n```\n\n### BNavigation Component\n\nReplace Unity's default navigation with BNavigation:\n\n```csharp\n[SerializeField] private string belongGroup = \"MainMenu\";\n[SerializeField] private int priority = 0;\n[SerializeField] private bool enableUp = true;\n[SerializeField] private bool enableDown = true;\n[SerializeField] private bool enableLeft = true;\n[SerializeField] private bool enableRight = true;\n...\n```\n\n## ⚙️ Advanced Configuration\n\n### Direction Modes\n\nChoose between global (screen) or local (transform) coordinates:\n\n```csharp\n// Global mode: Up = screen up, regardless of rotation\nnavigation.DirectionMode = DirectionMode.Global;\n\n// Local mode: Up = transform.up, follows object rotation  \nnavigation.DirectionMode = DirectionMode.Local;\n```\n\n### Ignore Range Configuration\n\nExclude areas around UI elements from navigation:\n\n```csharp\n// Disable ignore range completely\nnavigation.IgnoreRangeMode = IgnoreRangeMode.Disabled;\n\n// Auto-sync with RectTransform size\nnavigation.IgnoreRangeMode = IgnoreRangeMode.AutoSyncToSize;\n\n// Or manually configure\nnavigation.IgnoreRangeMode = IgnoreRangeMode.Manual;\nnavigation.IgnoreTop = 50f;\nnavigation.IgnoreBottom = 50f;\nnavigation.IgnoreLeft = 30f;\nnavigation.IgnoreRight = 30f;\n```\n\n### Search Range Tuning\n\nControl the navigation search cone for each direction:\n\n```csharp\n// Narrow search cone (more precise)\nnavigation.SearchRangeUp = 0.3f;    // ~90° cone\nnavigation.SearchRangeDown = 0.3f;\n\n// Wide search cone (more forgiving)\nnavigation.SearchRangeLeft = 0.7f;  // ~140° cone\nnavigation.SearchRangeRight = 0.7f;\n```\n\n### Fallback Navigation\n\nCreate loop navigation or backup targets:\n\n```csharp\n// Loop navigation: last item → first item\nvar lastItem = inventoryItems[inventoryItems.Length - 1].GetComponent\u003cBNavigation\u003e();\nvar firstItem = inventoryItems[0].GetComponent\u003cBNavigation\u003e();\n\nlastItem.FallbackNavigationsDown.Add(firstItem);\nfirstItem.FallbackNavigationsUp.Add(lastItem);\n```\n\n## 🔧 Runtime API\n\n### Group Management\n\n```csharp\n// Change group at runtime\nnavigation.BelongGroup = \"NewGroup\";\n\n// Check navigation possibility\nbool canNavigate = BNavManager.GlobalSettings.CanNavigate(belongGroup, targetGroup);\n\n// Iterate all reachable navigations\nforeach (var navigation in BNavManager.EachReachableNavigation(belongGroup, globalSettings))\n```\n\n### Finding Navigation Targets\n\n```csharp\n// Find target in specific direction\nvar target = navigation.FindNavigationTarget(NavigationDirection.Up);\n\n// Find fallback target\nvar fallbackTarget = navigation.FindFallbackNavigationTarget(NavigationDirection.Down);\n\n// Check if can navigate to specific target\nbool canNavigate = navigation.CanNavigateTo(otherNavigation);\n```\n\n## 🎨 Visual Debugging\n\n### Scene View Features\n\n- **Colorful lines**: Available navigation connections\n- **Search cones**: Visual representation of search ranges\n- **Orange rectangles**: Ignore ranges\n\n### Inspector Tools\n\n- **Group dropdown**: Easy group assignment with validation\n- **Priority settings**: Control selection preference\n- **Search range sliders**: Visual tuning of navigation cones\n- **Fallback lists**: Drag-and-drop backup targets\n\n### Debug Mode\n\n```csharp\n// Enable navigation following in editor\nBNavigation.debugFollowNavigation = true;\n```\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n**Q: \"Group 'MyGroup' not found in Global Settings\"**\n- Use `Project Settings` \u003e `BNav Settings` or open Global Settings from the `BNavigation` Component\n- Add your group in the Global Settings editor\n- Ensure the group name matches exactly\n\n**Q: Navigation not working between groups**\n- Check Global Settings - make sure source group can navigate to target group\n- Add the target group to the source group's `Reachable Groups` list\n\n**Q: UI elements not responding to navigation**\n- Check if the Selectable is interactable\n- Verify the `BNavigation` component is enabled\n\n**Q: Navigation jumping to unexpected targets**\n- Adjust search ranges to narrow the selection cone\n- Set up ignore ranges to exclude nearby elements\n- Use priority values to prefer certain targets\n\n## 📄 License\n\nThis project is under the [MIT License](LICENSE).\n\n## ✍️ Author\n\n- [bwaynesu](https://bwaynesu.github.io/portfolio/) \n\n## 🔗 Links\n\n- [Repository](https://github.com/bwaynesu/BNav)\n- [Releases](https://github.com/bwaynesu/BNav/releases)\n- [Issues](https://github.com/bwaynesu/BNav/issues)\n- [Discussions](https://github.com/bwaynesu/BNav/discussions)\n\n## 📚 See Also\n\n- [GitHub](https://bwaynesu.github.io/portfolio/)\n- [Asset Store](https://assetstore.unity.com/publishers/115148)\n- [Medium](https://medium.com/@bwaynesu)\n- [X](https://x.com/bwaynesu)\n- [YouTube](https://www.youtube.com/@bwaynesu)\n\n---\n\n**BNav** - Making Unity UI navigation simple and powerful through intelligent grouping 🎯\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwaynesu%2Fbnav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwaynesu%2Fbnav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwaynesu%2Fbnav/lists"}