> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/ru/docs/sample-projects/unity-netcodes/mirror-pong.md).

# Mirror Pong

Изучите, как размещать проекты Unity на Edgegap, используя методы из [Образец Mirror Pong](https://mirror-networking.gitbook.io/docs/manual/examples/pong).

{% embed url="<https://youtu.be/bvBkObGLTMk>" %}

## ✔️ Подготовка

Прежде чем начать, вам потребуется:

* Unity 6 - [скачать с помощью Unity Hub](https://unity.com/releases/unity-6),
* Пакет Mirror для Unity - [скачать из Unity Asset Store](https://assetstore.unity.com/packages/tools/network/mirror-129321),
  * в этот пакет включён пример Pong.

Создайте новый проект и импортируйте вышеуказанный пакет Mirror.

## ⚡ Развертывание и подключение

### 1. Разверните сервер на Edgegap

☑️ Чтобы начать, вам нужно [создать бесплатную учетную запись на Edgegap](https://app.edgegap.com/auth/register). Кредитная карта не требуется.

☑️ [Создайте новую версию приложения для вашего приложения](https://app.edgegap.com/application-management/applications/mirror-pong-sample/versions/create), выберите Mirror Pong Sample.

☑️ [Разверните сервер с версией вашего приложения Mirror Pong Sample](https://app.edgegap.com/deployment-management/deployments/list).

☑️ [Откройте сведения о новом развертывании](https://app.edgegap.com/deployment-management/deployments/list).

☑️ Найдите уникальные одноразовые данные для подключения к вашему развертыванию:

* **URL хоста** в формате `780aa4260e83.pr.edgegap.net` ,
* **Внешний порт** в формате `30854`  (5 цифр).

✅ Теперь вы можете перейти к следующему шагу.

### 2. Подключение из редактора

☑️ Откройте ваш новый проект в Unity.

☑️ Откройте сцену в папке Mirror / Examples / Pong / Scenes / MirrorPong.unity.

☑️ Нажмите кнопку ▶️ Play, чтобы запустить клиент игры.

☑️ Введите данные для подключения из предыдущего шага.

☑️ Нажмите кнопку Client, чтобы подключиться к вашему серверу.

☑️ Подключите второго виртуального игрока с помощью [Multiplayer Play Mode](https://docs-multiplayer.unity3d.com/mppm/current/about/) или [ParrelSync](https://github.com/VeriorPies/ParrelSync).

🙌 Поздравляем с вашим первым развертыванием на Edgegap!

## ✏️ Настроить сборку сервера

{% hint style="success" %}
См. [Unity](/ru/unity.md) для Unity, чтобы **узнать, как собирать и настраивать серверы**.
{% 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.edgegap.com/ru/docs/sample-projects/unity-netcodes/mirror-pong.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.
