Minor - Add Assets And Support Dual Screen
This commit is contained in:
24
Assets/MobileDepthWater/Scripts/FPSUI.cs
Normal file
24
Assets/MobileDepthWater/Scripts/FPSUI.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Assets.MobileOptimizedWater.Scripts
|
||||
{
|
||||
using Assets.Scripts.Helpers;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FPSUI : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Text fpsText;
|
||||
|
||||
private FPSCounter fpsCounter;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
fpsCounter = new FPSCounter();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
fpsCounter.Update(Time.deltaTime);
|
||||
fpsText.text = "Fps: " + fpsCounter.GetAverageFps(1f).ToString("###");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user