You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
719 B

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<ConversationComponent>();
if (dialog != null)
{
if (dialog.Conversations != null && dialog.Conversations.Length > 0)
{
var conversation = dialog.Conversations[0];
if (conversation != null)
{
ConversationManager.Instance.StartConversation(conversation);
}
}
}
}
}