PlayerSettings Manual     Reference     Scripting  
Scripting > Editor Classes > PlayerSettings
PlayerSettings Inherits from UnityEngine.Object

Player Settings is where you define various parameters for the final game that you will build in Unity. Some of these values are used in the Resolution Dialog that launches when you open a standalone game.

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Class Variables
companyName

The name of your company.

productName

The name of your product.

defaultScreenWidth

Default horizontal dimension of stand-alone player window.

defaultScreenHeight

Default vertical dimension of stand-alone player window.

defaultWebScreenWidth

Default horizontal dimension of web player window.

defaultWebScreenHeight

Default vertical dimension of web player window.

displayResolutionDialog

Defines the behaviour of the Resolution Dialog on product launch.

defaultIsFullScreen

If enabled, the game will default to fullscreen mode.

useAlphaInDashboard

Enables OSX Dashboard widgets with transparent backgrounds.

runInBackground

If enabled, your game will continue to run after lost focus.

captureSingleScreen

Defines if fullscreen games should darken secondary displays.

usePlayerLog

Write a log file with debugging information.

useMacAppStoreValidation

Enable receipt validation for the Mac App Store.

resolutionDialogBanner

The image to display in the Resolution Dialog window.

iPhoneBundleIdentifier

The bundle identifier of the iPhone application.

keystorePass

Password used for interacting with the Android Keystore.

keyaliasPass

Password for the key used for signing an Android application.

xboxTitleId

Xbox 360 title id

xboxImageXexFilePath

Xbox 360 ImageXex override configuration file path

xboxSpaFilePath

Xbox 360 SPA file path

xboxGenerateSpa

Xbox 360 _SPAConfig.cs auto-generation

xboxDeployKinectResources

Xbox 360 Kinect resource file deployment

xboxSkinOnGPU

Xbox 360 GPU skinning

bundleIdentifier

Application bundle identifier shared between iOS & Android platforms

bundleVersion

Application bundle version shared between iOS & Android platforms

strippingLevel

Managed code stripping level

defaultInterfaceOrientation

Default screen orientation for mobiles

allowedAutorotateToPortrait

Is auto-rotation to portrait supported?

allowedAutorotateToPortraitUpsideDown

Is auto-rotation to portrait upside-down supported?

allowedAutorotateToLandscapeRight

Is auto-rotation to landscape right supported?

allowedAutorotateToLandscapeLeft

Is auto-rotation to landscape left supported?

useOSAutorotation

Let the OS autorotate the screen as the device orientation changes.

apiCompatibilityLevel

.NET API compatibility level

advancedLicense

Is the advanced version being used?

aotOptions

Additional AOT compilation options. Shared by AOT platforms.

Class Functions
HasAspectRatio

Returns whether or not the specified aspect ratio is enabled.

SetAspectRatio

Enables the specified aspect ratio.

GetIconsForTargetGroup

Returns the list of assigned icons for the specified platform.

SetIconsForTargetGroup

Assign a list of icons for the specified platform.

GetIconSizesForTargetGroup

Returns a list of icon sizes for the specified platform.