jatek vk vege collider
This commit is contained in:
22
Assets/Scripts/fps.cs
Normal file
22
Assets/Scripts/fps.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using System.Threading;
|
||||
|
||||
public class fps : MonoBehaviour
|
||||
{
|
||||
public TMP_Text fpsText;
|
||||
[SerializeField] private float _hudRefreshRate = 1f;
|
||||
private float _timer;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Time.unscaledTime > _timer) {
|
||||
int fps = (int)(1f / Time.unscaledDeltaTime);
|
||||
fpsText.text = "FPS: " + fps;
|
||||
_timer = Time.unscaledTime + _hudRefreshRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/fps.cs.meta
Normal file
11
Assets/Scripts/fps.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7367c5a782c748e491312b4903d6fb9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user