Reply To: Ch5, MessagingClientReceiver

Home Forums Books Mastering Unity 2D Game Development Ch5, MessagingClientReceiver Reply To: Ch5, MessagingClientReceiver


Sorry it took so long to get back to you @leonardo, work stuff is pretty annoying at times.


I’ve downloaded your project and found 2 places you are having issue with the Messaging manager.

First, the class you are passing in to the singleton is wrong, for the Messaging Manager you should be using a singleton of the messaging manager.

So the following:


public class MessagingManager : Singleton<ConversationComponent>


Should read:


public class MessagingManager : Singleton<MessagingManager>


Also when you implemented the Singleton, you hadn’t removed the old style singleton code first, leaving the “Instance” Property and the code in awake to initialise it.

So you need to remove the following lines


public static MessagingManager Instance { get; private set; }

if (Instance != null && Instance != this)
// Destroy other instances if it not the same

//// Save our current singleton instance
Instance = this;

// Make sure that the instance is not destroyed between scenes (this is optional)



Hope this helps and good luck on your gamedev journey

Simon (Darkside) Jackson