C# 클래스 ChatGui, TLH

Simple Chat Server Gui to be put on a separate GameObject. Provides a global chat (in lobby) and a room chat (in room).
This script flags it's GameObject with DontDestroyOnLoad(). Make sure this is OK in your case. The Chat Server API in ChatClient basically lets you create any number of channels. You just have to name them. Example: "gc" for Global Channel or for rooms: "rc"+RoomName.GetHashCode() This simple demo sends in a global chat when in lobby and in room channel when in room. Create a more elaborate UI to let players chat in either channel while in room or send private messages. Names of users are set in Authenticate. That should be unique so users can actually get their messages. Workflow: Create ChatClient, Connect to a server with your AppID, Authenticate the user (apply a unique name) and subscribe to some channels. Subscribe a channel before you publish to that channel! Note: Don't forget to call ChatClient.Service(). Might later on be integrated into PUN but for now don't forget.
상속: MonoBehaviour, IChatClientListener
파일 보기 프로젝트 열기: hydrater/TLH 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
AlignBottom bool
ChannelsToJoinOnConnect string[]
ChatAppId string
DemoPublishOnSubscribe bool
FullScreen bool
GuiRect Rect
HistoryLengthToFetch int
IsVisible bool
chatClient ChatClient

공개 메소드들

메소드 설명
Awake ( ) : void
DebugReturn ( DebugLevel, level, string message ) : void
OnApplicationQuit ( ) : void

To avoid the Editor becoming unresponsive, disconnect all Photon connections in OnApplicationQuit.

OnChatStateChange ( ChatState state ) : void
OnConnected ( ) : void
OnDestroy ( ) : void

To avoid the Editor becoming unresponsive, disconnect the Chat connection.

OnDisconnected ( ) : void
OnEnable ( ) : void
OnGUI ( ) : void
OnGetMessages ( string channelName, string senders, object messages ) : void
OnPrivateMessage ( string sender, object message, string channelName ) : void
OnStatusUpdate ( string user, int status, bool gotMessage, object message ) : void
OnSubscribed ( string channels, bool results ) : void
OnUnsubscribed ( string channels ) : void
Start ( ) : void
Update ( ) : void

비공개 메소드들

메소드 설명
GuiSendsMsg ( ) : void
PostHelpToCurrentChannel ( ) : void

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

DebugReturn() 공개 메소드

public DebugReturn ( DebugLevel, level, string message ) : void
level DebugLevel,
message string
리턴 void

OnApplicationQuit() 공개 메소드

To avoid the Editor becoming unresponsive, disconnect all Photon connections in OnApplicationQuit.
public OnApplicationQuit ( ) : void
리턴 void

OnChatStateChange() 공개 메소드

public OnChatStateChange ( ChatState state ) : void
state ChatState
리턴 void

OnConnected() 공개 메소드

public OnConnected ( ) : void
리턴 void

OnDestroy() 공개 메소드

To avoid the Editor becoming unresponsive, disconnect the Chat connection.
public OnDestroy ( ) : void
리턴 void

OnDisconnected() 공개 메소드

public OnDisconnected ( ) : void
리턴 void

OnEnable() 공개 메소드

public OnEnable ( ) : void
리턴 void

OnGUI() 공개 메소드

public OnGUI ( ) : void
리턴 void

OnGetMessages() 공개 메소드

public OnGetMessages ( string channelName, string senders, object messages ) : void
channelName string
senders string
messages object
리턴 void

OnPrivateMessage() 공개 메소드

public OnPrivateMessage ( string sender, object message, string channelName ) : void
sender string
message object
channelName string
리턴 void

OnStatusUpdate() 공개 메소드

public OnStatusUpdate ( string user, int status, bool gotMessage, object message ) : void
user string
status int
gotMessage bool
message object
리턴 void

OnSubscribed() 공개 메소드

public OnSubscribed ( string channels, bool results ) : void
channels string
results bool
리턴 void

OnUnsubscribed() 공개 메소드

public OnUnsubscribed ( string channels ) : void
channels string
리턴 void

Start() 공개 메소드

public Start ( ) : void
리턴 void

Update() 공개 메소드

public Update ( ) : void
리턴 void

프로퍼티 상세

AlignBottom 공개적으로 프로퍼티

public bool AlignBottom
리턴 bool

ChannelsToJoinOnConnect 공개적으로 프로퍼티

public string[] ChannelsToJoinOnConnect
리턴 string[]

ChatAppId 공개적으로 프로퍼티

public string ChatAppId
리턴 string

DemoPublishOnSubscribe 공개적으로 프로퍼티

public bool DemoPublishOnSubscribe
리턴 bool

FullScreen 공개적으로 프로퍼티

public bool FullScreen
리턴 bool

GuiRect 공개적으로 프로퍼티

public Rect GuiRect
리턴 Rect

HistoryLengthToFetch 공개적으로 프로퍼티

public int HistoryLengthToFetch
리턴 int

IsVisible 공개적으로 프로퍼티

public bool IsVisible
리턴 bool

chatClient 공개적으로 프로퍼티

public ChatClient chatClient
리턴 ChatClient