当前位置:网站首页>Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
2022-07-06 20:13:00 【LiPing122335】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class jishi : MonoBehaviour {
private float timer = 0f;
private int h = 0;
private int m = 0;
private int s = 0;
private string timeStr = string.Empty;
void Update()
{
timer += Time.deltaTime;
if (timer >= 1f) { s++; timer = 0; }
if (s >= 60) { m++; s = 0; }
if (m >= 60) { h++; m = 0; }
if (h >= 99) { h = 0; }
}
void OnGUI()
{
timeStr = string.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
GUI.Label(new Rect(10, 10, 100, 200), timeStr);
}
}
边栏推荐
- 01 基础入门-概念名词
- 【计网】第三章 数据链路层(3)信道划分介质访问控制
- Example of shutter text component
- Monthly report of speech synthesis (TTS) and speech recognition (ASR) papers in June 2022
- Enumeration gets values based on parameters
- 数字三角形模型 AcWing 1018. 最低通行费
- Ideas and methods of system and application monitoring
- Configuration and simple usage of the EXE backdoor generation tool quasar
- 02 基础入门-数据包拓展
- BUUCTF---Reverse---easyre
猜你喜欢

RT thread I2C tutorial

BUUCTF---Reverse---easyre

Deep learning classification network -- zfnet

Monthly report of speech synthesis (TTS) and speech recognition (ASR) papers in June 2022

An East SMS login resurrection installation and deployment tutorial

02 基础入门-数据包拓展
Classic 100 questions of algorithm interview, the latest career planning of Android programmers
Tencent T4 architect, Android interview Foundation

Example of applying fonts to flutter

腾讯T3手把手教你,真的太香了
随机推荐
Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
Anaconda安装后Jupyter launch 没反应&网页打开运行没执行
Technology sharing | packet capturing analysis TCP protocol
Wechat applet common collection
Tencent Android development interview, basic knowledge of Android Development
B-杰哥的树(状压树形dp)
Tencent T3 Daniel will teach you hand-in-hand, the internal information of the factory
【Yann LeCun点赞B站UP主使用Minecraft制作的红石神经网络】
2022年6月语音合成(TTS)和语音识别(ASR)论文月报
Tencent cloud database public cloud market ranks top 2!
青龙面板白屏一键修复
Appx code signing Guide
数字三角形模型 AcWing 1018. 最低通行费
Tencent T2 Daniel explained in person and doubled his job hopping salary
案例 ①|主机安全建设:3个层级,11大能力的最佳实践
学习打卡web
Tencent byte Alibaba Xiaomi jd.com offer got a soft hand, and the teacher said it was great
5. 无线体内纳米网:十大“可行吗?”问题
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
Introduction of Xia Zhigang