본문으로 건너뛰기

기본 설정

플레이나누 채팅 서비스를 활용하기 위해서 기존 플레이나누 플러그인이 우선적으로 설정이 되어있어야 합니다.

메시지를 수신하기 위하여 어플리케이션에 콜백으로 메소드를 구현해야 합니다.
유니티(C#)에서는 IChatListner 인터페이스가 정의 되어있으며 해당 인터페이스를 활용하여 메소드를 구현하세요.

소스 코드

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

public class PlayNANOOChatExample : MonoBehaviour, IChatListener
{
public void OnChannels(ChatChannelModel[] channels)
{
throw new System.NotImplementedException();
}

public void OnConntected()
{
throw new System.NotImplementedException();
}

public void OnDisconnected()
{
throw new System.NotImplementedException();
}

public void OnError(ChatErrorModel error)
{
throw new System.NotImplementedException();
}

public void OnNotifyMessage(ChatInfoModel chatInfo, string message)
{
throw new System.NotImplementedException();
}

public void OnPlayerOnline(ChatPlayerModel[] players)
{
throw new System.NotImplementedException();
}

public void OnPrivateMessage(ChatInfoModel chatInfo, string message)
{
throw new System.NotImplementedException();
}

public void OnPublicMessage(ChatInfoModel chatInfo, string message)
{
throw new System.NotImplementedException();
}

public void OnSubscribed(ChatInfoModel chatInfo)
{
throw new System.NotImplementedException();
}

public void OnUnSubscribed(ChatInfoModel chatInfo)
{
throw new System.NotImplementedException();
}
}