最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Unity中FPS顯示

2020-05-07 16:17 作者:unity_某某師_高錦錦  | 我要投稿

Unity中顯示當前幀數(shù)


using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UI;


public class FPSShow : MonoBehaviour

{

? ? public Text FPSTex;

? ? private float time, frameCount;

? ? private float fps = 0;

? ? void Update()

? ? {

? ? ? ? if (time >= 1 && frameCount >= 1)

? ? ? ? {

? ? ? ? ? ? fps = frameCount / time;

? ? ? ? ? ? time = 0;

? ? ? ? ? ? frameCount = 0;

? ? ? ? }

? ? ? ? FPSTex.color = fps >= 20 ? Color.white : (fps > 15 ? Color.yellow : Color.red);

? ? ? ? FPSTex.text = "FPS為:" + fps.ToString("f2");

? ? ? ? time += Time.unscaledDeltaTime;

? ? ? ? frameCount++;

? ? }

}


Unity中FPS顯示的評論 (共 條)

分享到微博請遵守國家法律
原阳县| 化隆| 绥棱县| 丰台区| 长春市| 西乌| 新邵县| 舟山市| 从化市| 甘洛县| 来宾市| 嵊州市| 疏勒县| 商城县| 满城县| 大悟县| 山西省| 隆昌县| 盘锦市| 永福县| 大同县| 肇庆市| 游戏| 洛宁县| 博湖县| 舒城县| 贵德县| 牙克石市| 平武县| 沙河市| 信丰县| 会泽县| 昔阳县| 抚顺市| 梁河县| 忻城县| 肇源县| 瑞安市| 衡南县| 新丰县| 诸暨市|