Added IPunObservable

This commit is contained in:
Abdul Mukheem Shaik 2024-05-27 22:54:33 +02:00
parent 57e294e7d1
commit 0d5b150456

@ -38,7 +38,7 @@ public class ApiResponse
} }
public class API : MonoBehaviour public class API : MonoBehaviourPunCallbacks, IPunObservable
{ {
public TextMeshProUGUI voltageValue; public TextMeshProUGUI voltageValue;
public TextMeshProUGUI windDirValue; public TextMeshProUGUI windDirValue;
@ -218,4 +218,17 @@ public void ExtractDataFromJson(string json)
int index = (int)Math.Floor((degrees + 11.25) / 22.5); int index = (int)Math.Floor((degrees + 11.25) / 22.5);
return directions[index]; return directions[index];
} }
void IPunObservable.OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.IsWriting)
{
stream.SendNext(turn_WT_on_Y_Axis);
}
else
{
turn_WT_on_Y_Axis = (bool)stream.ReceiveNext();
}
}
} }