Skip to content

Commit d3318d6

Browse files
Add files via upload
1 parent 40f241e commit d3318d6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Readme.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 🎯 Badge Notification System
2+
3+
This system adds **badge notifications** to UI elements in Unity, showing numbers or symbols to indicate updates.
4+
5+
## 🛠️ Setup Instructions
6+
7+
### 1️⃣ Add the `BadgeManager`
8+
1. Create an **empty GameObject** in your scene.
9+
2. Attach the **`BadgeManager`** script to it.
10+
3. You can also drag and drop the badmanager prefab from the `BadgeNotificationSystem` folder into the scene.
11+
12+
### 2️⃣ Attach `BadgeComponent` to Button UI Elements
13+
1. Add the **`BadgeComponent`** script to any UI element (e.g., buttons).
14+
2. Set the **`BadgeID`** to match the badge type (Shop, Quests, Inbox, etc.).
15+
3. Assign a **symbol image** to the image variable.
16+
17+
### 3️⃣ Initialize Badges in `BadgeMappingInitializer`
18+
1. Attach **`BadgeMappingInitializer`** to a GameObject in the scene.
19+
2. Configure **child mappings** in the Inspector.
20+
3. The system will initialize badges and propagate changes automatically.
21+
22+
### 4️⃣ Trigger a Badge Update
23+
To set a badge (e.g., shop):
24+
```csharp
25+
BadgeManager.Instance.SetBadge(BadgeID.Shop);
26+
27+
To clear a badge (e.g., remove badge on shop):
28+
```csharp
29+
BadgeManager.Instance.ClearBadge(BadgeID.Shop);
30+
31+
You can customize the system to support numerical notifications as well by modifying the BadgeType enum to include more types of badges.
32+

0 commit comments

Comments
 (0)