# Mirror Pong

Découvrez comment héberger des projets Unity sur Edgegap en utilisant des techniques du [Exemple Mirror Pong](https://mirror-networking.gitbook.io/docs/manual/examples/pong).

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

## ✔️ Préparation

Avant de commencer, vous aurez besoin de :

* Unity 6 - [télécharger via Unity Hub](https://unity.com/releases/unity-6),
* Package Mirror pour Unity - [télécharger depuis l'Asset Store Unity](https://assetstore.unity.com/packages/tools/network/mirror-129321),
  * ce package inclut l'exemple Pong.

Créez un nouveau projet et importez le package Mirror ci‑dessus.

## ⚡ Déployer et se connecter

### 1. Déployer un serveur sur Edgegap

☑️ Pour commencer, vous devrez [créer un compte gratuit chez Edgegap](https://app.edgegap.com/auth/register). Aucune carte de crédit requise.

☑️ [Créez une nouvelle version d'application pour votre application](https://app.edgegap.com/application-management/applications/mirror-pong-sample/versions/create), choisissez Mirror Pong Sample.

☑️ [Déployez un serveur avec la version de votre application Mirror Pong Sample](https://app.edgegap.com/deployment-management/deployments/list).

☑️ [Ouvrez les détails de votre nouveau déploiement](https://app.edgegap.com/deployment-management/deployments/list).

☑️ Trouvez les informations de connexion uniques et à usage unique de votre déploiement :

* **URL de l'hôte** au format `780aa4260e83.pr.edgegap.net` ,
* **Port externe** au format `30854`  (5 chiffres).

✅ Vous pouvez maintenant passer à l'étape suivante.

### 2. Se connecter depuis l'Éditeur

☑️ Ouvrez votre nouveau projet dans Unity.

☑️ Ouvrez la scène dans le dossier Mirror / Examples / Pong / Scenes / MirrorPong.unity.

☑️ Appuyez sur le bouton ▶️ Play pour lancer votre client de jeu.

☑️ Saisissez les informations de connexion de l'étape précédente.

☑️ Appuyez sur le bouton Client pour vous connecter à votre serveur.

☑️ Connectez un deuxième joueur virtuel avec [Multiplayer Play Mode](https://docs-multiplayer.unity3d.com/mppm/current/about/) ou [ParrelSync](https://github.com/VeriorPies/ParrelSync).

🙌 Félicitations pour votre premier déploiement sur Edgegap !

## ✏️ Personnaliser la build du serveur

{% hint style="success" %}
Voir [Unity](/docs.edgegap.com-fr/unity.md) pour Unity afin de **apprendre comment construire et personnaliser des serveurs**.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.edgegap.com/docs.edgegap.com-fr/docs/sample-projects/unity-netcodes/mirror-pong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
