latestWD and LatestWS are now serialised on PUN

Co-Authored-By: ZeinabBF <145973209+ZeinabBF@users.noreply.github.com>
This commit is contained in:
Abdul Mukheem Shaik 2024-05-28 03:21:54 +02:00
parent 36fdae0a6d
commit ace58ebb95

@ -8,7 +8,7 @@ using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using WebSocketSharp;
using System.Linq;
//https://github.com/GlitchEnzo/NuGetForUnity
// Creating the data structure according to the expected Json
[Serializable]
@ -186,6 +186,8 @@ public void ExtractDataFromJson(string json)
[PunRPC]
public void RPC_GreenButtonClick(String windDirection,String locationTemperature,String location,String windSpeed,bool turn_WT_on_Y_Axis_val)
{
latestWD = float.Parse(windDirection);
latestWS = float.Parse(windSpeed);
Debug.Log("Latest WS is - " + windSpeed);
windDirValue.SetText(windDirection);
temperatureValue.SetText(locationTemperature);