This system adds badge notifications to UI elements in Unity, showing numbers or symbols to indicate updates.
- Create an empty GameObject in your scene.
- Attach the
BadgeManager
script to it. - You can also drag and drop the badmanager prefab from the
BadgeNotificationSystem
folder into the scene.
- Add the
BadgeComponent
script to any UI element (e.g., buttons). - Set the
BadgeID
to match the badge type (Shop, Quests, Inbox, etc.). - Assign a symbol image to the image variable.
- Attach
BadgeMappingInitializer
to a GameObject in the scene. - Configure child mappings in the Inspector.
- The system will initialize badges and propagate changes automatically.
To set a badge (e.g., shop):
BadgeManager.Instance.SetBadge(BadgeID.Shop);
To clear a badge (e.g., remove badge on shop):
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.