Headless Fusion Sample is a Unity sample package for dealing with headless server instances for the Photon Fusion networking package.
This repository uses some code from the official Photon Fusion Headless Server sample, which you can find here, and extends this with a terminal to product output.
- Pull the repo
- Create an application ID for Fusion on the Photon Dashboard
- Open in Unity
- Install the latest version of Fusion and import into the project
- Navigate to
Fusion > Fusion Hub
and set up Fusion by pasting in your application ID
To run a server instance:
- Open the
Bootstrap
scene, enable theServer Bootstrap
gameobject and disable theClient Bootstrap
gameobject - Navigate to
File > Build Settings
and addBootstrap
scene to theScenes in Build
field - Click
Build
and select a destination
When running the server build, you will need a batch file in order to pass parameters to the application. This is a template script you can use to get the bare minimum working.
@echo off
"./Headless Fusion Example.exe" -batchmode -nographics
pause
You can make use of these arguments in the application through the static HeadlessUtils
class, like so:
var scene = HeadlessUtils.GetArg("-scene");
If you run into any issues setting up the project, please feel free to open up an issue.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.