The FPSCounter
script is a Unity component that measures and displays the frames per second (FPS) in a Unity scene. It is designed to be attached to an empty GameObject in the initial scene.
- Real-time FPS Display: Continuously updates and displays the FPS in the scene.
- Screen Size Adaptation: Automatically adjusts the display size and font based on screen dimensions.
- Scene Persistence: Persists across scene changes to provide consistent FPS tracking.
- Create an empty GameObject in your initial Unity scene.
- Attach the
FPSCounter
script to the GameObject. - Run the scene to see the FPS counter displayed on the screen.
You can modify the script to change the display style, update interval, or other parameters to suit your needs.