PlayerCreatorUtilities
It is a helper class that performs operations related to creating the player object or changing the existing object.
Member
private static MonoBehaviorHook _monoBehaviorHook;
Stores monobehaviour to use coroutine operations
Methods
Parameters
conn: Owner of the player to be created or replaced
prefab: Prefab of the object to be created
onCompleted: action called when creation or replace is complete
If the identitiy value of the connecti is not null, it means that the player object exists and calls the replace method.
If null, it calls the CreatePlayer method.
Paramters
conn: Owner of the player to be created
prefab: Prefab of the object to be created
onCompleted: action called when creation is complete
Returns connection if it is not connected to the client.
Creates the player object with the spawnPlayer method.
then add it to the connection as player.
After these operations, onCompleted action is triggered.
Paramters
conn: Owner of the player to be replaced
prefab: Prefab of the object to be created
onCompleted: action called when replace is complete
It first calls the removePlayer function.
When the player deletion process is completed, it creates the player with the CreatePlayer method.
Paramters
conn: Owner of the player to be created
Removes and deletes the connection's player object from the connection
Paramters
conn: Owner of the player to be created
prefab: Prefab of the object to be created
Gets the room information of the connection.
If it is in the room and the room has a scene, it creates the object for that scene.
If it doesn't exist, it creates it for the currently active scene.
Returns if monoBehaviourHook is not null.
If it is null, it creates a new object and performs donDestroyOnLoad.
Then, it adds the MonoBehaviorHook script to the object and assigns it to the variable.
Last updated