mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-05-08 07:20: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)
|
if (isButtonPressed)
|
||||||
{
|
{
|
||||||
Debug.Log("Inside Update");
|
photonView = PhotonView.Get(this);
|
||||||
voltageValue.text = webSocketControllerScript.voltageValue.ToString();
|
photonView.RPC("RPC_VoltageUpdate", RpcTarget.All, webSocketControllerScript.voltageValue.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,6 +170,12 @@ public void ExtractDataFromJson(string json)
|
|||||||
loc.SetText(location);
|
loc.SetText(location);
|
||||||
windSpeedValue.SetText(windSpeed);
|
windSpeedValue.SetText(windSpeed);
|
||||||
}
|
}
|
||||||
|
[PunRPC]
|
||||||
|
public void RPC_VoltageUpdate(String voltageGenerated)
|
||||||
|
{
|
||||||
|
Debug.Log("Voltge generated is - " + voltageGenerated);
|
||||||
|
voltageValue.text = voltageGenerated;
|
||||||
|
}
|
||||||
public string GetWindDirection(float degrees)
|
public string GetWindDirection(float degrees)
|
||||||
{
|
{
|
||||||
// Ensure degrees are within the range 0 to 359
|
// Ensure degrees are within the range 0 to 359
|
||||||
|
Loading…
x
Reference in New Issue
Block a user