-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChatManager.cs
More file actions
41 lines (36 loc) · 1.39 KB
/
Copy pathChatManager.cs
File metadata and controls
41 lines (36 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using UnityEngine;
using Photon.Pun;
using Photon.Chat;
using Photon.Realtime;
using UnityEngine.UI;
using ExitGames.Client.Photon;
public class ChatManager : MonoBehaviour, IChatClientListener
{
public InputField chatInput;
public Text chatDisplay;
private ChatClient chatClient;
void Start()
{
chatClient = new ChatClient(this);
chatClient.Connect(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat, "1.0",
new Photon.Chat.AuthenticationValues(PhotonNetwork.NickName));
}
void Update()
{
if (chatClient != null)
{
chatClient.Service();
}
}
public void DebugReturn(DebugLevel level, string message) { }
public void OnDisconnected() { }
public void OnConnected() { }
public void OnChatStateChange(ChatState state) { }
public void OnGetMessages(string channelName, string[] senders, object[] messages) { }
public void OnPrivateMessage(string sender, object message, string channelName) { }
public void OnSubscribed(string[] channels, bool[] results) { }
public void OnUnsubscribed(string[] channels) { }
public void OnStatusUpdate(string user, int status, bool gotMessage, object message) { }
public void OnUserSubscribed(string channel, string user) { }
public void OnUserUnsubscribed(string channel, string user) { }
}