> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet.eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet.eng/proud_service/proudchat/download/unity3d.md).

# Unity3D

Download the ProudChat Unity SDK from the link below.

## :open\_file\_folder: [Unity ProudChat SDK](https://github.com/Nettention/ProudChatSDK/tree/main/ChatClientSDK/Unity)

## Project settings

### Add Unity PackageFile

ProudChatUnityPackage downloaded via git Add the Package via <mark style="color:orange;">Assets</mark> -> <mark style="color:orange;">Import Package</mark> -> <mark style="color:orange;">custom Package</mark> at the top of the Unity Editor.

<figure><img src="/files/MIq8lx6T75riDH2KQ3kw" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8tcV4PAFWfCPz98oXvNM" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XziF6ZpDyERxdcydOAyn" alt=""><figcaption><p>Import all  the package files.</p></figcaption></figure>

### Setting up plugins

{% hint style="info" %}
Please see [**Plugin settings.**](/proudnet.eng/proudnet/2.setting/unity3d.md#mac)
{% endhint %}

##

## ProudChatComponent

The <mark style="color:orange;">ProudChatComponent</mark> makes it easy for users to get each of the features they need for chat.

{% hint style="danger" %}
Be sure to register and use only one Component.
{% endhint %}

### - 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.

<table data-full-width="false"><thead><tr><th width="164">Function Name</th><th width="215">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>ProudChat_Init</td><td>The user's UUID from the <a href="https://console.nettention.com"><strong>Proud Console</strong></a>, the UUID of the project the user created, and the user's own UniqueID.</td><td>You write this part as a function to connect the ChatClient with the server.<br>We're getting 3 strings as parameters, but internally we're calling the <mark style="color:orange;">ChatClientInitComplete</mark>, <mark style="color:orange;">ChatClientJoinFailed</mark> functions so we can see if the login was successful or unsuccessful.</td></tr></tbody></table>

### - Disconnect

<table data-full-width="false"><thead><tr><th width="186">Function Name</th><th width="206">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>Disconnect</td><td>-</td><td>Use when you want to disconnect with the chat server.</td></tr></tbody></table>

### - Function

<table data-full-width="false"><thead><tr><th width="204">Function Name</th><th width="317">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>IsConnected</td><td>-</td><td>Use when you check the status of server connection.</td></tr><tr><td>Join_Channel</td><td>Unique key for the channel you want to access</td><td>Use when you want to access a specific channel.</td></tr><tr><td>Leave_Channel</td><td>Unique key for the channel you want to leave</td><td>Use this when you want to leave the channel you're in.</td></tr><tr><td>Send_Direct_Msg</td><td>A unique identification value for a specific recipient, a message to send to the specific party</td><td>Use to send a message to a specific person.</td></tr><tr><td>Send_Channel_Msg</td><td>A unique identification value for a specific channel, a message to send to the specific channel</td><td>Use to send a message to a specific channel.</td></tr><tr><td>MsgTranslate</td><td><p>src = The country code of current language</p><p>target = The country code of the targeting language</p><p>msgKey = A unique key of message to translate</p><p>msg = A message to translate</p></td><td>(Beta) Use when you want to translate the message</td></tr><tr><td>MsgTranslate_Auto</td><td><p>target = The country code of the targeting language</p><p>msgKey = A unique key of message to translate </p><p>msg = A message to translate</p></td><td>(Beta) Request the translation of the message after automatically detecting the language.</td></tr><tr><td>MsgRecord_Channel</td><td>channelKey = A unique key of the channel<br>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the chat data from the Channel. <br>Retrieve up to 100 messages within the last 90 days.</td></tr><tr><td>MsgRecord_Direct</td><td>target = A unique key of the target user<br>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the data from the Direct messages.<br>Retrieve up to 100 messages within the last 90 days.</td></tr><tr><td>MsgRecord_Notice</td><td>day = The days (max 90)<br>cnt = The counts (max 100)</td><td>(Beta) Request the data from the Notice.<br>Retrieve up to 100 messages within the last 90 days.</td></tr></tbody></table>

### - Event Variables

<table data-full-width="false"><thead><tr><th width="311">Event function name</th><th>Description</th></tr></thead><tbody><tr><td>m_ClientInitComplete_Event</td><td>Event fired when ChatClient completes <mark style="color:orange;">Init</mark>.</td></tr><tr><td>m_ClientInitFailed_Event</td><td>Event fired when ChatClient <mark style="color:orange;">Init Failed</mark> occurs.</td></tr><tr><td>m_ChatDisconnect_Event</td><td>Event fired when the chat server <mark style="color:orange;">disconnected</mark>. </td></tr><tr><td>m_DirectMsg_Response_Event</td><td>It handles events if the <mark style="color:orange;">DirectMsg</mark> arrives between users.</td></tr><tr><td>m_ChannelMsg_Response_Event</td><td>It handles events that occur if a <mark style="color:orange;">ChannelMsg</mark> arrives.</td></tr><tr><td>m_Notice_Response_Event</td><td>It will be called when you send <mark style="color:orange;">Notice</mark> from Proud Console.</td></tr><tr><td>m_Channel_Join_Success_Event</td><td>It will be called if <mark style="color:orange;">Channel Join Success</mark> occurs.</td></tr><tr><td>m_Channel_Join_Failed_Event</td><td>It will be called if <mark style="color:orange;">Channel Join Failed</mark> occurs.</td></tr><tr><td>m_Channel_Leave_Success_Event</td><td>It will be called if <mark style="color:orange;">Channel Leave Success</mark> occurs.</td></tr><tr><td>m_Channel_Leave_Failed_Event</td><td>It will be called if <mark style="color:orange;">Channel Leave Failed</mark> occurs.</td></tr><tr><td>m_Msg_Translate_Success_Event</td><td>(Beta) It will be called if the message is successfully translated.</td></tr><tr><td>m_Msg_Translate_Failed_Event</td><td>(Beta) It will be called if the message translation fails.</td></tr><tr><td>m_Msg_Record_Success_Event</td><td>(Beta) It will be called if the data history is successfully retrieved.</td></tr><tr><td>m_Msg_Record_Failed_Event</td><td>(Beta) It will be called if the data history retrieval fails.</td></tr></tbody></table>

## Building

### - Android

{% hint style="success" %}
See [**Selecting plugins in the Stripped folder**](/proudnet.eng/proudnet/2.setting/unity3d.md#stripped).&#x20;
{% endhint %}

### - iOS

{% hint style="success" %}
For more information, see [**Building iOS**](/proudnet.eng/proudnet/2.setting/unity3d/ios-build.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.proudnet.com/proudnet.eng/proud_service/proudchat/download/unity3d.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
