An open API service indexing awesome lists of open source software.

https://github.com/khaled71612000/photon-unity

Photon Unity is a project that demonstrates the integration of Photon with Unity for developing multiplayer games
https://github.com/khaled71612000/photon-unity

photon unity

Last synced: about 1 month ago
JSON representation

Photon Unity is a project that demonstrates the integration of Photon with Unity for developing multiplayer games

Awesome Lists containing this project

README

          

# Photon Unity

![Unity](https://img.shields.io/badge/Unity-000000?logo=unity&logoColor=white)
![C#](https://img.shields.io/badge/C%23-239120?logo=c-sharp&logoColor=white)
![License](https://img.shields.io/badge/license-MIT-green)

**Photon Unity** is a project that demonstrates the integration of Photon with Unity for developing multiplayer games. This project showcases how to use Photon to manage networked game sessions and synchronize player data across multiple clients.

## Key Components

### Scripts
- **NetworkManager.cs:** Manages network connections and session handling.
- **PlayerController.cs:** Manages player movements and interactions, synchronizing them across the network.

## Features

- **Multiplayer Integration:** Utilizes Photon for creating multiplayer game sessions.
- **Network Synchronization:** Ensures player data is synchronized across all connected clients.

## Screenshots

![Screenshot 1](https://raw.githubusercontent.com/khaled71612000/Photon-Unity/HEAD/Assets/PUN_Tanks/Prefabs/HealthBar.png)

![Screenshot 2](https://raw.githubusercontent.com/khaled71612000/Photon-Unity/HEAD/Assets/PUN_Tanks/Resources/36633.png)

![Screenshot 3](https://raw.githubusercontent.com/khaled71612000/Photon-Unity/HEAD/Assets/TextMesh Pro/Sprites/EmojiOne.png)

## Architecture

Key classes and systems (from source code):

- **`GameplayManager`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — orchestrates game-wide systems
- **`MainMenuUI`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — drives enemy AI behavior and decision-making — user interface and HUD rendering — Key methods: `OnRoomCreated`, `OnConnectedToServer`, `OnNameUpdated`, `CreateRoom`
- **`NetworkManager`** (extends `MonoBehaviourPunCallbacks`) — Unity component attached to a GameObject — orchestrates game-wide systems — neural network layer / training logic — Key methods: `OnConnectedToMaster`, `OnCreatedRoom`, `OnJoinedRoom`, `OnCreateRoomFailed`
- **`NetworkPlayer`** (extends `MonoBehaviourPun`) — Unity component attached to a GameObject — handles player input, movement, and state — neural network layer / training logic
- **`Bullet`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — Key methods: `OnTriggerEnter`
- **`Healer`** (extends `MonoBehaviour`) — Unity component attached to a GameObject — Key methods: `OnTriggerEnter`, `OnTriggerExit`

## Tech Stack

| Technology | Role |
|---|---|
| Unity 3D | Game engine |
| C# | Gameplay scripting |
| Unity Physics | Rigidbody & collision |
| Git | Version control |

## Getting Started

### Prerequisites
- [Unity Hub](https://unity.com/download) + Unity 2019.4 LTS or higher
- Visual Studio 2019+ or VS Code

### Setup
```bash
git clone https://github.com/khaled71612000/Photon-Unity.git
```
1. Open **Unity Hub** → **Add** → select the cloned folder
2. Open **Assets/Scenes/** → double-click the main scene
3. Press ▶ **Play**