mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-05-10 18:10:35 +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 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user