This plugin has been tested, and supports Unity versions 2021.3.0f1+, including all LTS releases, and Unity 6.
- Avoid Unity Package Manager caching bugs when updating your plugin.
- Requirement: functioning git client installed, for example git-scm.
- Open your Unity project,
- Select toolbar option Window -> Package Manager,
- Click the + icon and select Add package from git URL...,
- Input the following URL
https://github.com/edgegap/edgegap-server-nakama-plugin-unity.git, - Click Add and wait for the Unity Package Manager to complete the installation.
- Slightly easier as no git client is required.
- Installing our plugin this way will require you to manually replace plugin contents and wipe local cache if you wish to update it,
- The newtonsoft package (dependency) version required may not be compatible with your project if you're already using an older version of this package.
- Select toolbar option Window -> Package Manager,
- Click the + icon and select Add package by name...,
- Input the name
com.unity.nuget.newtonsoft-jsonand wait for the Unity Package Manager to complete the installation., - Back to this github project - make sure you're on the
mainbranch, - Click <> Code, then Download ZIP,
- Paste the contents of the unzipped archive in your
Assetsfolder within Unity project root.
This is the only official distribution channel for this SDK, do not trust unverified sources!
To take full advantage of our hosting service, you will need to Create an Edgegap Free Tier account.
- Find this package in Unity Package Manager window.
- Open the
Samplestab. - Click on Import next to Simple Handler Example.
- Locate sample files in your project
Assets/Samples/Edgegap Server Nakama Plugin/{version}/Simple Handler Example. - Create an Empty GameObject in your scene and attach
SimpleHandlerExample.csscript. - optional: configure
Authentication Tokenvalues Inspector UI.
Call methods AddUser and RemoveUser whenever a player connects or disconnects to manage allocations on Nakama.
Deploying servers with our Official Nakama Plugin will automatically inject some important data.
The following Environment Variables will be available in the Dedicated Game Server:
NAKAMA_CONNECTION_EVENT_URL(url to send connection events of the players)NAKAMA_INSTANCE_EVENT_URL(url to send instance event actions)NAKAMA_INSTANCE_METADATA(contains create metadata JSON)
Both Connection and Instance events are automated when using this SDK, assuming you integrated AddUser and RemoveUser methods in your code.
Visual Studio shows
type or namespace name could not be foundfor Edgegap namespace.
- In your Unity Editor, navigate to Edit / Preferences / External Tools / Generate .csproj files.
- Make sure you have enabled Git packages.
- Click Regenerate project files.
This section is only for developers working on this plugin or other plugins interacting / integrating this plugin.
This project uses CSharpier code formatter to ensure consistent and readable formatting, configured in /.config/dotnet-tools.json.
See Editor integration for Visual Studio extensions, optionally configure Reformat with CSharpier on Save under Tools | Options | CSharpier | General. You may also configure running formatting as a pre-commit git hook.