易于使用的高性能 Unity 3d 网络库
Mirage is a high-level networking library for Unity. It's modular, performant, and designed to be easy to use, whether you're building an MMO, a co-op game, or an FPS.
Mirage is battle-tested in released games and built with security in mind, with many tools to help prevent multiplayer exploits.
Mirage is open source. Bug reports and feedback are welcome, either open an issue on Github or join the Discord.
…To install Mirage, follow these steps:
Mirage requires at least Unity 2022 LTS. You may install Unity 2022 LTS via the Unity website or via the Unity Hub.
You may use newer versions, however, LTS versions are strongly recommended as newer versions can contain bugs, glitches, or just flat-out break game projects.
Start a new project or open your existing one. If opening an existing one, it is strongly recommended to back it up before installing Mirage.
Add the OpenUPM registry. Click on the Edit menu, then select Project settings..., select Package Manager, and add a scoped registry like so:
Name: OpenUPM
Url: https://package.openupm.com
Scopes:
com.cysharp.unitaskcom.openupmcom.miragenetcom.miragenet.mirageClose the project settings.
Open the package manager by clicking on the Window menu and selecting Package Manager. Then select Packages, My Registries, select the latest version of Mirage and click install, like so:
You may come back to the package manager at any time to uninstall Mirage or upgrade it.
If you prefer to install a specific version or hash directly from GitHub, you can add the following line to your Packages/manifest.json file under the dependencies section:
"com.miragenet.mirage": "https://github.com/MirageNet/Mirage.git?path=/Assets/Mirage#v156.2.4",If you've got a project already using Mirror and you want to migrate it to Mirage, it's recommended to check out our Migration Guide for a smooth transition. Also check the heading below, as there are some major differences between Mirage and the other network library.
Mirage is a hard fork of Mirror, with many added features, performance improvements, and security improvements.
| Mirage | Mirror |
|---|---|
| Installs via Package Manager (OpenUPM or GitHub URL) | Installs from the Unity Asset Store |
| Errors are thrown as exceptions | Errors are logged |
[ServerRpc] |
[Command] |
[ClientRpc(target = RpcTarget.Owner)] |
[TargetRpc] |
| Events: listen from any script, no central manager | Override methods: large NetworkManager class with single overrides |
| Follows C# code style and conventions | No consistency |
NetworkTime available in NetworkBehaviour |
NetworkTime is global static |
| Send any data as messages | Messages must implement NetworkMessage |
| Structured SocketLayer with consistent connection flow for all transports | Each transport implements its own connection logic |
Some notable features that Mirage has:
Mirage is built upon fundamental pillars:
If you want to contribute to Mirage, follow these steps:
git clone https://github.com/MirageNet/Mirage.gitgit clone -c core.symlinks=true https://github.com/MirageNet/Mirage.gitMirage supports multiple ways of transporting data:
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureThe team will review it ASAP and give it the stamp of approval, ask for changes or decline it with a detailed explanation.
Thank you for using Mirage and we hope to see your project be successful!
暂无开放 Issues,或尚未同步最近议题。