File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments