Interhaptics SDK for Unity
1.6
Loading...
Searching...
No Matches
Interhaptics
sdk_unity
Interhaptics
Runtime
Samples
DisplayFPS.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
using
UnityEngine.UI;
3
4
namespace
Interhaptics.Samples
5
{
6
public
class
DisplayFPS
: MonoBehaviour
7
{
8
public
Text
fpsText
;
// Change TextMesh to TMP_Text
9
private
float
deltaTime;
10
11
void
Update()
12
{
13
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
14
float
msec = deltaTime * 1000.0f;
15
float
fps = 1.0f / deltaTime;
16
fpsText.text =
string
.Format(
"{0:0.0} ms ({1:0.} fps)"
, msec, fps);
// This line remains the same
17
}
18
}
19
}
Interhaptics.Samples.DisplayFPS
Definition
DisplayFPS.cs:7
Interhaptics.Samples.DisplayFPS.fpsText
Text fpsText
Definition
DisplayFPS.cs:8
Interhaptics.Samples
Definition
AudioControlGUI.cs:10
Generated by
1.11.0