mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-04-14 04:30:35 +02:00
Changed Voltage size and fixed issues with windspeed GUI
This commit is contained in:
parent
d42ebc1e38
commit
aad7bdc7f1
Assets
@ -14,8 +14,8 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
targetDeviceTypes: 030000000200000004000000
|
||||
allowOptional3DofHeadTracking: 0
|
||||
handTrackingSupport: 0
|
||||
handTrackingFrequency: 0
|
||||
handTrackingSupport: 1
|
||||
handTrackingFrequency: 1
|
||||
handTrackingVersion: 2
|
||||
anchorSupport: 1
|
||||
sharedAnchorSupport: 2
|
||||
|
@ -897,7 +897,6 @@ GameObject:
|
||||
- component: {fileID: 4890728644967733177}
|
||||
- component: {fileID: 4890728644967733180}
|
||||
- component: {fileID: 4890728644967733183}
|
||||
- component: {fileID: 1392269622}
|
||||
m_Layer: 0
|
||||
m_Name: GUI
|
||||
m_TagString: Untagged
|
||||
@ -961,23 +960,6 @@ MonoBehaviour:
|
||||
m_SynchronizeRotation: 1
|
||||
m_SynchronizeScale: 1
|
||||
m_UseLocal: 1
|
||||
--- !u!114 &1392269622
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4890728644967733176}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e7233e77bd50673459b9746b72155a35, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
voltageValue: {fileID: 4621530251273852237}
|
||||
windDirValue: {fileID: 1160440966591220994}
|
||||
temperatureValue: {fileID: 1160440967716077678}
|
||||
loc: {fileID: 1160440966516636515}
|
||||
windSpeedValue: {fileID: 515667116}
|
||||
--- !u!1001 &1988956797
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1281,10 +1263,18 @@ PrefabInstance:
|
||||
propertyPath: m_text
|
||||
value: Voltage
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678110284341, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 41.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678110284341, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontStyle
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678110284341, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSizeBase
|
||||
value: 41.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678239901344, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: CanvasVoltageTurbine
|
||||
@ -1389,6 +1379,18 @@ PrefabInstance:
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678910356438, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 36.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564678910356438, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSizeBase
|
||||
value: 36.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564679024842756, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 50.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564679024842756, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontColor.b
|
||||
value: 0.94867706
|
||||
@ -1401,6 +1403,10 @@ PrefabInstance:
|
||||
propertyPath: m_fontColor.r
|
||||
value: 0.9483357
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564679024842756, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontSizeBase
|
||||
value: 50.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 287564679024842756, guid: 1837e416a7f023e4b9de7c449006ca42, type: 3}
|
||||
propertyPath: m_fontColor32.rgba
|
||||
value: 4294112242
|
||||
@ -1854,12 +1860,16 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6036491612173940094, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6036491612173940094, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
propertyPath: voltageValue
|
||||
value:
|
||||
objectReference: {fileID: 4621530251273852237}
|
||||
- target: {fileID: 6036491612173940094, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
propertyPath: windSpeedValue
|
||||
value:
|
||||
objectReference: {fileID: 515667116}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
--- !u!224 &1160440965881748806 stripped
|
||||
@ -1894,7 +1904,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1160440965950817989}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e7233e77bd50673459b9746b72155a35, type: 3}
|
||||
m_Name:
|
||||
@ -1904,28 +1914,6 @@ RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491612173940093, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1160440966516636515 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491611599734977, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &1160440966591220994 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491611539832480, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!224 &1160440967034714766 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491611111016748, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
@ -1936,17 +1924,6 @@ RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491610696200438, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1160440967716077678 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6036491610417066956, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
m_PrefabInstance: {fileID: 4890728645620921250}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!4 &8668022573833670448 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4293156750076656786, guid: ebcaad662ef2ae14ca92fbcd7a67ee56, type: 3}
|
||||
|
@ -50,7 +50,7 @@ public class API : MonoBehaviour
|
||||
private string unit;
|
||||
private GameObject webSocketController;
|
||||
private WebSocketController webSocketControllerScript;
|
||||
private bool isButtonPressed = false; // Boolean to keep voltage updated as long as the turbine is rotating
|
||||
public bool isButtonPressed = false; // Boolean to keep voltage updated as long as the turbine is rotating
|
||||
PhotonView photonView;
|
||||
|
||||
|
||||
@ -61,12 +61,14 @@ public class API : MonoBehaviour
|
||||
//EmergencyButtonClick();
|
||||
photonView = PhotonView.Get(this);
|
||||
photonView.RPC("RPC_EmergencyButtonClick", RpcTarget.All);
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
void Update()
|
||||
{
|
||||
if (isButtonPressed)
|
||||
{
|
||||
Debug.Log("Inside Update");
|
||||
voltageValue.text = webSocketControllerScript.voltageValue.ToString();
|
||||
}
|
||||
}
|
||||
@ -86,6 +88,7 @@ public class API : MonoBehaviour
|
||||
windDirValue.SetText("----");
|
||||
temperatureValue.SetText("----");
|
||||
voltageValue.SetText("----");
|
||||
windSpeedValue.SetText("----");
|
||||
}
|
||||
IEnumerator GetText()
|
||||
{
|
||||
@ -101,6 +104,7 @@ public class API : MonoBehaviour
|
||||
{
|
||||
Debug.Log("Received data" + www.downloadHandler.text);
|
||||
ExtractDataFromJson(www.downloadHandler.text);
|
||||
isButtonPressed = true; // Boolean to keep voltage updated as long as the turbine is rotating
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +120,7 @@ public class API : MonoBehaviour
|
||||
|
||||
public void ExtractDataFromJson(string json)
|
||||
{
|
||||
isButtonPressed = true; // Boolean to keep voltage updated as long as the turbine is rotating
|
||||
|
||||
|
||||
ApiResponse response = JsonUtility.FromJson<ApiResponse>(json);
|
||||
//Debug.Log("Api response worked!!!!");
|
||||
@ -149,6 +153,7 @@ public void ExtractDataFromJson(string json)
|
||||
if (point.name == "ws")
|
||||
{
|
||||
latestWS = point.values[0];
|
||||
Debug.Log("Latest WS is - "+latestWS);
|
||||
}
|
||||
}
|
||||
photonView = PhotonView.Get(this);
|
||||
@ -158,7 +163,7 @@ public void ExtractDataFromJson(string json)
|
||||
[PunRPC]
|
||||
public void RPC_GreenButtonClick(String windDirection,String locationTemperature,String location,String windSpeed)
|
||||
{
|
||||
|
||||
Debug.Log("Latest WS is - " + windSpeed);
|
||||
windDirValue.SetText(windDirection);
|
||||
temperatureValue.SetText(locationTemperature);
|
||||
loc.SetText(location);
|
||||
|
Loading…
x
Reference in New Issue
Block a user