mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-04-27 11:10:34 +02:00
Added IPunObservable
This commit is contained in:
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 windDirValue;
|
||||
@ -218,4 +218,17 @@ public void ExtractDataFromJson(string json)
|
||||
int index = (int)Math.Floor((degrees + 11.25) / 22.5);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user