using UnityEngine; // Register to events broadcast by the Message Client public class MessagingClientReceiver : MonoBehaviour { void Start() { MessagingManager.Instance.Subscribe(ThePlayerIsTryingToLeave); } void ThePlayerIsTryingToLeave() { var dialog = GetComponent(); if (dialog != null) { if (dialog.Conversations != null && dialog.Conversations.Length > 0) { var conversation = dialog.Conversations[0]; if (conversation != null) { ConversationManager.Instance.StartConversation(conversation); } } } } }