This document is about: FUSION 2
SWITCH TO

このページは編集中です。更新が保留になっている可能性があります。

Setup

Topology
SHARED AUTHORITY

This Addon is for Fusion 2.1.x. It does not support Fusion 2.0.x.

Download Plugin SDK

The SDK is available on the Overview page.

Installation

SDK Setup

  1. (Windows only) Unblock FusionPluginSDK-x.x.x.zip by right-click > Properties > Unblock before unzipping it.
  2. Unzip the archive into a folder inside or next to the Fusion Unity project

MyFusionProject
├─Assets
├─Library
├─..
└─PluginSDK
    
Or

MyFusionProject
├─Assets
├─Library
└─..
PluginSDK
    
  1. Place your .license file in Fusion.Plugin.Custom/Config/. Without it, the server will log a license error and refuse to start games.

Unity Setup

  1. Inside your Unity project, create a FusionPluginProjectSettings asset via right-click > Create > Fusion > Plugin Project Settings.
  2. Set the Plugin SDK Path field to the directory you extracted the SDK into in the previous step.
FusionPluginProjectSettings inspector
The `FusionPluginProjectSettings` inspector — central control for plugin export and local server runs.
  1. Press Export. It should complete without errors.
  2. Press Build and Run. This builds your custom plugin and starts the local PhotonServer with your plugin loaded in a new terminal window.
  3. To get your game to connect to the local server, open PhotonAppSettings and set the server IP address to 127.0.0.1.
PhotonAppSettings configured for the local server
Point `PhotonAppSettings` at `127.0.0.1` so the client connects to the local PhotonServer instead of the cloud.
  1. Run your game and connect. You should see a log line like the following in the server's terminal window:
15:01:58.317 [Plugin.Custom] [8 ] INFO  - adding player [Player:1]

IDE Setup

The Build and Run button is convenient but obscures the underlying C# solution. To work on the plugin code directly, open the solution file at PluginSDK/Fusion.Plugin.Custom.sln — either by opening it from your file explorer, or via the Open Plugin Project button in the FusionPluginProjectSettings inspector.

Once the solution is open in your IDE, you can launch the server and plugin straight from the IDE's run/debug button — there's no need to come back to Unity and press Build and Run. This is also the path for attaching a debugger, setting breakpoints, and inspecting plugin state at runtime.

SDK structure

Inside the extracted SDK you'll find:

Directory Description
Fusion.Plugin.Custom/ Custom plugin project — your core plugin code lives here.
Fusion.Plugin.Types/ Generated types and embedded NetworkObject database — extensions to exported types live here.
Lib/ Prebuilt Fusion runtime binaries (Debug and Release).
Photon.Server/ Local Photon Server used for development.
Fusion.Plugin.Custom.sln Top-level solution. Open this in your IDE.

After any change in Unity to networked types or assets (prefabs, scenes, scriptable objects) that the plugin needs to see, press Export again. The plugin works against a snapshot taken at export time.

Next steps

You now have a custom plugin running and connected. To extend it with game-specific behaviour — overriding server-side callbacks, intercepting RPCs, making properties plugin-authoritative, baking custom data in from Unity — see Features.

Back to top