unity3d:显示FPS

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/luoyikun/article/details/82686882
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FPSShow : MonoBehaviour {

    private void OnGUI()
    {
        string text = string.Format(" FPS:{0}", 1.0f / Time.smoothDeltaTime);
        GUIStyle font = new GUIStyle();
        font.fontSize = 40;
        GUI.Label(new Rect(0, 0, 200, 200), text, font);
    }
}

猜你喜欢

转载自blog.csdn.net/luoyikun/article/details/82686882