Unity3D

Download the ProudChat Unity SDK from the link below.

Project settings

Add Unity PackageFile

ProudChatUnityPackage downloaded via git Add the Package via Assets - Import Package - custom Package at the top of the Unity Editor.

Setting up plugins

Please see Plugin settings.

ProudChatComponent

The ProudChatComponent makes it easy for users to get each of the features they need for chat.

Be sure to register and use only one Component.

- ProudChat_Init

This is the part that initializes the ChatClient. The user must call the Init function to connect to the server before using it.

Function NameParametersDescription

ProudChat_Init

The user's UUID from the Proud Console, the UUID of the project the user created, and the user's own UniqueID.

You write this part as a function to connect the ChatClient with the server. We're getting 3 strings as parameters, but internally we're calling the ChatClientInitComplete, ChatClientJoinFailed functions so we can see if the login was successful or unsuccessful.

- Function

Function NameParametersDescription

AddChannel

Unique key for the channel you want to access

Use when you want to access a specific channel.

Leave_Channel

Unique key for the channel you want to leave

Use this when you want to leave the channel you're in.

Send_Msg

A unique identification value for a specific recipient, a message to send to the specific party

Use to send a message to a specific recipient.

Send_ChannelMsg

A unique identification value for a specific channel, a message to send to the specific channel

Use to send a message to a specific channel.

- Event Variables

Event function nameDescription

m_ClientInitComplete_Event

This event is fired when the ChatClient has completed its Init, and is available for users to register and use. The example fires an event when the ChatClientInitComplete() function is called and prints a Unity log that says 'ProudChat Connection Success' and adds a channel named "ALL".

m_ClientInitFailed_Event

This event is fired when Init Failed in the ChatClient and is available for users to register for. The example fires an event when the ChatClientJoinFailed() function is called, and returns an error on failure with the log "ProudChat Connection Failed".

m_SendMsg_Response_Event

Handle events when a user-to-user send message arrives. Users can register an Event to make it available, and when they do, they receive the Unique ID that generated the message and the message sent by the other party as parameters.

m_ChannelMsg_Response_Event

An event that occurs when a Channel Message arrives. Users can make an Event available by registering it, which takes as parameters the Unique ID of the channel the message came from, the Unique ID that generated the message, and the message sent by the other party.

m_Notice_Response_Event

It handles events when a Notice arrives. Users can register and use Events. In this example, we use Notice_Response() to print out the content of an announcement when it is sent from the Proud Console.

- Event Functions

Function NameDescription

ChatClientInitComplete

This function is called after a successful server connection and login.

ChatClientJoinFailed

Function called on server login failure. This function is fired when the connection to the server is successful, but the account is unable to log in. This part doesn't retry on failure, so you'll need to check your settings.

SendMsg_Response

A function that is delegated when another user sends you a message.

ChannelMsg_Response

A function that is delegated when another user sends a message to the channel.

Notice_Response

This function is delegated by ProudConsle when sending an announcement, and receives a message from the server and outputs the announcement contents.

Building

- Android

- iOS

For more information, see Building iOS.

Last updated