Answers for "sending data photon c#"

C#
1

sending data photon c#

void OnPhotonSerializeView(PhotonStream stream,PhotonMessageInfo info)
{
	if (stream.isWriting)
	{
		//We own this player: send the others our data
		stream.SendNext((int)controllerScript._characterState);
		stream.SendNext(transform.position);
		stream.SendNext(transform.rotation);
	}
	else
	{
		//Network player, receive data
		controllerScript._characterState = (CharacterState)(int)stream.ReceiveNext();
		correctPlayerPos = (Vector3)stream.ReceiveNext();
		correctPlayerRot = (Quaternion)stream.ReceiveNext();
	}
}
Posted by: Guest on June-10-2020

Code answers related to "sending data photon c#"

C# Answers by Framework

Browse Popular Code Answers by Language