unity fps counter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class FpsScript : MonoBehaviour
{
[SerializeField] private Text fpsText;
[SerializeField] private float hudRefreshRate = 1f;
private float timer;
private void Update()
{
if(Time.unscaledTime > timer)
{
int fps = (int)(1f / Time.unscaledDeltaTime);
fpsText.text = fps + " FPS on " + SceneManager.GetActiveScene().path;
timer = Time.unscaledTime + hudRefreshRate;
}
}
}
Also in C#:
- C# webclient submit form
- c# round number down
- unity generate random color
- check if current time is in the morning c#
- open file in explorer c#
- C# invoke
- c# warning CS0108
- convert string to decimal c#
- c# resize bitmap
- weakreference tryget c#
- unity to integer
- isGrounded script for copy
- open new window c# wpf
- getcomponent c#
- set object to random color unity
- c# System.Resources.MissingManifestResourceException error
- No IUserTwoFactorTokenProvider<TUser> named 'Default' is registered.'
- c# get list of all class fields
- how to reference a child object unity
- c# trigger destructor
- insert new item listview c#
- how to convert object in string JSON c#
- c# AllowSynchronousIO to true
- how to disable device guard or credential guard vmware