Advanced FPS Counter  1.5.4
FPS Counter on steroids!
AFPSCounter Class Reference

Inherits MonoBehaviour.

Static Public Member Functions

static AFPSCounter AddToScene ()
 
static AFPSCounter AddToScene (bool keepAlive)
 
static void SelfDestroy ()
 

Public Attributes

FPSCounterData fpsCounter = new FPSCounterData()
 
MemoryCounterData memoryCounter = new MemoryCounterData()
 
DeviceInfoCounterData deviceInfoCounter = new DeviceInfoCounterData()
 
KeyCode hotKey = KeyCode.BackQuote
 
bool circleGesture
 
bool hotKeyCtrl
 
bool hotKeyShift
 
bool hotKeyAlt
 

Properties

bool KeepAlive [get]
 
OperationMode OperationMode [get, set]
 
bool ForceFrameRate [get, set]
 
int ForcedFrameRate [get, set]
 
bool Background [get, set]
 
Color BackgroundColor [get, set]
 
int BackgroundPadding [get, set]
 
bool Shadow [get, set]
 
Color ShadowColor [get, set]
 
Vector2 ShadowDistance [get, set]
 
bool Outline [get, set]
 
Color OutlineColor [get, set]
 
Vector2 OutlineDistance [get, set]
 
bool? AutoScale [get, set]
 
float ScaleFactor [get, set]
 
Font LabelsFont [get, set]
 
int FontSize [get, set]
 
float LineSpacing [get, set]
 
int CountersSpacing [get, set]
 
Vector2 PaddingOffset [get, set]
 
bool PixelPerfect [get, set]
 
int SortingOrder [get, set]
 
static AFPSCounter Instance [get]
 

Detailed Description

Allows to see frames per second counter, memory usage counter and some simple hardware information right in running app on any device.
Just call AFPSCounter.AddToScene() to use it.

You also may add it to GameObject (without any child or parent objects, with zero rotation, zero position and 1,1,1 scale) as usual or through the
"GameObject > Create Other > Code Stage > Advanced FPS Counter" menu.

Member Function Documentation

◆ AddToScene() [1/2]

static AFPSCounter AddToScene ( )
inlinestatic

Creates and adds new AFPSCounter instance to the scene if it doesn't exists with keepAlive set to true. Use it to instantiate AFPSCounter from code before using AFPSCounter.Instance.

Returns
Existing or new AFPSCounter instance.

◆ AddToScene() [2/2]

static AFPSCounter AddToScene ( bool  keepAlive)
inlinestatic

Creates and adds new AFPSCounter instance to the scene if it doesn't exists. Use it to instantiate AFPSCounter from code before using AFPSCounter.Instance.

Parameters
keepAliveSet true to prevent AFPSCounter's Game Object from destroying on level (scene) load. Applies to the new Instance only.
Returns
Existing or new AFPSCounter instance.

◆ SelfDestroy()

static void SelfDestroy ( )
inlinestatic

Use it to completely dispose current AFPSCounter instance.

Member Data Documentation

◆ fpsCounter

FPSCounterData fpsCounter = new FPSCounterData()

Frames Per Second counter.

◆ memoryCounter

MemoryCounterData memoryCounter = new MemoryCounterData()

Mono or heap memory counter.

◆ deviceInfoCounter

DeviceInfoCounterData deviceInfoCounter = new DeviceInfoCounterData()

Device hardware info.
Shows CPU name, cores (threads) count, GPU name, total VRAM, total RAM, screen DPI and screen size.

◆ hotKey

KeyCode hotKey = KeyCode.BackQuote

Used to enable / disable plugin at runtime. Set to KeyCode.None to disable.

◆ circleGesture

bool circleGesture

Used to enable / disable plugin at runtime. Make two circle gestures with your finger \ mouse to switch plugin on and off.

◆ hotKeyCtrl

bool hotKeyCtrl

Hot key modifier: any Control on Windows or any Command on Mac.

◆ hotKeyShift

bool hotKeyShift

Hot key modifier: any Shift.

◆ hotKeyAlt

bool hotKeyAlt

Hot key modifier: any Alt.

Property Documentation

◆ KeepAlive

bool KeepAlive
get

Read-only property allowing to figure out current keepAlive state.

◆ OperationMode

Use it to change AFPSCounter operation mode.

Disabled: removes labels and stops all internal processes except Hot Key listener.
Background: removes labels keeping counters alive. May be useful for hidden performance monitoring and benchmarking. Hot Key has no effect in this mode.
Normal: shows labels and runs all internal processes as usual.

◆ ForceFrameRate

bool ForceFrameRate
getset

Allows to see how your game performs on specified frame rate.
IMPORTANT: this option disables VSync while enabled!

Useful to check how physics performs on slow devices for example.

◆ ForcedFrameRate

int ForcedFrameRate
getset

Desired frame rate for ForceFrameRate option, does not guarantee selected frame rate. Set to -1 to render as fast as possible in current conditions.

◆ Background

bool Background
getset

Background for all texts.

◆ BackgroundColor

Color BackgroundColor
getset

Color of the background.

◆ BackgroundPadding

int BackgroundPadding
getset

Padding of the background. Change forces the HorizontalLayoutGroup.SetLayoutHorizontal() call.

◆ Shadow

bool Shadow
getset

Shadow effect for all texts.

◆ ShadowColor

Color ShadowColor
getset

Color of the shadow effect.

◆ ShadowDistance

Vector2 ShadowDistance
getset

Distance of the shadow effect.

◆ Outline

bool Outline
getset

Outline effect for all texts.

◆ OutlineColor

Color OutlineColor
getset

Color of the outline effect.

◆ OutlineDistance

Vector2 OutlineDistance
getset

Distance of the outline effect.

◆ AutoScale

bool? AutoScale
getset

Controls own Canvas Scaler scale mode. Check to use ScaleWithScreenSize. Otherwise ConstantPixelSize will be used.

◆ ScaleFactor

float ScaleFactor
getset

Controls global scale of all texts.

◆ LabelsFont

Font LabelsFont
getset

Font to render labels with.

◆ FontSize

int FontSize
getset

The font size to use (for dynamic fonts).

If this is set to a non-zero value, the font size specified in the font importer is overridden with a custom size. This is only supported for fonts set to use dynamic font rendering. Other fonts will always use the default font size.

◆ LineSpacing

float LineSpacing
getset

Space between lines.

◆ CountersSpacing

int CountersSpacing
getset

Lines count between different counters in a single label.

◆ PaddingOffset

Vector2 PaddingOffset
getset

Pixel offset for anchored labels. Automatically applied to all labels.

◆ PixelPerfect

bool PixelPerfect
getset

Controls own canvas Pixel Perfect property.

◆ SortingOrder

int SortingOrder
getset

Sorting order to use for the canvas.

Set higher value to get closer to the user.

◆ Instance

AFPSCounter Instance
staticget

Allows reaching public properties from code. Can be null.

See also
AddToScene()