luoyikun

导航

unity3d:显示FPS

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);
    }
}

posted on 2018-09-13 13:53  luoyikun  阅读(5)  评论(0)    收藏  举报  来源