Unity 温度显示

时间:2024-04-29 22:32:13

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UniRx;

public class OutsideTemperature : MonoBehaviour
{
[SerializeField]
private TextMeshProUGUI _temperature;

private static readonly string TAG = "OutsideTemperature";
void Start()
{
    DataCenter.Temperature.Subscribe(i => {
    Log.I(TAG, "Temperature select value:  " + i);
        _temperature.text = Mathf.FloorToInt(i).ToString();
    }).AddTo(this);
}

}