| 12345678910111213141516171819202122232425 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- public class Billboard : MonoBehaviour
- {
- public TextMeshProUGUI speedText;
-
- static Billboard ins;
- void Awake() {
- ins = this;
- }
-
- /**speed m/s */
- public static void ShowSpeed(float speed) {
- //转km/h
- speed = speed * 3600f / 1000f;
- speed = (float)System.Math.Round((double)speed, 1);
- if (ins && ins.speedText) {
- ins.speedText.text = speed.ToString();
- }
- }
- }
|