https://github.com/blacksentrydevxo/unity-ui-badge-notification-system
A simple badge notification system for your unity game to help bring player's attention to certain key parts of your UI and notify players without popups.
https://github.com/blacksentrydevxo/unity-ui-badge-notification-system
unity-scripts unity-ui-toolkit unity3d-plugin
Last synced: 3 months ago
JSON representation
A simple badge notification system for your unity game to help bring player's attention to certain key parts of your UI and notify players without popups.
- Host: GitHub
- URL: https://github.com/blacksentrydevxo/unity-ui-badge-notification-system
- Owner: BlackSentryDevXo
- License: mit
- Created: 2025-03-23T20:27:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-23T21:21:40.000Z (over 1 year ago)
- Last Synced: 2025-03-23T21:28:03.078Z (over 1 year ago)
- Topics: unity-scripts, unity-ui-toolkit, unity3d-plugin
- Language: C#
- Homepage:
- Size: 1.42 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎯 Badge Notification System
This system adds **badge notifications** to UI elements in Unity, showing numbers or symbols to indicate updates.
## 🛠️ Setup Instructions
### 1️⃣ Add the `BadgeManager`
1. Create an **empty GameObject** in your scene.
2. Attach the **`BadgeManager`** script to it.
3. You can also drag and drop the badmanager prefab from the `BadgeNotificationSystem` folder into the scene.
### 2️⃣ Attach `BadgeComponent` to Button UI Elements
1. Add the **`BadgeComponent`** script to any UI element (e.g., buttons).
2. Set the **`BadgeID`** to match the badge type (Shop, Quests, Inbox, etc.).
3. Assign a **symbol image** to the image variable.
### 3️⃣ Initialize Badges in `BadgeMappingInitializer`
1. Attach **`BadgeMappingInitializer`** to a GameObject in the scene.
2. Configure **child mappings** in the Inspector.
3. The system will initialize badges and propagate changes automatically.
### 4️⃣ Trigger a Badge Update
To set a badge (e.g., shop):
```csharp
BadgeManager.Instance.SetBadge(BadgeID.Shop);
````
To clear a badge (e.g., remove badge on shop):
```csharp
BadgeManager.Instance.ClearBadge(BadgeID.Shop);
```
You can customize the system to support numerical notifications as well by modifying the BadgeType enum to include more types of badges.