UniPlayer : UniClient

UniClient is the base code for all players and allows synchronization of all players without additional code.
to synchronize correctly the positions it is necessary to put the script PlayerMovement only on the local player.

Client and Server :

Filed

ushort Id

identifier on the network

bool IsLocal

Allows to know if this player is controlled by the same device.

int IdPlatform

Allows to know the platform of the device to know if it is a player or a spectator. which is linked to this enum

(int)RuntimePlatform.Android

or

(int)RuntimePlatform.*
int health

Allows to know the life of the player.

int color

Allows to know the color of the player's team.

Client :

Method

protected override IEnumerator FadeOut()

Called when the player leaves an object (executed on all clients)

protected override IEnumerator FadeIn()

Called when the player enters an object (executed on all clients)

public override void SwapColor(int matt)

Called when the player must change color (execute on all clients)