123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class NoisePanel : MonoBehaviour
- {
- public Image stateImage;
- public Text stateText;
- public Text deviceId;
- public Text noiseText;
-
- public string state;
- private NoiseMqttData data;
- public void SetData(NoiseMqttData data)
- {
- if (data == null)
- return;
- this.data = data;
- switch (state)
- {
- case "ą¨žŻ":
- stateImage.color = new Color32(255, 3, 7, 100);
- stateText.text = "Ň쳣";
- stateText.color = new Color32(255, 3, 7, 255);
- break;
- default:
- stateImage.color = new Color32(34, 187, 67, 100);
- stateText.text = "ŐýłŁ";
- stateText.color = new Color32(34, 187, 67, 255);
- break;
- }
- deviceId.text = data.device.deviceName;
- noiseText.text = data.value + data.unit;
-
- }
- }
|