连接状态查询
查询聊天服务器的连接状态。
调用信息
bool IsConnected() {}
源代码
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();
bool isConnected = chatClient.IsConnected();
if (isConnected)
{
Debug.Log("Connected");
}
else
{
Debug.Log("DisConnected");
}
}
}