为了账号安全,请及时绑定邮箱和手机立即绑定

C#和Unity:在移动设备上以良好的性能更改显示的时间

C#和Unity:在移动设备上以良好的性能更改显示的时间

C#
Cats萌萌 2021-05-04 08:57:02
大家好,我做了这个功能,称为每一帧。-您认为这是保存性能的好方法,还是有更好的方法?    private void GetCurrentTime(){    m_TimeNow = System.Convert.ToString(System.DateTime.Now);    //If the previous time is not equals to the current time (without seconds = every minute)    if (m_PreTime != m_TimeNow.Remove(14))    {                                                   //Change the Time displayed on the screen:        m_PreTime = m_TimeNow.Remove(14);               //1. Copy current Time        m_Times = m_TimeNow.Split(' ');                 //2. Split to following parts        m_Time = m_Times[1].Remove(4);                  //3. Cutout seconds        m_Text_Time.text = m_Time + " " + m_Times[2];   //4. And change UI-Text: Time + AM/PM    }}此函数称为每帧,将在移动android设备上。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 119 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信