28 lines
715 B
C#
28 lines
715 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Assets.Scripts.Devices
|
|
{
|
|
class MobileInfo : MonoBehaviour
|
|
{
|
|
Text BatteryText { get; set; }
|
|
Text TimeText { get; set; }
|
|
private void Start()
|
|
{
|
|
BatteryText = transform.Find("BatteryText").GetComponent<Text>();
|
|
TimeText = transform.Find("TimeText").GetComponent<Text>();
|
|
}
|
|
private void Update()
|
|
{
|
|
BatteryText.text = $"{Math.Round(SystemInfo.batteryLevel * 100, 0)}%";
|
|
|
|
TimeText.text = DateTime.Now.ToString("HH:mm");
|
|
}
|
|
}
|
|
}
|