Description
The VSync
property in the RenderSettings
class is a boolean value that determines whether vertical synchronization (VSync) is enabled or disabled in the rendering settings of the game. VSync is a display option that synchronizes the frame rate of the game with the refresh rate of the monitor to prevent screen tearing.
Usage
To use the VSync
property, you can get or set its value to enable or disable vertical synchronization. This can be useful for improving visual quality by eliminating screen tearing, but it may also introduce input lag or reduce frame rates if the system cannot maintain the monitor's refresh rate.
Example
// Example of accessing and modifying the VSync property
// Access the RenderSettings instance
RenderSettings renderSettings = new RenderSettings();
// Check if VSync is currently enabled
bool isVSyncEnabled = renderSettings.VSync;
// Enable VSync
renderSettings.VSync = true;
// Disable VSync
renderSettings.VSync = false;