Dynamic Water Physics 2
Search Results for

    Show / Hide Table of Contents

    Class FpsToText

    Displays the current framerate in a Text component with optional color coding. Supports both instantaneous and averaged FPS measurements.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    FpsToText
    Namespace: NWH.Common.Demo
    Assembly: NWH.DWP2.dll
    Syntax
    [RequireComponent(typeof(Text))]
    public class FpsToText : MonoBehaviour

    Fields

    | Edit this page View Source

    bad

    Text color when framerate is below badBelow threshold.

    Declaration
    public Color bad
    Field Value
    Type Description
    Color
    | Edit this page View Source

    badBelow

    FPS threshold below which the color changes to bad (red).

    Declaration
    public int badBelow
    Field Value
    Type Description
    int
    | Edit this page View Source

    forceIntResult

    Round FPS to nearest integer for cleaner display.

    Declaration
    public bool forceIntResult
    Field Value
    Type Description
    bool
    | Edit this page View Source

    good

    Text color when framerate is above okayBelow threshold.

    Declaration
    public Color good
    Field Value
    Type Description
    Color
    | Edit this page View Source

    groupSampling

    Use averaging over multiple samples instead of single frame measurement.

    Declaration
    public bool groupSampling
    Field Value
    Type Description
    bool
    | Edit this page View Source

    okay

    Text color when framerate is between badBelow and okayBelow.

    Declaration
    public Color okay
    Field Value
    Type Description
    Color
    | Edit this page View Source

    okayBelow

    FPS threshold below which the color changes to okay (yellow).

    Declaration
    public int okayBelow
    Field Value
    Type Description
    int
    | Edit this page View Source

    sampleSize

    Number of samples to average when groupSampling is enabled.

    Declaration
    public int sampleSize
    Field Value
    Type Description
    int
    | Edit this page View Source

    smoothed

    Use Time.smoothDeltaTime instead of Time.deltaTime for calculations.

    Declaration
    public bool smoothed
    Field Value
    Type Description
    bool
    | Edit this page View Source

    updateTextEvery

    Update text display every N frames. 1 = every frame.

    Declaration
    public int updateTextEvery
    Field Value
    Type Description
    int
    | Edit this page View Source

    useColors

    Enable color coding based on framerate thresholds.

    Declaration
    public bool useColors
    Field Value
    Type Description
    bool
    | Edit this page View Source

    useSystemTick

    Use Environment.TickCount instead of Time.deltaTime for calculations.

    Declaration
    public bool useSystemTick
    Field Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    GetSystemFramerate()

    Declaration
    protected virtual int GetSystemFramerate()
    Returns
    Type Description
    int
    | Edit this page View Source

    Group()

    Declaration
    protected virtual void Group()
    | Edit this page View Source

    Reset()

    Declaration
    protected virtual void Reset()
    | Edit this page View Source

    SingleFrame()

    Declaration
    protected virtual void SingleFrame()
    | Edit this page View Source

    Start()

    Declaration
    protected virtual void Start()
    | Edit this page View Source

    Update()

    Declaration
    protected virtual void Update()
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics