본문으로 건너뛰기

메시지 수신

실시간 메시지를 수신하기 위해선 지속적으로 이벤트를 발생 시켜야 합니다.
메시지 수신 이벤트가 실행 되지 않는 경우 사용자의 메시지가 수신 되지 않습니다.

호출 정보

Service() {}

소스 코드

using UnityEngine;
using PlayNANOO.ChatServer;
using PlayNANOO.ChatServer.Models;

public class PlayNANOOChatExample : MonoBehaviour, IChatListener
{
ChatClient chatClient;

void Start()
{
chatClient = new ChatClient(this);
chatClient.SetPlayer("USER_ID", "USER_NAME");
chatClient.Connect();
}

void Update()
{
if (chatClient != null)
{
chatClient.Service();
}
}
}