• This project
    • Loading...
  • Sign in

Research And Development / contentfulExample

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • contentfulExample
  • ContentfulExample
  • Assets
  • Packages
  • Globatools
  • Utility
  • FpsDisplay.cs
  • Dave Boyle's avatar
    project demos fetching single records, multiple records, filtering, and posting new records · 3bdba5d6
    3bdba5d6 Browse Files
    Dave Boyle authored 2019-01-18 11:33:38 -0500
FpsDisplay.cs 416 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
using UnityEngine;
using UnityEngine.UI;

public class FpsDisplay : MonoBehaviour
{
    private int _avgFramerate;
    private Text _t;

    private void Start()
    {
        _t = GetComponent<Text>();
    }

    public void Update()
    {
        float current = 0;
        current = Time.frameCount / Time.time;
        _avgFramerate = (int)current;
        _t.text = _avgFramerate.ToString() + " FPS";
    }
}