Pub-Sub Messenger View on Asset Store (opens in new tab)

Package details

Latest version
1.0.1
Last updated
First released
Unity version
2020.3.5 or later
Package size
1.1 MB
Files
48
Favorites
45
Views in the past week
12

Price tracking

Last checked
Tracked since
Lowest recorded
Free on

Pub-Sub Messenger

by Super Maxim (opens in new tab)

5.0 / 5 · 7 ratings

Ratings by stars
Number of ratings for each star rating
5 stars 7
4 stars 0
3 stars 0
2 stars 0
1 star 0
Price Free

Get it free on Asset Store (opens in new tab)

Affiliate link · Purchases support this site

Price history

Last 6 months

USD
Price history for Pub-Sub Messenger, 6 months Current Free; lowest Free; highest Free in this period. $0 Jun Jul Aug Sep Oct Nov

Asset preview

1 / 4

Pub-Sub Messenger screenshot 1

Pub-Sub Messenger screenshot 1

About this asset

Pub\Sub Messenger is a Lightweight, Open Source Library for Unity.

This library will provide a Pub\Sub Mechanism that is a part of SOLID principles in programming.

PROBLEMS IN GAMES

* Wiring the Parts with Events – Tightly Coupled and may cause Memory Leak problems. The Publisher and the Subscriber have to know of each other, and a Subscriber can’t be collected by the GC if it’s connected with the Publisher with strong event reference.

* Using Unity Event Routing – Although Unity Event Routing is a very good feature, it is a Unity Specific Solution and we need a generic one. Also, we cannot use it everywhere even if the project is in Unity.

* Dependency - In commonly used C# events or delegates, classes are “familiar” with each other and this prevents good modularity. This is NOT following SOLID Principles and Objects are not Encapsulated.

THE SOLUTION

* Pub\Sub Messenger - Container for Events that allows Decoupling of Publishers and Subscribers so they can evolve independently. This Decoupling is useful in Modularised Applications because new modules can be added that respond to events defined by the Shell or, more likely, other modules. All events have a Weak Reference and invocation can be done Async or Sync way.

* Payloads - Instead of passing objects or modules, pass small Payloads (Data/Messages) that are relevant for the specific cases/events.

* Encapsulation - Classes/Modules will not be “familiar” with each other, this will allow better encapsulation and less dependencies.

* Weak Reference - In case of subscriber’s destruction, it will be removed automatically from Messenger’s list, since it was referenced via Weak Reference.

* SOLID Principles - Pub/Sub can be a great pattern in combination with Dependency Injection (DP) and with Inversion of Control (IoC), both part of SOLID Principles.

Supported Platforms: Android, iOS, Windows, Mac, Linux, WebGL

Supported Unity Versions: 2017.x, 2018.x, 2019.x

Sources

* GitHub Project

* Youtube Clip

From the publisher's Asset Store listing.

Compatibility

Render pipelines supported in each Unity version
Unity version Built-in URP HDRP
2020.3.5f1 Compatible Not listed Not listed

As listed on the Asset Store.