|
1 |
| -# Guide-UnitySteamNetcodeGameObjects |
2 |
| -Code for using <em>Steamworks Network/Facepunch</em> solution with <em>Unity Netcode For GameObjects/MLAPI</em> |
| 1 | + |
3 | 2 |
|
4 |
| -# How To Install |
| 3 | +<div align="center"> |
| 4 | + |
| 5 | +[](https://github.com/mrrobinofficial/unreal-commonvehicle/blob/HEAD/LICENSE.txt) |
| 6 | + |
5 | 7 |
|
6 |
| -[Install first Unity Netcode For GameObjects](https://docs-multiplayer.unity3d.com/netcode/current/installation/install)<br/> |
7 |
| -[Then install Facepunch Transport](https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports/com.community.netcode.transport.facepunch) Or [Copy this git command and paste in Package Manager](https://github.com/Unity-Technologies/multiplayer-community-contributions.git?path=/Transports/com.community.netcode.transport.facepunch)<br/> |
8 |
| -[Then you have wiki page for getting started](https://wiki.facepunch.com/steamworks/)<br/> |
| 8 | +</div> |
9 | 9 |
|
10 |
| -# How To Use It: |
| 10 | +# |
| 11 | + |
| 12 | +<center> |
| 13 | + <p> |
| 14 | + <i> |
| 15 | + This repo is a comprehensive repository designed to help users quickly and effectively get started with Unity's multiplayer solutions using Facepunch as the transport layer and Unity's Netcode For GameObjects framework. |
| 16 | + </i> |
| 17 | + </p> |
| 18 | +</center> |
| 19 | + |
| 20 | +## ⚙️ Before you begin |
| 21 | + |
| 22 | +Netcode supports the following versions: |
| 23 | + |
| 24 | +* Unity 2021.3 and later |
| 25 | +* Mono and IL2CPP Scripting Backends |
| 26 | + |
| 27 | +Netcode supports the following platforms: |
| 28 | + |
| 29 | +* Windows, macOS, and Linux |
| 30 | +* iOS and Android |
| 31 | +* XR platforms running on Windows, Android, and iOS operating systems |
| 32 | + |
| 33 | +You can read more about **Unity Multiplayer Networking** docs [here](https://docs-multiplayer.unity3d.com/). |
| 34 | + |
| 35 | +## ⚒️ How to Install |
| 36 | + |
| 37 | +If you haven't install Unity Netcode For GameObjects, then do so via this [link](https://docs-multiplayer.unity3d.com/netcode/current/installation/install). |
| 38 | + |
| 39 | +Then install [Facepunch Transport](https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports/com.community.netcode.transport.facepunch) layer. |
| 40 | + |
| 41 | +Or copy this git command and paste in Package Manager: |
| 42 | + |
| 43 | +```console |
| 44 | +https://github.com/Unity-Technologies/multiplayer-community-contributions.git?path=/Transports/com.community.netcode.transport.facepunch |
| 45 | +``` |
| 46 | + |
| 47 | +Then you have [wiki page](https://wiki.facepunch.com/steamworks/) for API and more documentation code. |
| 48 | + |
| 49 | +## 📝 How To Use It |
11 | 50 |
|
12 | 51 | You need to assign SteamId to FacepunchTransport
|
13 | 52 |
|
14 |
| -```c# |
15 |
| -private void HandleTransport(SteamId id) => NetworkManager.Singleton.GetComponent<FacepunchTransport>().targetSteamId = id; |
| 53 | +```csharp |
| 54 | +private void HandleTransport(SteamId id) |
| 55 | +{ |
| 56 | + // Lorem Ipsum |
| 57 | + NetworkManager.Singleton.GetComponent<FacepunchTransport>().targetSteamId = id; |
| 58 | +} |
16 | 59 | ```
|
17 | 60 |
|
18 | 61 | By using callback from steam, you can send that information to FacepunchTransport
|
19 |
| -```c# |
20 |
| - |
21 |
| -private void Start() => SteamFriends.OnGameLobbyJoinRequested += OnGameLobbyJoinRequested; // Add the callback |
| 62 | +```csharp |
| 63 | +private void Start() |
| 64 | +{ |
| 65 | + SteamFriends.OnGameLobbyJoinRequested += OnGameLobbyJoinRequested; // Add the callback |
| 66 | +} |
22 | 67 |
|
23 |
| -private void OnDestroy() => SteamFriends.OnGameLobbyJoinRequested -= OnGameLobbyJoinRequested; // Remove the callback |
| 68 | +private void OnDestroy() |
| 69 | +{ |
| 70 | + SteamFriends.OnGameLobbyJoinRequested -= OnGameLobbyJoinRequested; // Remove the callback |
| 71 | +} |
24 | 72 |
|
25 |
| -private void OnGameLobbyJoinRequested(Lobby lobby, SteamId id) => HandleTransport(id); |
| 73 | +private void OnGameLobbyJoinRequested(Lobby lobby, SteamId id) |
| 74 | +{ |
| 75 | + HandleTransport(id); |
| 76 | +} |
26 | 77 | ```
|
27 | 78 |
|
28 |
| -After you got the callbacks and also changing "targetSteamId" in FacepunchTransport, is pretty much the same stuff with Unity Netcode For GameObjects.<br/> |
29 |
| -[Highly recommend watching DapperDino's playlist over Unity Netcode For GameObjects](https://www.youtube.com/playlist?list=PLS6sInD7ThM2_N9a1kN2oM4zZ-U-NtT2E) |
| 79 | +After you got the callbacks and also changing `targetSteamId` in `FacepunchTransport`, is pretty much the same stuff with Unity Netcode For GameObjects. |
| 80 | + |
| 81 | +Highly recommend watching [DapperDino's playlist](https://www.youtube.com/playlist?list=PLS6sInD7ThM2_N9a1kN2oM4zZ-U-NtT2E) over Unity Netcode For GameObjects. |
| 82 | + |
| 83 | +## 🔗 Hepful Links |
30 | 84 |
|
31 |
| -# Helpful links |
| 85 | +* [Multiplayer Community Contributions](https://github.com/Unity-Technologies/multiplayer-community-contributions/) |
| 86 | +* [Facepunch Transport for Netcode for GameObjects](https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports/com.community.netcode.transport.facepunch) |
| 87 | +* [Facepunch Wiki Page](https://wiki.facepunch.com/steamworks/) |
| 88 | +* [Steamworks API](https://partner.steamgames.com/doc/api) |
| 89 | +* [DapperDino's playlist over Unity Netcode For GameObjects](https://www.youtube.com/playlist?list=PLS6sInD7ThM2_N9a1kN2oM4zZ-U-NtT2E) |
32 | 90 |
|
33 |
| -[Link to Multiplayer Community Contributions](https://github.com/Unity-Technologies/multiplayer-community-contributions/)<br/> |
34 |
| -[Link to Facepunch Transport for Netcode for GameObjects](https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports/com.community.netcode.transport.facepunch)<br/> |
35 |
| -[Link to Facepunch Wiki Page](https://wiki.facepunch.com/steamworks/)<br/> |
36 |
| -[Link to Steamworks API](https://partner.steamgames.com/doc/api)<br/> |
37 |
| -[Link to DapperDino's playlist over Unity Netcode For GameObjects](https://www.youtube.com/playlist?list=PLS6sInD7ThM2_N9a1kN2oM4zZ-U-NtT2E) |
| 91 | +## 🆘 Support |
| 92 | +If you have any questions or issue, just write either to my [YouTube channel](https://www.youtube.com/@mrrobinofficial), [Email](mailto:mrrobin123mail@gmail.com) or [Twitter DM](https://twitter.com/MrRobinOfficial). |
0 commit comments