mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-04-26 00:50:34 +02:00
RPC applied to Voltage also
This commit is contained in:
parent
aad7bdc7f1
commit
301d4dee84
@ -68,8 +68,9 @@ public class API : MonoBehaviour
|
||||
{
|
||||
if (isButtonPressed)
|
||||
{
|
||||
Debug.Log("Inside Update");
|
||||
voltageValue.text = webSocketControllerScript.voltageValue.ToString();
|
||||
photonView = PhotonView.Get(this);
|
||||
photonView.RPC("RPC_VoltageUpdate", RpcTarget.All, webSocketControllerScript.voltageValue.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +170,12 @@ public void ExtractDataFromJson(string json)
|
||||
loc.SetText(location);
|
||||
windSpeedValue.SetText(windSpeed);
|
||||
}
|
||||
[PunRPC]
|
||||
public void RPC_VoltageUpdate(String voltageGenerated)
|
||||
{
|
||||
Debug.Log("Voltge generated is - " + voltageGenerated);
|
||||
voltageValue.text = voltageGenerated;
|
||||
}
|
||||
public string GetWindDirection(float degrees)
|
||||
{
|
||||
// Ensure degrees are within the range 0 to 359
|
||||
|
Loading…
x
Reference in New Issue
Block a user