Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PlayerSettings

Use Player settings to define how Unity builds and displays your final application.
Read time 13 minutesLast updated 5 days ago

Definition

  • Type: Class
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
  • Inherits from: Object
public sealed class PlayerSettings : Object

Static Properties

Property

Description

accelerometerFrequencyAccelerometer update frequency.
adjustIOSFPSUsingThermalStateWhen enabled, Unity lowers the iOS frame rate in Serious and Critical thermal states to reduce device temperature and improve stability.
advancedLicenseIs the advanced version being used?
allowedAutorotateToLandscapeLeftIs auto-rotation to landscape left supported?
allowedAutorotateToLandscapeRightIs auto-rotation to landscape right supported?
allowedAutorotateToPortraitIs auto-rotation to portrait supported?
allowedAutorotateToPortraitUpsideDownIs auto-rotation to portrait upside-down supported?
allowFullscreenSwitchEnable to allow users to switch between full-screen and windowed mode using OS-specific keyboard shortcuts.
allowHDRDisplaySupportPrepare the application to encode images for an HDR display.
allowUnsafeCodeAllow unsafe C# code to be compiled for predefined assemblies.
applicationIdentifierThe application identifier for the currently selected build target.
audioSpatialExperienceDetermines if the Unity app's final mixed audio stream is spatialized.
bakeCollisionMeshesPre bake collision meshes on player build.
bundleVersionThe application’s global version number string.
colorSpaceSet the rendering color space for the current project.
companyNameThe name of your company.
cursorHotspotDefault cursor's click position in pixels from the top left corner of the cursor image.
d3D12DeviceFilterListAssetSpecifies an D3D12DeviceFilterLists asset which provides filtering criteria for allowing or denying Windows devices from using D3D12 API and selecting Graphics Jobs mode when running Unity applications.
dedicatedServerOptimizationsPerforms additional optimizations on Dedicated Server builds.
defaultCursorThe default cursor for your application.
defaultInterfaceOrientationDefault screen orientation for mobiles.
defaultScreenHeightDefault vertical dimension of stand-alone player window.
defaultScreenWidthDefault horizontal dimension of stand-alone player window.
defaultWebScreenHeightDefault vertical dimension of web player window.
defaultWebScreenWidthDefault horizontal dimension of web player window.
enable360StereoCaptureEnable 360 Stereo Capture support on the current build target.
enableCrashReportAPIEnables CrashReport API.
enableDirectStorageEnables DirectStorage for supported platforms.
enableFrameTimingStatsEnable frame timing statistics.
enableMetalAPIValidationEnables Metal API validation in the Editor.
enableOpenGLProfilerGPURecordersEnable ProfilerRecorder usage to record GPU timings when rendering with OpenGL.
forceSingleInstanceRestrict standalone players to a single concurrent running instance.
fullScreenModePlatform agnostic setting to define fullscreen behavior. Not all platforms support all modes.
gcIncrementalAllows you to enable or disable incremental mode for garbage collection.
gpuSkinningMarked for deprecation in the future. Use PlayerSettings.meshDeformation instead.
graphicsJobModeSelects the graphics job mode to use on platforms that support
Native
,
Legacy
and
Split
graphics jobs.
graphicsJobsEnable graphics jobs (multi threaded rendering).
hdrBitDepthThe number of bits in each color channel for swap chain buffers.
insecureHttpOptionDetermines if plain text HTTP connections are allowed.
legacyClampBlendShapeWeightsDefines whether the BlendShape weight range in SkinnedMeshRenderers is clamped.
logObjCUncaughtExceptionsAre ObjC uncaught exceptions logged?
macRetinaSupportEnable Retina support for macOS.
meshDeformationSpecifies which method Unity uses to process mesh deformations for skinning.
mipStrippingEnable mip stripping for all platforms.
MTRenderingIs multi-threaded rendering enabled?
muteOtherAudioSourcesStops or allows audio from other applications to play in the background while your Unity application is running.
openGLRequireES31AEPSpecifies whether the application requires OpenGL ES 3.1 AEP support.
openGLRequireES32Specifies whether the application requires OpenGL ES 3.2 support.
preserveFramebufferAlphaWhen enabled, preserves the alpha value in the framebuffer to support rendering over native UI.
productGUIDReturns a unique project ID.
productNameThe name of your product.
resetResolutionOnWindowResizeIndicates whether to reset the application's screen resolution when the native window size changes.
resizableWindowUse resizable window in standalone player builds.
runInBackgroundIf enabled, your game will continue to run after lost focus.
spriteBatchVertexThresholdSpecifies the max vertex limit for Sprite batching.
statusBarHiddenReturns if status bar should be hidden. Supported on iOS only; on Android, the status bar is always hidden.
stereoRenderingPathActive stereo rendering path
strictShaderVariantMatchingEnable strict shader variant matching in the player.
stripEngineCodeRemove unused Engine code from your build (IL2CPP-only).
stripUnusedMeshComponentsShould unused Mesh components be excluded from game build?
suppressCommonWarningsSuppresses common C# warnings.
tvOSBundleVersionApplication bundle version for the TVOS platform.
use32BitDisplayBuffer32-bit Display Buffer is used.
useFlipModelSwapchainUse DXGI flip model swap chain for D3D11.
useHDRDisplaySwitch the main display to HDR mode (if available).
useMacAppStoreValidationEnable receipt validation for the Mac App Store.
usePlayerLogWrite a log file with debugging information.
virtualRealitySplashScreenVirtual Reality specific splash screen.
visibleInBackgroundOn Windows, shows the application in the background if the Fullscreen Windowed mode is used.
visionOSBundleVersionApplication bundle version for the VisionOS platform.
vulkanEnableLateAcquireNextImageDelays acquiring the swapchain image until after the frame is rendered.
vulkanEnablePreTransformApplies the display rotation during rendering.
vulkanEnableSetSRGBWriteEnables the ability to toggle sRGB write mode on Vulkan framebuffers.
vulkanNumSwapchainBuffersSet the number of swapchain buffers used when rendering with Vulkan.
webGPUDeviceFilterListAssetSpecifies a WebGPUDeviceFilterLists asset which provides filtering criteria to allow or deny the use of WebGPU API when running Unity web applications.
windowsGamepadBackendHintSpecifies the desired Windows API to be used for input.
xcodeProjectTypeThe type of Xcode project to export.

Static Methods

Method

Description

GetAdditionalCompilerArgumentsGets an array of additional compiler arguments set for a specific NamedBuildTarget.
GetAdditionalIl2CppArgsObtain the additional arguments passed to the IL2CPP compiler during the player build process.
GetApiCompatibilityLevelGets .NET API compatibility level for specified build target.
GetApplicationIdentifierGet the application identifier for the specified platform.
GetArchitectureGets the architecture for the given build target.
GetCaptureStartupLogsReturns whether a given build target is configured to capture startuplogs
GetDefaultScriptingBackendReturns the default ScriptingImplementation for the build target you select.
GetDefaultShaderChunkCountGets the default limit on the number of shader variant chunks Unity loads and keeps in memory.
GetDefaultShaderChunkSizeInMBGets the default size for compressed shader variant chunks.
GetEditorAssembliesCompatibilityLevelGets .NET API compatibility level for the editor assemblies.
GetGraphicsAPIsGet graphics APIs to be used on a build platform.
GetIconsReturns the list of assigned icons for the specified build target.
GetIconSizesReturns a list of icon sizes for the specified platform.
GetIl2CppCodeGenerationGets the value of code generation option for IL2CPP.
GetIl2CppCompilerConfigurationGets compiler configuration used when compiling generated C++ code for the build target you specify.
GetIl2CppLTOModeGets link time optimization (LTO) mode for il2cpp builds for the build target you specify.
GetIl2CppStacktraceInformationGets stack trace information option for il2cpp builds for the build target you specify.
GetManagedCodeVariantGets the value of the managed code variant option.
GetManagedStrippingLevelGets the managed code stripping level set for the build target you select
GetMobileMTRenderingCheck if multithreaded rendering option for mobile platform is enabled.
GetNormalMapEncodingGets the NormalMapEncoding for the build target you select.
GetOverrideShaderChunkSettingsForPlatformIf the value is
true
, settings for the
buildTarget
override the default settings.
GetPlatformIconsGets the list of available icon slots for the specified build target and kind. The BuildTargetGroup overload is marked for deprecation in the future; use the NamedBuildTarget overload.
GetPreloadedAssetsReturns the assets that will be loaded at start up in the player and be kept alive until the player terminates.
GetRayTracingFeaturesSupportForPlatformGets the ray tracing features that the specified target platform supports.
GetScriptingBackendGets the scripting framework for the build target you select.
GetScriptingDefineSymbolsGets the array of symbols for script compilation for the build target you select. Symbols are semicolon-separated. For example, "SYMBOL1;SYMBOL2".
GetShaderChunkCountForPlatformGets the default limit on the number of shader variant chunks Unity loads and keeps in memory for the build target.
GetShaderChunkSizeInMBForPlatformGets the default size for compressed shader variant chunks for the build target.
GetShaderPrecisionModelGets the active shader precision model.
GetStackTraceLogTypeGets stack trace logging options.
GetStaticBatchingForPlatformReturns true if static batching is enabled for the given BuildTarget.
GetSupportedIconKindsRetrieves all PlatformIconKind values supported by the specified build target.
GetTemplateCustomValueReturns a value of a custom template variable.
GetUseDefaultGraphicsAPIsIs a build platform using automatic graphics API choice?
GetVirtualTexturingSupportEnabledIs virtual texturing enabled.
SetAdditionalCompilerArgumentsSets additional compiler arguments for a build target.
SetAdditionalIl2CppArgsSet additional arguments passed to the IL2CPP compiler during the build process.
SetApiCompatibilityLevelSets .NET API compatibility level for specified build target.
SetApplicationIdentifierSets the application identifier for a platform.
SetArchitectureSets the target CPU architecture for the build target.
SetCaptureStartupLogsSet whether a given build target is configured to capture startuplogs
SetDefaultShaderChunkCountSets the default limit on the number of shader variant chunks Unity loads and keeps in memory.
SetDefaultShaderChunkSizeInMBSets the default size for compressed shader variant chunks.
SetEditorAssembliesCompatibilityLevelSets .NET API compatibility level for Editor Assemblies.
SetGraphicsAPIsSets the graphics APIs used on a build platform.
SetIconsAssigns a list of icons for the specified platform.
SetIl2CppCodeGenerationSets the code generation option for IL2CPP for the specified build target.
SetIl2CppCompilerConfigurationSets compiler configuration used when compiling generated C++ code for a particular build target.
SetIl2CppLTOModeSets link time optimization (LTO) mode for IL2CPP builds for the build target you specify.
SetIl2CppStacktraceInformationSets stack trace information option for il2cpp builds for the build target you specify.
SetManagedCodeVariantSets the managed code variant option for the specified build target.
SetManagedStrippingLevelSets the managed code stripping level for specified build target.
SetMobileMTRenderingEnable or disable multithreaded rendering option for mobile platform.
SetNormalMapEncodingSets the normal map encoding for the given build target.
SetOverrideShaderChunkSettingsForPlatformEnable this to override the default shader variant chunk settings.
SetPlatformIconsAssign a list of icons for the specified build target and platform icon kind.
SetPreloadedAssetsAssigns the assets that will be loaded at start up in the player and be kept alive until the player terminates.
SetScriptingBackendSets the scripting framework for a given build target.
SetScriptingDefineSymbolsSet user-specified symbols for script compilation for the given build target.
SetShaderChunkCountForPlatformSets the default limit on the number of shader variant chunks Unity loads and keeps in memory on the build target.
SetShaderChunkSizeInMBForPlatformSets the default size for compressed shader variant chunks on the build target.
SetShaderPrecisionModelSets the shader precision model.
SetStackTraceLogTypeSet stack trace logging options. Note: calling this function will implicitly call Application.SetStackTraceLogType.
SetStaticBatchingForPlatformSets static batching for the given BuildTarget.
SetTemplateCustomValueSets a value of a custom template variable.
SetUseDefaultGraphicsAPIsShould a build platform use automatic graphics API choice.
SetVirtualTexturingSupportEnabledEnable virtual texturing.

Classes

Class

Description

PlayerSettings.AndroidAndroid specific Player settings.
PlayerSettings.iOSiOS specific player settings.
PlayerSettings.SplashScreenInterface to splash screen player settings.
PlayerSettings.tvOStvOS specific player settings.
PlayerSettings.VisionOSVisionOS specific player settings.
PlayerSettings.WebGLWebGL specific player settings.
PlayerSettings.WSAProvides access to Microsoft Store App-specific player settings.

Structs

Struct

Description

PlayerSettings.SplashScreenLogoA single logo that is shown during the Splash Screen. Controls the Sprite that is displayed and its duration.
PlayerSettings.WSAFileTypeAssociationsRepresents the file types to register the application as a default handler for.
PlayerSettings.WSASupportedFileTypeRepresents a single file and content type to register the application as a default handler for.

Enums

Enum

Description

PlayerSettings.WSAApplicationForegroundTextValues for the color style of the title text that appears within the Universal Windows Platform application tiles.
PlayerSettings.WSAApplicationShowNameOptions for which tile types to display the application name on.
PlayerSettings.WSACapabilityOptions for Universal Windows Platform application capabilities.
PlayerSettings.WSADefaultTileSizeOptions for the application's default tile size.
PlayerSettings.WSAImageScaleOptions for the set of sizing values to apply to the Universal Windows Platform logo and icon images. These options specify variations for different screen sizes and resolutions.
PlayerSettings.WSAImageTypeOptions for the icon and logo image types that represent the application. For example, images to display within the Microsoft Store, start menu, or taskbar.
PlayerSettings.WSAInputSourceOptions for the input source from which a XAML application can receive pointer input events.
PlayerSettings.WSATargetFamilyOptions for the set of Universal Windows Platform device families your application can directly support.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.