HowToUsePlugin.md
Table of Contents
Installation Instructions
1. Import Unity Package
Import the DiarkisUnityPlugin.unitypackage
into the target project.
2. Configure Connection Information
Select Assets/Diarkis/Prefabs/DiarkisNetworkManager
, and display the DiarkisNetworkManager
script in the Inspector.
Then, click on the item labeled Transport
to show its contents and configure the connection information with Diarkis as follows:
3. Place the Prefab in the Scene
Place the configured DiarkisNetworkManager
prefab into the scene.
Verify that AutoStartConnect
is checked (it's on by default), and click the play button at the top of the editor.
This will automatically start the connection to the Diarkis server.
How to Use the Plugin
How to Configure DiarkisNetworkManager Prefab
DiarkisNetworkManager
is a crucial class for connecting with Diarkis and must be placed in the scene.
Important configuration items include:
Request to Connect & Disconnect from the Network
To connect (or disconnect) to the Diarkis network, call functions via DiarkisNetworkManager
.
Receive Responses for Network Connect & Disconnect
You can receive responses from the server as events.
First, add a component to the scene to trigger events.
Add an appropriate GameObject
to the scene and attach the DiarkisCoreEventCallback
component to it.
You can register functions with this component, which will trigger in response to events.
Create a class to register functions as follows:
Attach this script to an appropriate GameObject
, and register the desired function to be called during an event in DiarkisCoreEventCallback
.
Thus, you can receive responses from the server.
Use Various Modules
Diarkis contains the following modules:
To send data, call the corresponding functions of various modules.
To receive data, place a corresponding event component in the scene and register functions with it.
Here is an example of how to create a new room using the Room
module.
Send Requests via Room Module
The following code creates a new room using the Room
module.
Receive Responses from Room Module
First, attach DiarkisRoomEventCallback
to an appropriate GameObject
in the scene.
Next, create a class to receive events as follows:
Finally, place this script in the scene and register the function in OnRoomCreate
of DiarkisRoomEventCallback
.
This way, you can receive the result when calling Room.Create
.
Here, the Room
module was taken as an example, but the usage is similar for other modules.
Reference for Each Feature
Core Features
List of Properties (Core)
List of Methods (Core)
List of Events (Core)
Features Related to Room
List of Properties (Room)
List of Methods (Room)
List of Events (Room)
Features Related to Group
List of Properties (Group)
List of Methods (Group)
List of Events (Group)
Features Related to Field
List of Properties (Field)
List of Methods (Field)
List of Events (Field)
Features Related to MatchMaker
List of Properties (MatchMaker)
List of Methods (MatchMaker)
List of Events (MatchMaker)
Features Related to P2P
List of Properties (P2P)
List of Methods (P2P)
List of Events (P2P)
Last updated