Showing posts with label FPS. Show all posts
Showing posts with label FPS. Show all posts

Friday, January 4, 2019

How to show FPS in Unity3D C#

Showing FPS can be helpful when you’re on a handheld device and gauging performance.

Sometimes you may need to throttle quality for device depending on the performance.

This code is how you display FPS in C# for a mono behaviour script.


  1. void Update () {
  2. deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
  3. float fps = 1.0f / deltaTime;
  4. Debug.Log(Mathf.Ceil(fps).ToString() + “ FPS”);
  5. }

Wednesday, March 27, 2013

Change Frame Rate in Unity3D

The FPS framerate in Unity3D is easier than ever with Unity3D 3.5+.

Below is the JS and the C# code counterpart:


    function Awake () {
        // Make the game run as fast as possible in the web player
        Application.targetFrameRate = 300;
    }
public class example : MonoBehaviour {
    void Awake() {
        Application.targetFrameRate = 300;
    }
}

Generating "Always On Top" NSWindow in macOS across all detected displays

Also: Using UIKit & Cocoa Frameworks using Objective-C In m acOS or OS X , written in either Objective-C or Swift  Langues, you m...