Wanzyee Studio

Calculate FPS at runtime, optional to show on GUI with color warning. More...

Inherits BaseSingleton< FramerateCounter >.

Public Attributes

float interval = 1f
 The interval to calculate FPS. More...
 
bool showHud
 Flag if show FPS on GUI. More...
 
TextAnchor alignment = TextAnchor.UpperRight
 The alignment of GUI on screen. More...
 
int fontSize = 20
 The size of the font. More...
 
Gradient fontColor
 The gradient of the font color, map with frame range for warning. More...
 
float frameRange = 80f
 The frame range, used to calculate the font color of current FPS. More...
 
Color backgroundColor = new Color(0f, 0f, 0f, 0.5f)
 The color of the GUI label background. More...
 

Static Public Attributes

static float fps => CheckValid(true) ? instance._framerate : 0f
 Current frame rate per second, updated every time interval set on instance. More...
 
static T instance
 Get the singleton instance. More...
 

Protected Member Functions

override void Awake ()
 Awake, initialize GUI content and style. More...
 

Static Protected Attributes

static bool autoDestroy
 Flag if to destroy excess instance automatically when it Awake(). More...
 

Properties

static bool show [get, set]
 Flag to show FPS on screen GUI or not. More...
 

Detailed Description

Calculate FPS at runtime, optional to show on GUI with color warning.

Member Function Documentation

override void Awake ( )
protectedvirtual

Awake, initialize GUI content and style.

Reimplemented from BaseSingleton< FramerateCounter >.

Member Data Documentation

float fps => CheckValid(true) ? instance._framerate : 0f
static

Current frame rate per second, updated every time interval set on instance.

float interval = 1f

The interval to calculate FPS.

bool showHud

Flag if show FPS on GUI.

TextAnchor alignment = TextAnchor.UpperRight

The alignment of GUI on screen.

int fontSize = 20

The size of the font.

Gradient fontColor

The gradient of the font color, map with frame range for warning.

float frameRange = 80f

The frame range, used to calculate the font color of current FPS.

Color backgroundColor = new Color(0f, 0f, 0f, 0.5f)

The color of the GUI label background.

bool autoDestroy
staticprotectedinherited

Flag if to destroy excess instance automatically when it Awake().

T instance
staticinherited

Get the singleton instance.

Property Documentation

bool show
staticgetset

Flag to show FPS on screen GUI or not.