|
1 |
| -# Sysroots |
2 |
| -Contains the repos for both the MLAPI SDK and the UTP transport library |
| 1 | +[](https://mlapi.network/) |
3 | 2 |
|
4 |
| -Contents: |
5 |
| -* com.unity.multiplayer.mlapi -- the MLAPI SDK |
6 |
| -* com.unity.multiplayer.transport.utp -- the MLAPI wrapper for the UTP transport library |
| 3 | +[](https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/releases/latest) |
| 4 | +[](https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/releases) |
| 5 | + |
| 6 | +[](https://forum.unity.com/forums/multiplayer.26/) |
| 7 | +[](https://discord.gg/FM8SE9E) |
| 8 | + |
| 9 | + |
| 10 | +[](https://github.com/MidLevel/MLAPI/blob/master/LICENSE) |
| 11 | +[](https://docs-multiplayer.unity3d.com/) |
| 12 | +[](https://docs-multiplayer.unity3d.com/docs/mlapi-api/introduction) |
| 13 | + |
| 14 | + |
| 15 | +The Unity MLAPI (Mid level API) is a framework that simplifies building networked games in Unity. It offers **low level** access to core networking while at the same time providing **high level** abstractions. The MLAPI aims to remove the repetitive tasks and reduces the network code dramatically, no matter how many of the **modular** features you use. |
| 16 | + |
| 17 | +### Getting Started |
| 18 | +To get started, check the [Multiplayer Docs Site](https://docs-multiplayer.unity3d.com/). |
| 19 | + |
| 20 | +### Community and Feedback |
| 21 | +For general questions, networking advice or discussions about MLAPI, please join our [Discord Community](https://discord.gg/FM8SE9E) or create a post in the [Unity Multiplayer Forum](https://forum.unity.com/forums/multiplayer.26/). |
| 22 | + |
| 23 | +### Compatibility |
| 24 | +The MLAPI supports all major Unity platforms. To use the WebGL platform a custom WebGL transport based on web sockets is needed. |
| 25 | + |
| 26 | +MLAPI is compatible with Unity 2019 and newer versions. |
| 27 | + |
| 28 | +### Development |
| 29 | +We follow the [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). The master branch contains our latest stable release version while the develop branch tracks our current work. |
| 30 | + |
| 31 | +This repository is broken into multiple components, each one implemented as a Unity Package. |
| 32 | +``` |
| 33 | + . |
| 34 | + ├── com.unity.multiplayer.mlapi # The core netcode SDK unity package (source + tests) |
| 35 | + ├── com.unity.multiplayer.transport.utp # Transport wrapper for com.unity.transport experimental package (not currently supported) |
| 36 | + └── testproject # A Unity project with various test implementations & scenes which exercise the features in the above package(s). |
| 37 | +``` |
| 38 | + |
| 39 | +### Contributing |
| 40 | +The MLAPI is an open-source project and we encourage and welcome |
| 41 | +contributions. If you wish to contribute, be sure to review our |
| 42 | +[contribution guidelines](CONTRIBUTING.md) |
| 43 | + |
| 44 | +### Issues and missing features |
| 45 | +If you have an issue, bug or feature request, please follow the information in our [contribution guidelines](CONTRIBUTING.md) to submit an issue. |
| 46 | + |
| 47 | +### Example |
| 48 | +Here is a sample MonoBehaviour showing a chat script where everyone can write and read from. This shows the basis of the MLAPI and the abstractions it adds. |
| 49 | + |
| 50 | +```csharp |
| 51 | +public class Chat : NetworkBehaviour |
| 52 | +{ |
| 53 | + private NetworkList<string> ChatMessages = new NetworkList<string>(new MLAPI.NetworkVariable.NetworkVariableSettings() |
| 54 | + { |
| 55 | + ReadPermission = MLAPI.NetworkVariable.NetworkVariablePermission.Everyone, |
| 56 | + WritePermission = MLAPI.NetworkVariable.NetworkVariablePermission.Everyone, |
| 57 | + SendTickrate = 5 |
| 58 | + }, new List<string>()); |
| 59 | + |
| 60 | + private string textField = ""; |
| 61 | + |
| 62 | + private void OnGUI() |
| 63 | + { |
| 64 | + if (IsClient) |
| 65 | + { |
| 66 | + textField = GUILayout.TextField(textField, GUILayout.Width(200)); |
| 67 | + |
| 68 | + if (GUILayout.Button("Send") && !string.IsNullOrWhiteSpace(textField)) |
| 69 | + { |
| 70 | + ChatMessages.Add(textField); |
| 71 | + textField = ""; |
| 72 | + } |
| 73 | + |
| 74 | + for (int i = ChatMessages.Count - 1; i >= 0; i--) |
| 75 | + { |
| 76 | + GUILayout.Label(ChatMessages[i]); |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +### License |
| 84 | +[MIT License](LICENSE) |
0 commit comments