五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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顯示的評論 (共 條)

分享到微博請遵守國家法律
张北县| 孙吴县| 合阳县| 岳普湖县| 友谊县| 绥阳县| 汝州市| 乐至县| 齐齐哈尔市| 赞皇县| 安庆市| 古蔺县| 铁岭县| 普陀区| 水城县| 兴化市| 武穴市| 内江市| 登封市| 定远县| 湘阴县| 蓬莱市| 黎城县| 长武县| 翁源县| 天气| 灵川县| 平泉县| 淮滨县| 论坛| 阿克苏市| 上杭县| 应用必备| 桂阳县| 本溪市| 新乡县| 望江县| 清镇市| 二手房| 依兰县| 兴和县|