Unity.Manual.Scripts

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 2723

DownloadUnity.Manual.Scripts
Open PDF In BrowserView PDF
Leave feedback

Description
A class containing methods to assist with accessibility for users with di erent vision capabilities.

Static Methods
GetColorBlindSafePalette

Gets a palette of colors that should be distinguishable for normal vision,
deuteranopia, protanopia, and tritanopia.

Leave feedback

Description
Unity Ads.

Static Properties
debugMode

Controls the amount of logging output from the advertisement system.

gameId

Returns the game identi er for the current platform.

isInitialized

Returns whether the advertisement system is initialized successfully.

isShowing

Returns whether an advertisement is currently being shown.

isSupported

Returns if the current platform is supported by the advertisement system.

testMode

Returns whether the testing mode is enabled.

version

Returns the current Unity Ads version.

Static Methods
GetPlacementState

Returns the placement state.

Initialize

Manually initializes the advertisement system. Normally this is done from editor, and
you should only call this method if you are using UnityAds with automatic initialization
disabled.

IsReady

Returns whether an advertisement is ready to be shown. Placements are con gured per
game in the UnityAds admin site, where you can also set your default placement.

SetMetaData

Sets various metadata for Unity Ads.

Show

Show an advertisement in your project.

Leave feedback
Obsolete

Description
Player debug message level.

Leave feedback

Description
Class for sending various metadata to UnityAds.

Properties
category

Metadata category.

Values

Public Methods
Get
Set

Sets new metadata elds.

Leave feedback

Description
Collection of options that can be passed to Advertisements.Show to modify advertisement behaviour.

Properties
gamerSid

Add a string to specify an identi er for a speci c user in the game.

resultCallback

Callback to recieve the result of the advertisement.

Leave feedback

Description
Various states that Unity Ads placements can be in.

Properties
Ready

Placement is ready to be shown an advertisement from.

NotAvailable

Placement is not available.

Disabled

Placement has been disabled.

Waiting

Placement is waiting to be ready.

NoFill

Placement has no advertisements to show.

Leave feedback

Description
ShowResult is passed to ShowOptions.resultCallback after the advertisement has completed.

Properties
Failed

Indicates that the advertisement failed to complete.

Skipped

Indicates that the advertisement was skipped.

Finished

Indicates that the advertisement completed successfully.

Leave feedback

Description
Singleton class to access the baked NavMesh.
The NavMesh is a class can be used to do spatial queries, like path nding and walkability tests, set the path nding
cost for speci c area types, and to tweak global behavior of path nding and avoidance.
In order to use the spatial queries, you need to rst bake NavMesh for your Scene.
See also:
• Building a NavMesh – for more information on how to setup and bake NavMesh
• Areas and Costs – to learn how to use di erent Area types.
• NavMeshAgent – to learn how to control and move NavMesh Agents.
• NavMeshObstacle – to learn how to control NavMesh Obstacles using scripting.
• O MeshLink – to learn how to control O -Mesh Links using scripting.

Static Properties
AllAreas

Area mask constant that includes all NavMesh areas.

avoidancePredictionTime

Describes how far in the future the agents predict collisions for avoidance.

onPreUpdate

Set a function to be called before the NavMesh is updated during the frame
update execution.

path ndingIterationsPerFrame

The maximum amount of nodes processed each frame in the asynchronous
path nding process.

Static Methods
AddLink

Adds a link to the NavMesh. The link is described by the NavMeshLinkData struct.

AddNavMeshData

Adds the speci ed NavMeshData to the game.

CalculatePath

Calculate a path between two points and store the resulting path.

CalculateTriangulation

Calculates triangulation of the current navmesh.

CreateSettings

Creates and returns a new entry of NavMesh build settings available for runtime
NavMesh building.

FindClosestEdge

Locate the closest NavMesh edge from a point on the NavMesh.

GetAreaCost

Gets the cost for path nding over geometry of the area type.

GetAreaFromName

Returns the area index for a named NavMesh area type.

GetSettingsByID

Returns an existing entry of NavMesh build settings.

GetSettingsByIndex

Returns an existing entry of NavMesh build settings by its ordered index.

GetSettingsCount

Returns the number of registered NavMesh build settings.

GetSettingsNameFromID

Returns the name associated with the NavMesh build settings matching the
provided agent type ID.

Raycast

Trace a line between two points on the NavMesh.

RemoveAllNavMeshData

Removes all NavMesh surfaces and links from the game.

RemoveLink

Removes a link from the NavMesh.

RemoveNavMeshData

Removes the speci ed NavMeshDataInstance from the game, making it
unavailable for agents and queries.

RemoveSettings

Removes the build settings matching the agent type ID.

SamplePosition

Finds the closest point on NavMesh within speci ed range.

SetAreaCost

Sets the cost for nding path over geometry of the area type on all agents.

Delegates
OnNavMeshPreUpdate

A delegate which can be used to register callback methods to be invoked before the
NavMesh system updates.

Leave feedback

Description
Navigation mesh agent.
This component is attached to a mobile character in the game to allow it to navigate the Scene using the
NavMesh. See the Navigation section of the manual for further details.

Properties
acceleration

The maximum acceleration of an agent as it follows a path, given in units / sec^2.

agentTypeID

The type ID for the agent.

angularSpeed

Maximum turning speed in (deg/s) while following a path.

areaMask

Speci es which NavMesh areas are passable. Changing areaMask will make the
path stale (see isPathStale).

autoBraking

Should the agent brake automatically to avoid overshooting the destination
point?

autoRepath

Should the agent attempt to acquire a new path if the existing path becomes
invalid?

autoTraverseO MeshLink

Should the agent move across O MeshLinks automatically?

avoidancePriority

The avoidance priority level.

baseO set

The relative vertical displacement of the owning GameObject.

currentO MeshLinkData

The current O MeshLinkData.

desiredVelocity

The desired velocity of the agent including any potential contribution from
avoidance. (Read Only)

destination

Gets or attempts to set the destination of the agent in world-space units.

hasPath

Does the agent currently have a path? (Read Only)

height

The height of the agent for purposes of passing under obstacles, etc.

isOnNavMesh

Is the agent currently bound to the navmesh? (Read Only)

isOnO MeshLink

Is the agent currently positioned on an O MeshLink? (Read Only)

isPathStale

Is the current path stale. (Read Only)

isStopped

This property holds the stop or resume condition of the NavMesh agent.

navMeshOwner

Returns the owning object of the NavMesh the agent is currently placed on (Read

Only).
nextO MeshLinkData

The next O MeshLinkData on the current path.

nextPosition

Gets or sets the simulation position of the navmesh agent.

obstacleAvoidanceType

The level of quality of avoidance.

path

Property to get and set the current path.

pathPending

Is a path in the process of being computed but not yet ready? (Read Only)

pathStatus

The status of the current path (complete, partial or invalid).

radius

The avoidance radius for the agent.

remainingDistance

The distance between the agent's position and the destination on the current
path. (Read Only)

speed

Maximum movement speed when following a path.

steeringTarget

Get the current steering target along the path. (Read Only)

stoppingDistance

Stop within this distance from the target position.

updatePosition

Gets or sets whether the transform position is synchronized with the simulated
agent position. The default value is true.

updateRotation

Should the agent update the transform orientation?

updateUpAxis

Allows you to specify whether the agent should be aligned to the up-axis of the
NavMesh or link that it is placed on.

velocity

Access the current velocity of the NavMeshAgent component, or set a velocity to
control the agent manually.

Public Methods
ActivateCurrentO MeshLink

Enables or disables the current o -mesh link.

CalculatePath

Calculate a path to a speci ed point and store the resulting path.

CompleteO MeshLink

Completes the movement on the current O MeshLink.

FindClosestEdge

Locate the closest NavMesh edge.

GetAreaCost

Gets the cost for path calculation when crossing area of a particular type.

Move

Apply relative movement to current position.

Raycast

Trace a straight path towards a target postion in the NavMesh without moving
the agent.

ResetPath

Clears the current path.

SamplePathPosition

Sample a position along the current path.

SetAreaCost

Sets the cost for traversing over areas of the area type.

SetDestination

Sets or updates the destination thus triggering the calculation for a new path.

SetPath

Assign a new path to this agent.

Warp

Warps agent to the provided position.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Specify which of the temporary data generated while building the NavMesh should be retained in memory after
the process has completed.
It is possible to collect and display in the Editor the intermediate data used in the process of building the
navigation mesh using the NavMeshBuilder. This can help with diagnosing those situations when the resulting
NavMesh isn’t of the expected shape.

Input Geometry, Regions, Polygonal Mesh Detail and Raw Contours shown after building the NavMesh with debug
options
The process for computing a NavMesh comprises of several sequential steps:
i. decomposing the Scene's terrain and meshes into triangles;
ii. rasterizing the input triangles into a 3D voxel representation and nding ledges;
iii. partitioning the voxels lying at the surface into simpler horizontal regions;
iv. nding a tight- tting contour for each of these regions;
v. simplifying the contours into polygonal shapes;
vi. creating a mesh of convex polygons based on all the contours combined;
vii. re ning the polygonal mesh into a triangulated version that approximates better the Scene's original
geometry.

Through the use of the debug functionality the results from each stage can be captured and displayed separately,
whereas normally they would get discarded when the NavMesh construction is completed.
Depending on the Scene composition this debug data can be considerably large in size. It is stored in memory in a
compressed manner but gets further expanded when being displayed.
Notes:
1. Unity does not save Debug visualizations - they are only available during the session in which Unity is building
the NavMesh.
2. Debug data is neither displayed nor collected for NavMeshes that are statically baked with the legacy system,
nor for any patches recomputed locally due to the presence of NavMesh Obstacles.
See Also: NavMeshBuildSettings, NavMeshBuilder.BuildNavMeshData, NavMeshEditorHelpers.DrawBuildDebug.

Properties
ags

Specify which types of debug data to collect when building the NavMesh.

Leave feedback

Description
Navigation mesh builder interface.
Note: There are two classes with the name NavMeshBuilder. They are declared in two di erent namespaces:
UnityEngine.AI and UnityEditor.AI. Their methods are all listed together on this page. The namespace is
indicated in parentheses next to each method.

Static Properties
isRunning

Returns true if an asynchronous build is still running. (UnityEditor)

Static Methods
BuildNavMesh

Build the Navmesh. (UnityEditor)

BuildNavMeshAsync

Build the Navmesh Asyncronously. (UnityEditor)

BuildNavMeshData

Builds a NavMesh data object from the provided input sources.
(UnityEngine)

BuildNavMeshForMultipleScenes

Builds the combined navmesh for the contents of multiple Scenes.
(UnityEditor)

Cancel

Cancel Navmesh construction. (UnityEditor) See Also:
NavMeshBuilder.BuildNavMeshAsync

ClearAllNavMeshes

Clear all Navmeshes. (UnityEditor)

CollectSources

For convenience, you can create a list of build sources directly from the
current geometry. (UnityEngine)

CollectSourcesInStage

Creates a list of build sources directly from the current geometry in the
speci ed editor stage. (UnityEditor)

UpdateNavMeshData

Incrementally updates the NavMeshData based on the sources.
(UnityEngine)

UpdateNavMeshDataAsync

Asynchronously and incrementally updates the NavMeshData based on
the sources. (UnityEngine)

Leave feedback

Description
The NavMesh build markup allows you to control how certain objects are treated during the NavMesh build
process, speci cally when collecting sources for building.
You can override the area type or specify that certain objects should be excluded from collected sources. The
markup is applied hierarchically. See Also: NavMeshBuilder.CollectSources.

Properties
area

The area type to use when override area is enabled.

ignoreFromBuild

Use this to specify whether the GameObject and its children should be ignored.

overrideArea

Use this to specify whether the area type of the GameObject and its children should be
overridden by the area type speci ed in this struct.

root

Use this to specify which GameObject (including the GameObject’s children) the markup
should be applied to.

Leave feedback

Description
The NavMeshBuildSettings struct allows you to specify a collection of settings which describe the dimensions and
limitations of a particular agent type.
You might want to de ne multiple NavMeshBuildSettings if your game involves characters with large di erences
in height, width or climbing ability.
You can also use this struct to control the precision and granularity of the build process, by setting the voxel and
tile sizes. Some of the values are coupled, meaning there are constraints on the values based on other values. For
example, it’s not valid for agentClimb to be larger than agentHeight. To help diagnose violations of these rules, a
special method ValidationReport can be evaluated.

Properties
agentClimb

The maximum vertical step size an agent can take.

agentHeight

The height of the agent for baking in world units.

agentRadius

The radius of the agent for baking in world units.

agentSlope

The maximum slope angle which is walkable (angle in degrees).

agentTypeID

The agent type ID the NavMesh will be baked for.

debug

Options for collecting debug data during the build process.

minRegionArea

The approximate minimum area of individual NavMesh regions.

overrideTileSize

Enables overriding the default tile size. See Also: tileSize.

overrideVoxelSize

Enables overriding the default voxel size. See Also: voxelSize.

tileSize

Sets the tile size in voxel units.

voxelSize

Sets the voxel size in world length units.

Public Methods
ValidationReport

Validates the properties of NavMeshBuildSettings.

Leave feedback

Description
The input to the NavMesh builder is a list of NavMesh build sources.
Their shape can be one of the following: mesh, terrain, box, sphere, or capsule. Each of them is described by a
NavMeshBuildSource struct.
You can specify a build source by lling a NavMeshBuildSource struct and adding that to the list of sources that
are passed to the bake function. Alternatively, you can use the collect API to quickly create NavMesh build sources
from available render meshes or physics colliders. See NavMeshBuilder.CollectSources.
If you use this function at runtime, any meshes with read/write access disabled will not be processed or included
in the nal NavMesh. See Mesh.isReadable.

using UnityEngine;
using UnityEngine.AI;

public class Example : MonoBehaviour
{
// Make a build source for a box in local space
public NavMeshBuildSource BoxSource10x10()
{
var src = new NavMeshBuildSource();
src.transform = transform.localToWorldMatrix;
src.shape = NavMeshBuildSourceShape.Box;
src.size = new Vector3(10.0f, 0.1f, 10.0f);
return src;
}
}

Properties
area

Describes the area type of the NavMesh surface for this object.

component

Points to the owning component - if available, otherwise null.

shape

The type of the shape this source describes. See Also: NavMeshBuildSourceShape.

size

Describes the dimensions of the shape.

sourceObject

Describes the object referenced for Mesh and Terrain types of input sources.

transform

Describes the local to world transformation matrix of the build source. That is, position
and orientation and scale of the shape.

Leave feedback

Description
Contains and represents NavMesh data.
An object of this class can be used for creating instances of NavMeshes. See NavMesh.AddNavMeshData. The
contained NavMesh can be built and updated using the build API. See NavMeshBuilder and methods therein.

Properties
position

Gets or sets the world space position of the NavMesh data.

rotation

Gets or sets the orientation of the NavMesh data.

sourceBounds

Returns the bounding volume of the input geometry used to build this NavMesh (Read
Only).

Constructors
NavMeshData

Constructs a new object for representing a NavMesh for the default agent type.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The instance is returned when adding NavMesh data.
A valid NavMesh data instance is available to the navigation system. This means you can calculate paths etc. using
that instance. You also need the instance if you want to remove the NavMesh data at a later time.
See Also: Remove, NavMesh.AddNavMeshData, NavMesh.RemoveNavMeshData.

Properties
owner

Get or set the owning Object.

valid

True if the NavMesh data is added to the navigation system - otherwise false (Read Only).

Public Methods
Remove

Removes this instance from the NavMesh system.

Leave feedback

Description
Result information for NavMesh queries.

Properties
distance

Distance to the point of hit.

hit

Flag set when hit.

mask

Mask specifying NavMesh area at point of hit.

normal

Normal at the point of hit.

position

Position of hit.

Leave feedback

Description
Used for runtime manipulation of links connecting polygons of the NavMesh.
A typical use case is to connect di erent navigation meshes. The link is described by the NavMeshLinkData struct.
The NavMesh Link is the scripting equivalent of the class-O MeshLink component – but allows for wide links as
opposed to just points.

Properties
agentTypeID

Speci es which agent type this link is available for.

area

Area type of the link.

bidirectional

If true, the link can be traversed in both directions, otherwise only from start to end
position.

costModi er

If positive, overrides the path nder cost to traverse the link.

endPosition

End position of the link.

startPosition

Start position of the link.

width

If positive, the link will be rectangle aligned along the line from start to end.

Leave feedback

Description
An instance representing a link available for path nding.
It can also be used for removing NavMesh links from the navigation system.

Properties
owner

Get or set the owning Object.

valid

True if the NavMesh link is added to the navigation system - otherwise false (Read Only).

Public Methods
Remove

Removes this instance from the game.

Leave feedback

Description
An obstacle for NavMeshAgents to avoid.
A NavMeshObstacle is cylindrical in shape and can move around the surface of the NavMesh with a speci ed
velocity. By default, the obstacle will only a ect the agent's avoidance behaviour rather than the path nding. This
means that the agent will ignore the obstacle when plotting a path but will sidestep around it while moving along
the path. If carving is enabled, the obstacle will create a temporary "hole" in the NavMesh. The hole will be
recognised by the path nding, so paths will be plotted to avoid the obstacle. This means that if, say, an obstacle
blocks a narrow gap, the path nding will seek an alternative route to the target. Without carving, the agent will
head for the gap but won't be able to pass until the obstacle is clear.
See Also: NavMeshAgent.

Properties
carveOnlyStationary

Should this obstacle be carved when it is constantly moving?

carving

Should this obstacle make a cut-out in the navmesh.

carvingMoveThreshold

Threshold distance for updating a moving carved hole (when carving is enabled).

carvingTimeToStationary

Time to wait until obstacle is treated as stationary (when carving and
carveOnlyStationary are enabled).

center

The center of the obstacle, measured in the object's local space.

height

Height of the obstacle's cylinder shape.

radius

Radius of the obstacle's capsule shape.

shape

The shape of the obstacle.

size

The size of the obstacle, measured in the object's local space.

velocity

Velocity at which the obstacle moves around the NavMesh.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A path as calculated by the navigation system.
The path is represented as a list of waypoints stored in the corners array. These points are not set directly from
user scripts but a NavMeshPath with points correctly assigned is returned by the NavMesh.CalculatePath function
and the NavMeshAgent.path property.

Properties
corners

Corner points of the path. (Read Only)

status

Status of the path. (Read Only)

Constructors
NavMeshPath

NavMeshPath constructor.

Public Methods
ClearCorners

Erase all corner points from path.

GetCornersNonAlloc

Calculate the corners for the path.

Leave feedback

Description
Speci es which agent type and areas to consider when searching the NavMesh.
This struct is used with the NavMesh query methods overloaded with the query lter argument. See Also:
NavMesh.CalculatePath, NavMesh.Raycast, NavMesh.FindClosestEdge, NavMesh.SamplePosition.

Properties
agentTypeID

The agent type ID, specifying which navigation meshes to consider for the query
functions.

areaMask

A bitmask representing the traversable area types.

Public Methods
GetAreaCost

Returns the area cost multiplier for the given area type for this lter.

SetAreaCost

Sets the path nding cost multiplier for this lter for a given area type.

Leave feedback

Description
Contains data describing a triangulation of a navmesh.

Properties
areas

NavMesh area indices for the navmesh triangulation.

indices

Triangle indices for the navmesh triangulation.

vertices

Vertices for the navmesh triangulation.

Leave feedback

Description
Link allowing movement outside the planar navigation mesh.

Properties
activated

Is link active.

area

NavMesh area index for this O MeshLink component.

autoUpdatePositions

Automatically update endpoints.

biDirectional

Can link be traversed in both directions.

costOverride

Modify path nding cost for the link.

endTransform

The transform representing link end position.

occupied

Is link occupied. (Read Only)

startTransform

The transform representing link start position.

Public Methods
UpdatePositions

Explicitly update the link endpoints.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
State of O MeshLink.

Properties
activated

Is link active (Read Only).

endPos

Link end world position (Read Only).

linkType

Link type speci er (Read Only).

o MeshLink

The O MeshLink if the link type is a manually placed O meshlink (Read Only).

startPos

Link start world position (Read Only).

valid

Is link valid (Read Only).

Leave feedback

Description
Bitmask used for operating with debug data from the NavMesh build process.
Used in two situations:
- within NavMeshBuildSettings.debug to specify which debug data to retain after the build process has completed,
preserving the world position and orientation;
- as a parameter of NavMeshEditorHelpers.DrawBuildDebug to control which of the available debug data types to
display for a speci ed NavMesh.
See Also: NavMeshBuildSettings.

Properties
None

No debug data from the NavMesh build process is taken into consideration.

InputGeometry

The triangles of all the geometry that is used as a base for computing the new
NavMesh.

Voxels

The voxels produced by rasterizing the source geometry into walkable and
unwalkable areas.

Regions

The segmentation of the traversable surfaces into smaller areas necessary for
producing simple polygons.

RawContours

The contours that follow precisely the edges of each surface region.

Simpli edContours

Contours bounding each of the surface regions, described through fewer vertices and
straighter edges compared to RawContours.

PolygonMeshes

Meshes of convex polygons constructed within the uni ed contours of adjacent
regions.

PolygonMeshesDetail

The triangulated meshes with height details that better approximate the source
geometry.

All

All debug data from the NavMesh build process is taken into consideration.

Leave feedback

Description
Used with NavMeshBuildSource to de ne the shape for building NavMesh.

Properties
Mesh

Describes a Mesh source for use with NavMeshBuildSource.

Terrain

Describes a TerrainData source for use with NavMeshBuildSource.

Box

Describes a box primitive for use with NavMeshBuildSource.

Sphere

Describes a sphere primitive for use with NavMeshBuildSource.

Capsule

Describes a capsule primitive for use with NavMeshBuildSource.

Modi erBox

Describes a Modi erBox source for use with NavMeshBuildSource.

Leave feedback

Description
Used for specifying the type of geometry to collect. Used with NavMeshBuilder.CollectSources.

Properties
RenderMeshes

Collect meshes form the rendered geometry.

PhysicsColliders

Collect geometry from the 3D physics collision representation.

Leave feedback

Description
Shape of the obstacle.

Properties
Capsule

Capsule shaped obstacle.

Box

Box shaped obstacle.

Leave feedback

Description
Status of path.

Properties
PathComplete

The path terminates at the destination.

PathPartial

The path cannot reach the destination.

PathInvalid

The path is invalid.

Leave feedback

Description
Level of obstacle avoidance.

Properties
NoObstacleAvoidance

Disable avoidance.

LowQualityObstacleAvoidance

Enable simple avoidance. Low performance impact.

MedQualityObstacleAvoidance

Medium avoidance. Medium performance impact.

GoodQualityObstacleAvoidance

Good avoidance. High performance impact.

HighQualityObstacleAvoidance

Enable highest precision. Highest performance impact.

Leave feedback

Description
Link type speci er.

Properties
LinkTypeManual

Manually speci ed type of link.

LinkTypeDropDown

Vertical drop.

LinkTypeJumpAcross

Horizontal jump.

Leave feedback

Description
Unity Analytics provides insight into your game users e.g. DAU, MAU.
Note: The documentation that follows is for usage of Unity Analytics with Unity 5.1 and above. To integrate Unity
Analytics with earlier versions of Unity, refer to the documentation at https://analytics.cloud.unity3d.com/docs
Speci cally, out-of-the-box features include access to user engagement and retention data through Metric
Monitor and Data Explorer. Segmentation of players across various user dimensions and characteristics is
automatically applied, with more than 20 standard segments available without any additional instrumentation.
For more detail around features, refer to the Unity Analytics homepage at http://unity3d.com/unity/analytics.

Static Properties
deviceStatsEnabled

Controls whether the sending of device stats at runtime is enabled.

enabled

Controls whether the Analytics service is enabled at runtime.

limitUserTracking

Controls whether to limit user tracking at runtime.

Static Methods
CustomEvent

Custom Events (optional).

FlushEvents

Attempts to ush immediately all queued analytics events to the network and lesystem
cache if possible (optional).

RegisterEvent

This API is used for registering a Runtime Analytics event. It is meant for internal use only
and is likely to change in the future. User code should never use this API.

SendEvent

This API is used to send a Runtime Analytics event. It is meant for internal use only and is
likely to change in the future. User code should never use this API.

SetUserBirthYear

User Demographics (optional).

SetUserGender

User Demographics (optional).

SetUserId

User Demographics (optional).

Transaction

Tracking Monetization (optional).

Leave feedback

Description
The main class of the Unity Analytics Standard Event SDK.
The event methods in this class provide ' re and forget' ease of use, allowing you to send a standard event with a
single line of code. If you expect to be sending the same standard event with some amount of frequency, you may
want to create an event payload and invoke the Send method when the event occurs. The event methods in this
class provide " re and forget" ease of use, allowing you to send a standard event with a single line of code. If you
expect to be sending the same standard event with some amount of frequency, you may want to create an event
payload and invoke the Send method when the event occurs.

Static Properties
debugMode

Gets or sets a value indicating whether debug mode is enabled.

sdkVersion

Gets the Unity Analytics Standard Event SDK version.

Static Methods
AchievementStep

Sends a achievement_step event.

AchievementUnlocked

Sends a achievement_unlocked event.

AdComplete

Sends a ad_complete event.

AdO er

Sends a ad_o er event.

AdSkip

Sends a ad_skip event.

AdStart

Sends a ad_start event.

ChatMessageSent

Sends a chat_message_sent event.

Custom

Sends a custom event (eventName) with data (eventData)

CustomEvent

Sends a custom event.

CutsceneSkip

Sends a cutscene_skip event.

CutsceneStart

Sends a cutscene_start event.

FirstInteraction

Sends a rst_interaction event.

GameOver

Sends a game_over event.

GameStart

Sends a game_start event.

IAPTransaction

Sends a iap_transaction event.

ItemAcquired

Sends a item_acquired event.

ItemSpent

Sends a item_spent event.

LevelComplete

Sends a level_complete event.

LevelFail

Sends a level_fail event.

LevelQuit

Sends a level_quit event.

LevelSkip

Sends a level_skip event.

LevelStart

Sends a level_start event.

LevelUp

Sends a level_up event.

PostAdAction

Sends a post_ad_action event.

PushNoti cationClick

Sends a push_noti cation_click event.

PushNoti cationEnable

Sends a push_noti cation_enable event.

ScreenVisit

Sends a screen_visit event.

SocialShare

Sends a social_share event.

SocialShareAccept

Sends a social_share_accept event.

StoreItemClick

Sends a store_item_click event.

StoreOpened

Sends a store_opened event.

TutorialComplete

Sends a tutorial_complete event.

TutorialSkip

Sends a tutorial_skip event.

TutorialStart

Sends a tutorial_start event.

TutorialStep

Sends a tutorial_step event.

UserSignup

Sends a user_signup event.

Leave feedback

Description
Provides access to the Analytics session information for the current game instance.
This class contains static methods for looking up Analytics session information. Note that cumulative statistics are
reset if the player re-installs the game.

using
using
using
using
using

System.Collections;
System.Collections.Generic;
UnityEngine;
UnityEngine.Analytics;
System;

public class NewBehaviourScript : MonoBehaviour
{
void Start()
{
Debug.Log("Start
" + AnalyticsSessionInfo.userId + " " + AnalyticsSess
AnalyticsSessionInfo.sessionStateChanged += OnSessionStateChanged;
}

void OnSessionStateChanged(AnalyticsSessionState sessionState, long sessionI
{
Debug.Log("Call
" + AnalyticsSessionInfo.userId + " " + sessionState
}
}

Static Properties
sessionCount

The number of sessions played since the app was installed.

sessionElapsedTime

The time elapsed, in milliseconds, since the beginning of the current game session.

sessionFirstRun

Reports whether the current session is the rst session since the player installed the
game or application.

sessionId

A random, unique GUID identifying the current game or app session.

sessionState

The current state of the session.

userId

A random GUID uniquely identifying sessions played on the same instance of your

game or app.

Events
sessionStateChanged

Dispatched when the Analytics session state changes.

Delegates
SessionStateChanged

Dispatched when the Analytics session state changes.

Leave feedback
Obsolete

Description
Automatically create and send analytics events based on a variety of triggers.
Set event name, parameter names, and automatically use parameter values either from properties of attached
Components or from literal values. Send the instrumented event.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with

Network.Instantiate.
OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Unity Performace provides insight into your game performace.

Static Properties
enabled

Controls whether the Performance Reporting service is enabled at runtime.

graphicsInitializationFinishTime

Time taken to initialize graphics in microseconds, measured from
application startup.

Leave feedback

Description
The source through which an item, consumable, or currency was acquired.

Properties
None

No available source, or source unknown. Note: Use a string value if the acquisition source
is not one of the elements de ned in this enumeration.

Store

Purchased using currency or consumable resources.

Earned

Awarded through an achievement or other in-game interaction.

Promotion

Granted as a promotion of some in-game feature or through cross promotion.

Gift

Granted without motive other than good feelings.

RewardedAd

Granted as a reward for watching an advertisement.

TimedReward

Granted periodically.

SocialReward

Granted through social engagement.

Leave feedback

Description
The type of currency (premium or soft) used to acquire the item.
See Also: AnalyticsEvent.ItemAcquired.

Properties
Soft

Not directly purchased with real-world money.

Premium

Purchased with real-world money.

Leave feedback

Description
The list of advertising or mediation network service providers.
Use the members of this list when possible to promote consistency in your Analytics data. However, if the
advertising network is not included in this list, pass the argument to the Standard Event function as a string.
See Also: AnalyticsEvent.AdComplete, AnalyticsEvent.AdO er, AnalyticsEvent.AdSkip, AnalyticsEvent.AdStart,
AnalyticsEvent.PostAdAction.

Properties
None

No available network, or network unknown. Note: Use a string value to indicate a network
not de ned in this enumeration.

Aarki

Aarki network.

AdAction

AdAction network.

AdapTv

AdapTv network.

Adcash

Adcash network.

AdColony

AdColony network.

AdMob

AdMob network.

AerServ

AerServ network.

Airpush

Airpush network.

Altrooz

Altrooz network.

Ampush

Ampush network.

AppleSearch

AppleSearch network.

AppLift

AppLift network.

AppLovin

AppLovin network.

Appnext

Appnext network.

AppNexus

AppNexus network.

Appoday

Appoday network.

Appodeal

Appodeal network.

AppsUnion

AppsUnion network.

Avazu

Avazu network.

BlueStacks

BlueStacks network.

Chartboost

Chartboost network.

ClickDealer

ClickDealer network.

CPAlead

CPAlead network.

CrossChannel

CrossChannel network.

CrossInstall

CrossInstall network.

Epom

Epom network.

Facebook

Facebook network.

Fetch

Fetch network.

Fiksu

Fiksu network.

Flurry

Flurry network.

Fuse

Fuse network.

Fyber

Fyber network.

Glispa

Glispa network.

Google

Google network.

GrowMobile

GrowMobile network.

HeyZap

HeyZap network.

HyperMX

HyperMX network.

Iddiction

Iddiction network.

IndexExchange

IndexExchange network.

InMobi

InMobi network.

Instagram

Instagram network.

Instal

Instal network.

Ipsos

Ipsos network.

IronSource

IronSource network.

Jirbo

Jirbo network.

Kimia

Kimia network.

Leadbolt

Leadbolt network.

Lifto

Lifto network.

Manage

Manage network.

Matomy

Matomy network.

MediaBrix

MediaBrix network.

MillenialMedia

MillenialMedia network.

Minimob

Minimob network.

MobAir

MobAir network.

MobileCore

MobileCore network.

Mobobeat

Mobobeat network.

Mobusi

Mobusi network.

Mobvista

Mobvista network.

MoPub

MoPub network.

Motive

Motive network.

Msales

Msales network.

NativeX

NativeX network.

OpenX

OpenX network.

Pandora

Pandora network.

PropellerAds

PropellerAds network.

Revmob

Revmob network.

RubiconProject

RubiconProject network.

SiriusAd

SiriusAd network.

Smaato

Smaato network.

SponsorPay

SponsorPay network.

SpotXchange

SpotXchange network.

StartApp

StartApp network.

Tapjoy

Tapjoy network.

Taptica

Taptica network.

Tremor

Tremor network.

TrialPay

TrialPay network.

Twitter

Twitter network.

UnityAds

UnityAds network.

Vungle

Vungle network.

Yeahmobi

Yeahmobi network.

YuMe

YuMe network.

Leave feedback

Description
Analytics API result.

Properties
Ok

Analytics API result: Success.

NotInitialized

Analytics API result: Analytics not initialized.

AnalyticsDisabled

Analytics API result: Analytics is disabled.

TooManyItems

Analytics API result: Too many parameters.

SizeLimitReached

Analytics API result: Argument size limit.

TooManyRequests

Analytics API result: Too many requests.

InvalidData

Analytics API result: Invalid argument value.

UnsupportedPlatform

Analytics API result: This platform doesn't support Analytics.

Leave feedback

Description
Session tracking states.

Properties
kSessionStopped

Session tracking has stopped.

kSessionStarted

Session tracking has started.

kSessionPaused

Session tracking has paused.

kSessionResumed

Session tracking has resumed.

Leave feedback

Description
The list of authorization networks for in-game login sessions.
Use the members of this list when possible to promote consistency in your Analytics data. However, if the
authorization network is not included in this list, pass the argument to the Standard Event function as a string.
See Also: AnalyticsEvent.UserSignup.

Properties
None

No available authorization network, or network unknown. Note: Use a string value to
indicate an authorization network not de ned in this enumeration.

Internal

You use your own authorization system.

Facebook

Facebook authorization.

Twitter

Twitter authorization.

Google

Google authorization.

GameCenter

GameCenter authorization.

Leave feedback

Description
User Demographics: Gender of a user.

Properties
Male

User Demographics: Male Gender of a user.

Female

User Demographics: Female Gender of a user.

Unknown

User Demographics: Unknown Gender of a user.

Leave feedback

Description
The list of the in-game screen or interface types.
Use the members of this list when possible to promote consistency in your Analytics data. However, if the screen
name is not included in this list, pass the argument to the Standard Event function as a string.
See Also: AnalyticsEvent.ScreenVisit.

Properties
None

No de ned screen name. Note: Use a string value to indicate a screen name not de ned
in this enumeration.

MainMenu

The game's main menu screen.

Settings

The game's settings screen.

Map

The game's map screen.

Lose

The screen shown when the player loses the game.

Win

The screen shown when the player wins the game.

Credits

The game's credits screen.

Title

The game's title screen.

IAPPromo

The screen shown for IAP promotions.

CrossPromo

The screen shown for cross promotions.

FeaturePromo

The screen shown for feature promotions.

Hint

The game's hint screen.

Pause

The game's pause screen.

Inventory

The game's inventory screen.

Leaderboard

The game's leaderboard screen.

Achievements

The game's achievement screen.

Lobby

The game's lobby screen.

Leave feedback

Description
The list of media types or modes used for social engagements.
Use the members of this list when possible to promote consistency in your Analytics data. However, if the media
type or mode is not included in this list, pass the argument to the Standard Event function as a string.
See Also: AnalyticsEvent.SocialShare, AnalyticsEvent.SocialShareAccept.

Properties
None

No de ned engagement media or mode. Note: Use a string value to indicate a mode of
social engagement not de ned in this enumeration.

TextOnly

A text-based mode of engagement, such as a text or chat message.

Image

An image-based mode of engagement.

Video

A video-based mode of engagement.

Invite

A mode of engagement that involves an invitation.

Achievement

An in-game achievement.

Leave feedback

Description
The list of social networks used with social engagements.
Use the members of this list when possible to promote consistency in your Analytics data. However, if the social
network is not included in this list, pass the argument to the Standard Event function as a string.
See Also: AnalyticsEvent.SocialShare, AnalyticsEvent.SocialShareAccept.

Properties
None

No available social network, or network unknown. Note: Use a string value to indicate
social network not de ned in this enumeration.

Facebook

Facebook.

Twitter

Twitter.

Instagram

Instagram.

GooglePlus

Google Plus.

Pinterest

Pinterest.

WeChat

WeChat.

SinaWeibo

The Sina Weibo social network.

TencentWeibo

The Tencent Weibo social network.

QQ

QQ and QZone networks.

Zhihu

Zhihu network.

VK

VKontakte network.

OK_ru

Odnoklassniki network.

Leave feedback

Description
The list of in-game store categories.
See Also: AnalyticsEvent.StoreItemClick, AnalyticsEvent.StoreOpened

Properties
Soft

Contains items purchasable with in-game currency only.

Premium

Contains items purchasable with real-world money.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the orientation of an object relative to the position of one or more source objects, such that the object
is facing the average position of the sources.

Properties
aimVector

The axis towards which the constrained object orients.

constraintActive

Activates or deactivates the constraint.

locked

Locks the o set and rotation at rest.

rotationAtRest

The rotation used when the sources have a total weight of 0.

rotationAxis

The axes a ected by the AimConstraint.

rotationO set

Represents an o set from the constrained orientation.

sourceCount

The number of sources set on the component (read-only).

upVector

The up vector.

weight

The weight of the constraint component.

worldUpObject

The world up object, used to calculate the world up vector when the world up Type is
AimConstraint.WorldUpType.ObjectUp or AimConstraint.WorldUpType.ObjectRotationUp.

worldUpType

The type of the world up vector.

worldUpVector

The world up Vector used when the world up type is AimConstraint.WorldUpType.Vector
or AimConstraint.WorldUpType.ObjectRotationUp.

Public Methods
AddSource

Adds a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Speci es how the world up vector used by the aim constraint is de ned.

Properties
SceneUp

Uses and de nes the world up vector as the Unity Scene up vector (the Y axis).

ObjectUp

Uses and de nes the world up vector as a vector from the constrained object, in the
direction of the up object.

ObjectRotationUp

Uses and de nes the world up vector as relative to the local space of the object.

Vector

Uses and de nes the world up vector as a vector speci ed by the user.

None

Neither de nes nor uses a world up vector.

Leave feedback
Implements interfaces:IPlayable

Description
A Playable that controls an AnimationClip.
NOTE: You can use PlayableExtensions methods with AnimationClipPlayable objects.

Public Methods
GetAnimationClip

Returns the AnimationClip stored in the AnimationClipPlayable.

GetApplyFootIK

Returns the state of the ApplyFootIK ag.

GetApplyPlayableIK

Returns the state of the ApplyPlayableIK ag.

SetApplyFootIK

Sets the value of the ApplyFootIK ag.

SetApplyPlayableIK

Requests OnAnimatorIK to be called on the animated GameObject.

Static Methods
Create

Creates an AnimationClipPlayable in the PlayableGraph.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls an animation layer mixer.
NOTE: You can use PlayableExtensions methods with AnimationLayerMixerPlayable objects.

Static Properties
Null

Returns an invalid AnimationLayerMixerPlayable.

Public Methods
IsLayerAdditive

Returns true if the layer is additive, false otherwise.

SetLayerAdditive

Speci es whether a layer is additive or not. Additive layers blend with
previous layers.

SetLayerMaskFromAvatarMask

Sets the mask for the current layer.

Static Methods
Create

Creates an AnimationLayerMixerPlayable in the PlayableGraph.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls an animation mixer.
NOTE: You can use PlayableExtensions methods with AnimationMixerPlayable objects.

Static Properties
Null

Returns an invalid AnimationMixerPlayable.

Static Methods
Create

Creates an AnimationMixerPlayable in the PlayableGraph.

Leave feedback

Description
A PlayableBinding that contains information representing an AnimationPlayableOutput.

Static Methods
Create

Creates a PlayableBinding that contains information representing an
AnimationPlayableOutput.

Leave feedback
Implements interfaces:IPlayableOutput

Description
A IPlayableOutput implementation that connects the PlayableGraph to an Animator in the Scene.
NOTE: You can use PlayableOutputExtensions methods on AnimationPlayableOutput objects.

Public Methods
GetTarget

Returns the Animator that plays the animation graph.

SetTarget

Sets the Animator that plays the animation graph.

Static Methods
Create

Creates an AnimationPlayableOutput in the PlayableGraph.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls an animation RuntimeAnimatorController.
NOTE: You can use PlayableExtensions methods with AnimatorControllerPlayable objects.

Static Properties
Null

Returns an invalid AnimatorControllerPlayable.

Static Methods
Create

Creates an AnimatorControllerPlayable in the PlayableGraph.

Leave feedback

Description
Represents a source for the constraint.

Properties
sourceTransform

The transform component of the source object.

weight

The weight of the source in the evaluation of the constraint.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the orientation of an object relative to the position of one or more source objects, such that the object
is facing the average position of the sources. The LookAtConstraint is a simpli ed AimConstraint typically used
with a Camera.

Properties
constraintActive

Activates or deactivates the constraint.

locked

Locks the o set and rotation at rest.

roll

The rotation angle along the z axis of the object. The constraint uses this property to
calculate the world up vector when Animations.LookAtConstraint.UseUpObject is false.

rotationAtRest

The rotation used when the sources have a total weight of 0.

rotationO set

Represents an o set from the constrained orientation.

sourceCount

The number of sources set on the component (Read Only).

useUpObject

Determines how the up vector is calculated.

weight

The weight of the constraint component.

worldUpObject

The world up object, used to calculate the world up vector when
Animations.LookAtConstraint.UseUpObject is true.

Public Methods
AddSource

Adds a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Inherited Members
Properties

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy

instead.
DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the orientation and translation of an object to one or more source objects. The constrained object
behaves as if it is in the hierarchy of the sources.

Properties
constraintActive

Activates or deactivates the constraint.

locked

Locks the o sets and position (translation and rotation) at rest.

rotationAtRest

The rotation used when the sources have a total weight of 0.

rotationAxis

The rotation axes a ected by the ParentConstraint.

rotationO sets

The rotation o sets from the constrained orientation.

sourceCount

The number of sources set on the component (read-only).

translationAtRest

The position of the object in local space, used when the sources have a total weight of 0.

translationAxis

The translation axes a ected by the ParentConstraint.

translationO sets

The translation o sets from the constrained orientation.

weight

The weight of the constraint component.

Public Methods
AddSource

Adds a constraint source.

GetRotationO set

Gets the rotation o set associated with a source by index.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

GetTranslationO set

Gets the rotation o set associated with a source by index.

RemoveSource

Removes a source from the component.

SetRotationO set

Sets the rotation o set associated with a source by index.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

SetTranslationO set

Sets the translation o set associated with a source by index.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the position of an object relative to the position of one or more source objects.

Properties
constraintActive

Activates or deactivates the constraint.

locked

Locks the o set and position at rest.

sourceCount

The number of sources set on the component (read-only).

translationAtRest

The translation used when the sources have a total weight of 0.

translationAxis

The axes a ected by the PositionConstraint.

translationO set

The o set from the constrained position.

weight

The weight of the constraint component.

Public Methods
AddSource

Adds a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the rotation of an object relative to the rotation of one or more source objects.

Properties
constraintActive

Activates or deactivates the constraint.

locked

Locks the o set and rotation at rest.

rotationAtRest

The rotation used when the sources have a total weight of 0.

rotationAxis

The axes a ected by the RotationConstraint.

rotationO set

The o set from the constrained rotation.

sourceCount

The number of sources set on the component (read-only).

weight

The weight of the constraint component.

Public Methods
AddSource

Adds a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IConstraint

Description
Constrains the scale of an object relative to the scale of one or more source objects.

Properties
constraintActive

Activates or deactivates the constraint.

locked

Locks the o set and scale at rest.

scaleAtRest

The scale used when the sources have a total weight of 0.

scaleO set

The o set from the constrained scale.

scalingAxis

The axes a ected by the ScaleConstraint.

sourceCount

The number of sources set on the component (read-only).

weight

The weight of the constraint component.

Public Methods
AddSource

Adds a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The common interface for constraint components.

Properties
constraintActive

Activate or deactivate the constraint.

locked

Lock or unlock the o set and position at rest.

sourceCount

Gets the number of sources currently set on the component.

weight

The weight of the constraint component.

Public Methods
AddSource

Add a constraint source.

GetSource

Gets a constraint source by index.

GetSources

Gets the list of sources.

RemoveSource

Removes a source from the component.

SetSource

Sets a source at a speci ed index.

SetSources

Sets the list of sources on the component.

Leave feedback

Description
Represents the axes used in 3D space.

Properties
None

Represents the case when no axis is speci ed.

X

Represents the X axis.

Y

Represents the Y axis.

Z

Represents the Z axis.

Leave feedback

Description
ReplayKit is only available on certain iPhone, iPad and iPod Touch devices running iOS 9.0 or later.
ReplayKit allows you to record the audio and video of your game, along with user commentary through the
microphone. Start a recording with the StartRecording() function, and stop it with StopRecording(). You can
preview the recording with the Preview() function, which launches a separate video viewer.
Note: The exact Apple devices which have support for ReplayKit are:
1. iPhone 5S or later
2. iPad mini 2 or later
3. iPod Touch 6th generation
4. iPad Air or later.

using System;
using UnityEngine;
#if PLATFORM_IOS
using UnityEngine.iOS;
using UnityEngine.Apple.ReplayKit;

public class Replay : MonoBehaviour
{
string lastError = "";
void OnGUI()
{
if (!ReplayKit.APIAvailable)
{
return;
}
var recording = ReplayKit.isRecording;
string caption = recording ? "Stop Recording" : "Start Recording";
if (GUI.Button(new Rect(10, 10, 500, 200), caption))
{
try
{
recording = !recording;
if (recording)
{
ReplayKit.StartRecording();
}
else
{

ReplayKit.StopRecording();
}
}
catch (Exception e)
{
lastError = e.ToString();
}
}

GUI.Label(new Rect(10, 220, 500, 50), "Last error: " + ReplayKit.lastErr
GUI.Label(new Rect(10, 280, 500, 50), "Last exception: " + lastError);

if (ReplayKit.recordingAvailable)
{
if (GUI.Button(new Rect(10, 350, 500, 200), "Preview"))
{
ReplayKit.Preview();
}
if (GUI.Button(new Rect(10, 560, 500, 200), "Discard"))
{
ReplayKit.Discard();
}
}
}
}
#endif

Static Properties
APIAvailable

A boolean that indicates whether the ReplayKit API is available (where True means
available). (Read Only)

broadcastingAPIAvailable

A Boolean that indicates whether ReplayKit broadcasting API is available (true
means available) (Read Only). Check the value of this property before making
ReplayKit broadcasting API calls. On iOS versions prior to iOS 10, this property will
have a value of false.

broadcastURL

A string property that contains an URL used to redirect the user to an on-going or
completed broadcast (Read Only).

cameraEnabled

Camera enabled status, true, if camera enabled, false otherwise.

isBroadcasting

Boolean property that indicates whether a broadcast is currently in progress
(Read Only).

isRecording

A boolean that indicates whether ReplayKit is making a recording (where True
means a recording is in progress). (Read Only)

lastError

A string value of the last error incurred by the ReplayKit: Either 'Failed to get
Screen Recorder' or 'No recording available'. (Read Only)

microphoneEnabled

Microphone enabled status, true, if microhone enabled, false otherwise.

recordingAvailable

A boolean value that indicates that a new recording is available for preview (where
True means available). (Read Only)

Static Methods
Discard

Discard the current recording.

HideCameraPreview

Hide the camera preview view.

Preview

Preview the current recording

ShowCameraPreviewAt

Shows camera preview at coordinates posX and posY.

StartBroadcasting

Initiates and starts a new broadcast When StartBroadcast is called, user is presented
with a broadcast provider selection screen, and then a broadcast setup screen.
Once it is nished, a broadcast will be started, and the callback will be invoked. It will
also be invoked in case of any error.

StartRecording

Start a new recording.

StopBroadcasting

Stops current broadcast. Will terminate currently on-going broadcast. If no
broadcast is in progress, does nothing.

StopRecording

Stop the current recording.

Delegates
BroadcastStatusCallback

Function called at the completion of broadcast startup.

Leave feedback

Description
A oat comparer used by Assert performing approximate comparison.

Static Properties
kEpsilon

Default epsilon used by the comparer.

s_ComparerWithDefaultTolerance

Default instance of a comparer class with deafult error epsilon and
absolute error check.

Constructors
FloatComparer

Creates an instance of the comparer.

Static Methods
AreEqual

Performs equality check with absolute error check.

AreEqualRelative

Performs equality check with relative error check.

Leave feedback
Obsolete

Description
An extension class that serves as a wrapper for the Assert class.
The MustExtension class wraps the Assertion.Assert into a more readable and shorter syntax.

using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Must;

public class ExampleClass : MonoBehaviour
{
public int health;
public GameObject go;
void Update()
{
//This assertion
Assert.AreNotEqual(0, health);
//can be also written like this
health.MustNotBeEqual(0);

//Same with this assertion
Assert.IsTrue(go.activeInHierarchy);
//can be also written like this
go.activeInHierarchy.MustBeTrue();
}
}

Leave feedback

Description
The Assert class contains assertion methods for setting invariants in the code.
All method calls will be conditionally included only in the development builds, unless explicitly speci ed (see
BuildOptions.ForceEnableAssertions). The inclusion of the assertions is controlled by UNITY_ASSERTIONS de ne.
A failure of an assertion method does not break the control ow of the execution. On a failure, an assertion
message is logged (LogType.Assert) and the execution continues. If Assert.raiseExceptions is set to true, an
AssertionException is thrown instead of logging a message.
If a debugger is attached to the project (System.Diagnostics.Debugger.IsAttached is true), AssertionException will
be thrown in order to pause the excecution and invoke the debugger.

using UnityEngine;
using UnityEngine.Assertions;

public class AssertionExampleClass : MonoBehaviour
{
public int health;
public GameObject go;

void Update()
{
// You expect the health never to be equal to zero
Assert.AreNotEqual(0, health);

// The referenced GameObject should be always (in every frame) be active
Assert.IsTrue(go.activeInHierarchy);
}
}

Static Properties
raiseExceptions

Whether Unity should throw an exception on a failure.

Static Methods

AreApproximatelyEqual

Asserts that the values are approximately equal. An absolute error check is used
for approximate equality check (|a-b| < tolerance). Default tolerance is
0.00001f.Note: Every time you call the method with tolerance speci ed, a new
instance of FloatComparer is created. For performance reasons you might want
to instance your own comparer and pass it to the AreEqual method. If the
tolerance is not speci es, a default comparer is used and the issue does not
occur.

AreEqual

Asserts that the values are equal. If no comparer is speci ed,
EqualityComparer.Default is used.

AreNotApproximatelyEqual

Asserts that the values are approximately not equal. An absolute error check is
used for approximate equality check (|a-b| < tolerance). Default tolerance is
0.00001f.

AreNotEqual

Asserts that the values are not equal.

IsFalse

Asserts that the condition is false.

IsNotNull

Asserts that the value is not null.

IsNull

Asserts that the value is null.

IsTrue

Asserts that the condition is true.

Leave feedback

Description
An exception that is thrown on a failure. Assert.raiseExceptions needs to be set to true.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls an AudioClip.
NOTE: You can use PlayableExtensions methods with AudioClipPlayable objects.

Static Methods
Create

Creates an AudioClipPlayable in the PlayableGraph.

Leave feedback

Description
AudioMixer asset.
This is a singleton representing a speci c audio mixer asset in the project.

Properties
outputAudioMixerGroup

Routing target.

updateMode

How time should progress for this AudioMixer. Used during Snapshot transitions.

Public Methods
ClearFloat

Resets an exposed parameter to its initial value.

FindMatchingGroups

Connected groups in the mixer form a path from the mixer's master group to the
leaves. This path has the format "Master Group/Child of Master Group/Grandchild of
Master Group", so to nd the grandchild group in this example, a valid search string
would be for instance "randchi" which would return exactly one group while "hild" or
"oup/" would return 2 di erent groups.

FindSnapshot

The name must be an exact match.

GetFloat

Returns the value of the exposed parameter speci ed. If the parameter doesn't exist
the function returns false. Prior to calling SetFloat and after ClearFloat has been
called on this parameter the value returned will be that of the current snapshot or
snapshot transition.

SetFloat

Sets the value of the exposed parameter speci ed. When a parameter is exposed, it
is not controlled by mixer snapshots and can therefore only be changed via this
function.

TransitionToSnapshots

Transitions to a weighted mixture of the snapshots speci ed. This can be used for
games that specify the game state as a continuum between states or for
interpolating snapshots from a triangulated map location.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Object representing a group in the mixer.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls an audio mixer.
NOTE: You can use PlayableExtensions methods with AudioMixerPlayable objects.

Leave feedback

Description
Object representing a snapshot in the mixer.

Public Methods
TransitionTo

Performs an interpolated transition towards this snapshot over the time interval speci ed.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A PlayableBinding that contains information representing an AudioPlayableOutput.

Static Methods
Create

Creates a PlayableBinding that contains information representing an
AudioPlayableOutput.

Leave feedback
Implements interfaces:IPlayableOutput

Description
A IPlayableOutput implementation that will be used to play audio.
NOTE: You can use PlayableOutputExtensions methods with AudioPlayableOutput objects.

Static Properties
Null

Returns an invalid AudioPlayableOutput.

Public Methods
GetEvaluateOnSeek

Gets the state of output playback when seeking.

SetEvaluateOnSeek

Controls whether the output should play when seeking.

Static Methods
Create

Creates an AudioPlayableOutput in the PlayableGraph.

Leave feedback

Description
The mode in which an AudioMixer should update its time.
Use this with AudioMixer.updateMode to de ne how the AudioMixer time is updated.

Properties
Normal

Update the AudioMixer with scaled game time.

UnscaledTime

Update the AudioMixer with unscaled realtime.

Leave feedback

Description
Engine API for CrashReporting Service.

Static Properties
enableCaptureExceptions

This Boolean eld will cause CrashReportHandler to capture exceptions when set
to true. By default enable capture exceptions is true.

logBu erSize

The Performance Reporting service will keep a bu er of up to the last X log
messages (Debug.Log, etc) to send along with crash reports. The default is 10 log
messages, the max is 50. Set this to 0 to disable capture of logs with your crash
reports.

Static Methods
GetUserMetadata

Get a custom crash report metadata eld that has been set.

SetUserMetadata

Set a custom metadata key-value pair to be included with crash reports.

Leave feedback

Description
A zero argument persistent callback that can be saved with the Scene.

using UnityEngine;
using UnityEngine.Events;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
UnityEvent m_MyEvent;

void Start()
{
if (m_MyEvent == null)
m_MyEvent = new UnityEvent();

m_MyEvent.AddListener(Ping);
}

void Update()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke();
}
}

void Ping()
{
Debug.Log("Ping");
}
}

Constructors

UnityEvent

Constructor.

Public Methods
AddListener

Add a non persistent listener to the UnityEvent.

Invoke

Invoke all registered callbacks (runtime and persistent).

RemoveListener

Remove a non persistent listener from the UnityEvent.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
One argument version of UnityEvent.
If you wish to use a generic UnityEvent type you must override the class type.

using UnityEngine;
using UnityEngine.Events;

[System.Serializable]
public class MyIntEvent : UnityEvent
{
}

public class ExampleClass : MonoBehaviour
{
public MyIntEvent m_MyEvent;

void Start()
{
if (m_MyEvent == null)
m_MyEvent = new MyIntEvent();

m_MyEvent.AddListener(Ping);
}

void Update()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke(5);
}
}

void Ping(int i)
{
Debug.Log("Ping" + i);

}
}

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Two argument version of UnityEvent.
If you wish to use a generic UnityEvent type you must override the class type.

using UnityEngine;
using UnityEngine.Events;

[System.Serializable]
public class MyIntEvent : UnityEvent
{
}

public class ExampleClass : MonoBehaviour
{
public MyIntEvent m_MyEvent;

void Start()
{
if (m_MyEvent == null)
m_MyEvent = new MyIntEvent();

m_MyEvent.AddListener(Ping);
}

void Update()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke(5, 6);
}
}

void Ping(int i, int j)
{
Debug.Log("Ping" + i + ", " + j);

}
}

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Three argument version of UnityEvent.
If you wish to use a generic UnityEvent type you must override the class type.

using UnityEngine;
using UnityEngine.Events;

[System.Serializable]
public class MyIntEvent : UnityEvent
{
}

public class ExampleClass : MonoBehaviour
{
public MyIntEvent m_MyEvent;

void Start()
{
if (m_MyEvent == null)
m_MyEvent = new MyIntEvent();

m_MyEvent.AddListener(Ping);
}

void Update()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke(5, 6, 7);
}
}

void Ping(int i, int j, int k)
{
Debug.Log("Ping" + i + j + k);

}
}

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Four argument version of UnityEvent.
If you wish to use a generic UnityEvent type you must override the class type.

using UnityEngine;
using UnityEngine.Events;

[System.Serializable]
public class MyIntEvent : UnityEvent
{
}

public class ExampleClass : MonoBehaviour
{
public MyIntEvent m_MyEvent;

void Start()
{
if (m_MyEvent == null)
m_MyEvent = new MyIntEvent();

m_MyEvent.AddListener(Ping);
}

void Update()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke(5, 6, 7, 8);
}
}

void Ping(int i, int j, int k, int l)
{

Debug.Log("Ping" + i + j + k + l);
}
}

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback
Implements interfaces:ISerializationCallbackReceiver

Description
Abstract base class for UnityEvents.
This class provides the base functionality for the UnityEvents.

Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
THe mode that a listener is operating in.

Properties
EventDe ned

The listener will use the function binding speci ed by the even.

Void

The listener will bind to zero argument functions.

Object

The listener will bind to one argument Object functions.

Int

The listener will bind to one argument int functions.

Float

The listener will bind to one argument oat functions.

String

The listener will bind to one argument string functions.

Bool

The listener will bind to one argument bool functions.

Leave feedback

Description
Controls the scope of UnityEvent callbacks.

Properties
O

Callback is not issued.

EditorAndRuntime

Callback is always issued.

RuntimeOnly

Callback is only issued in the Runtime and Editor playmode.

Leave feedback

Description
A class that can be used for sending simple events via the event system.

Properties
used

Is the event used?

Public Methods
Reset

Reset the event.

Use

Use the event.

Leave feedback

Description
Event Data associated with Axis Events (Controller / Keyboard).
See Also: BaseEventData.

Properties
moveDir

MoveDirection for this event.

moveVector

Raw input vector associated with this event.

Inherited Members
Properties
used

Is the event used?

currentInputModule

A reference to the BaseInputModule that sent this event.

selectedObject

The object currently considered selected by the EventSystem.

Public Methods
Reset

Reset the event.

Use

Use the event.

Leave feedback

Description
A class that contains the base event data that is common to all event types in the new EventSystem.

Properties
currentInputModule

A reference to the BaseInputModule that sent this event.

selectedObject

The object currently considered selected by the EventSystem.

Constructors
BaseEventData

Construct a BaseEventData tied to the passed EventSystem.

Inherited Members
Properties
used

Is the event used?

Public Methods
Reset

Reset the event.

Use

Use the event.

Leave feedback

Description
Interface to the Input system used by the BaseInputModule. With this it is possible to bypass the Input system
with your own but still use the same InputModule. For example this can be used to feed fake input into the UI or
interface with a di erent input system.

Properties
compositionCursorPos

Interface to Input.compositionCursorPos. Can be overridden to provide custom
input instead of using the Input class.

compositionString

Interface to Input.compositionString. Can be overridden to provide custom input
instead of using the Input class.

imeCompositionMode

Interface to Input.imeCompositionMode. Can be overridden to provide custom input
instead of using the Input class.

mousePosition

Interface to Input.mousePosition. Can be overridden to provide custom input
instead of using the Input class.

mousePresent

Interface to Input.mousePresent. Can be overridden to provide custom input instead
of using the Input class.

mouseScrollDelta

Interface to Input.mouseScrollDelta. Can be overridden to provide custom input
instead of using the Input class.

touchCount

Interface to Input.touchCount. Can be overridden to provide custom input instead of
using the Input class.

touchSupported

Interface to Input.touchSupported. Can be overridden to provide custom input
instead of using the Input class.

Public Methods
GetAxisRaw

Interface to Input.GetAxisRaw. Can be overridden to provide custom input instead of
using the Input class.

GetButtonDown

Interface to Input.GetButtonDown. Can be overridden to provide custom input
instead of using the Input class.

GetMouseButton

Interface to Input.GetMouseButton. Can be overridden to provide custom input
instead of using the Input class.

GetMouseButtonDown

Interface to Input.GetMouseButtonDown. Can be overridden to provide custom
input instead of using the Input class.

GetMouseButtonUp

Interface to Input.GetMouseButtonUp. Can be overridden to provide custom input
instead of using the Input class.

GetTouch

Interface to Input.GetTouch. Can be overridden to provide custom input instead of
using the Input class.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
A base module that raises events and sends them to GameObjects.
An Input Module is a component of the EventSystem that is responsible for raising events and sending them to
GameObjects for handling. The BaseInputModule is a class that all Input Modules in the EventSystem inherit
from. Examples of provided modules are TouchInputModule and StandaloneInputModule, if these are inadequate
for your project you can create your own by extending from the BaseInputModule.

using UnityEngine;
using UnityEngine.EventSystems;

// Create a module that every tick sends a 'Move' event to
// the target object

public class MyInputModule : BaseInputModule
{
public GameObject m_TargetObject;

public override void Process()
{
if (m_TargetObject == null)
return;
ExecuteEvents.Execute(m_TargetObject, new BaseEventData(eventSystem), Ex
}
}

Properties
input

The current BaseInput being used by the input module.

inputOverride

Used to override the default BaseInput for the input module.

Public Methods
ActivateModule

Called when the module is activated. Override this if you want custom code to
execute when you activate your module.

DeactivateModule

Called when the module is deactivated. Override this if you want custom code to
execute when you deactivate your module.

IsModuleSupported

Check to see if the module is supported. Override this if you have a platfrom
speci c module (eg. TouchInputModule that you do not want to activate on
standalone.

IsPointerOverGameObject

Is the pointer with the given ID over an EventSystem object?

Process

Process the current tick for the module.

ShouldActivateModule

Should be activated.

UpdateModule

Update the internal state of the Module.

Protected Methods
GetAxisEventData

Given some input data generate an AxisEventData that can be used by the event
system.

GetBaseEventData

Generate a BaseEventData that can be used by the EventSystem.

HandlePointerExitAndEnter

Handle sending enter and exit events when a new enter target is found.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

Static Methods
DetermineMoveDirection

Given an input movement, determine the best MoveDirection.

FindCommonRoot

Given 2 GameObjects, return a common root GameObject (or null).

FindFirstRaycast

Return the rst valid RaycastResult.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine

running on this behaviour.
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with

Network.Instantiate.
OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Base class for any RayCaster.
A Raycaster is responsible for raycasting against Scene elements to determine if the cursor is over them. Default
Raycasters include PhysicsRaycaster, Physics2DRaycaster, GraphicRaycaster.
Custom raycasters can be added by extending this class.

Properties
eventCamera

The camera that will generate rays for this raycaster.

renderOrderPriority

Priority of the raycaster based upon render order.

sortOrderPriority

Priority of the raycaster based upon sort order.

Public Methods
Raycast

Raycast against the Scene.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Handles input, raycasting, and sending events.
The EventSystem is responsible for processing and handling events in a Unity Scene. A Scene should only contain
one EventSystem. The EventSystem works in conjunction with a number of modules and mostly just holds state
and delegates functionality to speci c, overrideable components.
When the EventSystem is started it searches for any BaseInputModules attached to the same GameObject and
adds them to an internal list. On update each attached module receives an UpdateModules call, where the
module can modify internal state. After each module has been Updated the active module has the Process call
executed. This is where custom module processing can take place.

Static Properties
current

Return the current EventSystem.

Properties
alreadySelecting

Returns true if the EventSystem is already in a SetSelectedGameObject.

currentInputModule

The currently active BaseInputModule.

currentSelectedGameObject

The GameObject currently considered active by the EventSystem.

rstSelectedGameObject

The GameObject that was selected rst.

isFocused

Flag to say whether the EventSystem thinks it should be paused or not based
upon focused state.

pixelDragThreshold

The soft area for dragging in pixels.

sendNavigationEvents

Should the EventSystem allow navigation events (move / submit / cancel).

Public Methods
IsPointerOverGameObject

Is the pointer with the given ID over an EventSystem object?

RaycastAll

Raycast into the Scene using all con gured BaseRaycasters.

SetSelectedGameObject

Set the GameObject as selected. Will send an OnDeselect the the old selected
object and OnSelect to the new selected object.

UpdateModules

Recalculate the internal list of BaseInputModules.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:IBeginDragHandler, ICancelHandler, IDeselectHandler, IDragHandler, IDropHandler,
IEndDragHandler, IEventSystemHandler, IInitializePotentialDragHandler, IMoveHandler, IPointerClickHandler,
IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler, IPointerUpHandler, IScrollHandler,
ISelectHandler, ISubmitHandler, IUpdateSelectedHandler

Description
Receives events from the EventSystem and calls registered functions for each event.
The EventTrigger can be used to specify functions you wish to be called for each EventSystem event. You can
assign multiple functions to a single event and whenever the EventTrigger receives that event it will call those
functions in the order they were provided.
NOTE: Attaching this component to a GameObject will make that object intercept ALL events, and no events will
propagate to parent objects.
There are two ways to intercept events: You could extend EventTrigger, and override the functions for the events
you are interested in intercepting; as shown in this example:

using UnityEngine;
using UnityEngine.EventSystems;

public class EventTriggerExample : EventTrigger
{
public override void OnBeginDrag(PointerEventData data)
{
Debug.Log("OnBeginDrag called.");
}

public override void OnCancel(BaseEventData data)
{
Debug.Log("OnCancel called.");
}

public override void OnDeselect(BaseEventData data)
{
Debug.Log("OnDeselect called.");
}

public override void OnDrag(PointerEventData data)

{
Debug.Log("OnDrag called.");
}

public override void OnDrop(PointerEventData data)
{
Debug.Log("OnDrop called.");
}

public override void OnEndDrag(PointerEventData data)
{
Debug.Log("OnEndDrag called.");
}

public override void OnInitializePotentialDrag(PointerEventData data)
{
Debug.Log("OnInitializePotentialDrag called.");
}

public override void OnMove(AxisEventData data)
{
Debug.Log("OnMove called.");
}

public override void OnPointerClick(PointerEventData data)
{
Debug.Log("OnPointerClick called.");
}

public override void OnPointerDown(PointerEventData data)
{
Debug.Log("OnPointerDown called.");
}

public override void OnPointerEnter(PointerEventData data)
{
Debug.Log("OnPointerEnter called.");
}

public override void OnPointerExit(PointerEventData data)
{
Debug.Log("OnPointerExit called.");
}

public override void OnPointerUp(PointerEventData data)
{
Debug.Log("OnPointerUp called.");
}

public override void OnScroll(PointerEventData data)
{
Debug.Log("OnScroll called.");
}

public override void OnSelect(BaseEventData data)
{
Debug.Log("OnSelect called.");
}

public override void OnSubmit(BaseEventData data)
{
Debug.Log("OnSubmit called.");
}

public override void OnUpdateSelected(BaseEventData data)
{
Debug.Log("OnUpdateSelected called.");
}
}

...or you can specify individual delegates:

using UnityEngine;
using UnityEngine.EventSystems;

public class EventTriggerDelegateExample : MonoBehaviour
{
void Start()
{
EventTrigger trigger = GetComponent();
EventTrigger.Entry entry = new EventTrigger.Entry();
entry.eventID = EventTriggerType.PointerDown;
entry.callback.AddListener((data) => { OnPointerDownDelegate((PointerEve
trigger.triggers.Add(entry);
}

public void OnPointerDownDelegate(PointerEventData data)
{
Debug.Log("OnPointerDownDelegate called.");
}
}

Properties
triggers

All the functions registered in this EventTrigger.

Public Methods
OnBeginDrag

Called before a drag is started.

OnCancel

Called by the EventSystem when a Cancel event occurs.

OnDeselect

Called by the EventSystem when a new object is being selected.

OnDrag

Called by the EventSystem every time the pointer is moved during dragging.

OnDrop

Called by the EventSystem when an object accepts a drop.

OnEndDrag

Called by the EventSystem once dragging ends.

OnInitializePotentialDrag

Called by the EventSystem when a drag has been found, but before it is valid to
begin the drag.

OnMove

Called by the EventSystem when a Move event occurs.

OnPointerClick

Called by the EventSystem when a Click event occurs.

OnPointerDown

Called by the EventSystem when a PointerDown event occurs.

OnPointerEnter

Called by the EventSystem when the pointer enters the object associated with this
EventTrigger.

OnPointerExit

Called by the EventSystem when the pointer exits the object associated with this
EventTrigger.

OnPointerUp

Called by the EventSystem when a PointerUp event occurs.

OnScroll

Called by the EventSystem when a Scroll event occurs.

OnSelect

Called by the EventSystem when a Select event occurs.

OnSubmit

Called by the EventSystem when a Submit event occurs.

OnUpdateSelected

Called by the EventSystem when the object associated with this EventTrigger is
updated.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

p
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this

object's collider (2D physics only).
OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over

the same GUIElement or Collider as it was pressed.
OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
An Entry in the EventSystem delegates list.
It stores the callback and which event type should this callback be red.

Properties
callback

The desired TriggerEvent to be Invoked.

eventID

What type of event is the associated callback listening for.

Leave feedback

Description
UnityEvent class for Triggers.
See EventTrigger for example usage.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Helper class that can be used to send IEventSystemHandler events to GameObjects.

Static Properties
beginDragHandler

IBeginDragHandler execute helper function.

cancelHandler

ICancelHandler execute helper function.

deselectHandler

IDeselectHandler execute helper function.

dragHandler

IDragHandler execute helper function.

dropHandler

IDropHandler execute helper function.

endDragHandler

IEndDragHandler execute helper function.

initializePotentialDrag

IInitializePotentialDragHandler execute helper function.

moveHandler

IMoveHandler execute helper function.

pointerClickHandler

IPointerClickHandler execute helper function.

pointerDownHandler

IPointerDownHandler execute helper function.

pointerEnterHandler

IPointerEnterHandler execute helper function.

pointerExitHandler

IPointerExitHandler execute helper function.

pointerUpHandler

IPointerUpHandler execute helper function.

scrollHandler

IScrollHandler execute helper function.

selectHandler

ISelectHandler execute helper function.

submitHandler

ISubmitHandler execute helper function.

updateSelectedHandler

IUpdateSelectedHandler execute helper function.

Static Methods
CanHandleEvent

Can the given GameObject handle the IEventSystemHandler of type T.

Execute

Execute the event of type T : IEventSystemHandler on GameObject.

ExecuteHierarchy

Recurse up the hierarchy calling Execute until there is a GameObject that can handle
the event.

GetEventHandler

Traverse the object hierarchy starting at root, and return the GameObject which
implements the event handler of type .

ValidateEventData

Attempt to convert the data to type T. If conversion fails an ArgumentException is
thrown.

Delegates
EventFunction

Function de nition for an EventFunction that is used to map a given EventInterface into
a speci c event call.

Leave feedback

Description
Raycaster for casting against 2D Physics components.
See: BaseRaycaster.

Public Methods
Raycast

See: BaseRaycaster.

Inherited Members
Properties
eventCamera

The camera that will generate rays for this raycaster.

renderOrderPriority

Priority of the raycaster based upon render order.

sortOrderPriority

Priority of the raycaster based upon sort order.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

depth

Get the depth of the con gured camera.

eventCamera

Get the camera that is used for this module.

eventMask

Mask of allowed raycast events.

nalEventMask
maxRayIntersections

Logical and of Camera mask and eventMask.
Max number of ray intersection allowed to be found.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

ComputeRayAndDistance

Returns a ray going from camera through the event position and the
distance between the near and far clipping planes along that ray.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this

object's collider (2D physics only).
OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over

the same GUIElement or Collider as it was pressed.
OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Raycaster for casting against 3D Physics components.
See: BaseRaycaster.

Properties
depth

Get the depth of the con gured camera.

eventCamera

Get the camera that is used for this module.

eventMask

Mask of allowed raycast events.

nalEventMask

Logical and of Camera mask and eventMask.

maxRayIntersections

Max number of ray intersection allowed to be found.

Public Methods
Raycast

See: BaseRaycaster.

Protected Methods
ComputeRayAndDistance

Returns a ray going from camera through the event position and the distance
between the near and far clipping planes along that ray.

Inherited Members
Properties
eventCamera

The camera that will generate rays for this raycaster.

renderOrderPriority

Priority of the raycaster based upon render order.

sortOrderPriority

Priority of the raycaster based upon sort order.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine

running on this behaviour.
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this

object (2D physics only).
OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Event payload associated with pointer (mouse / touch) events.

Properties
button

The InputButton for this event.

clickCount

Number of clicks in a row.

clickTime

The last time a click event was sent.

delta

Pointer delta since last update.

dragging

Is a drag operation currently occuring.

enterEventCamera

The camera associated with the last OnPointerEnter event.

hovered

List of objects in the hover stack.

lastPress

The GameObject for the last press event.

pointerCurrentRaycast

RaycastResult associated with the current event.

pointerDrag

The object that is receiving OnDrag.

pointerEnter

The object that received 'OnPointerEnter'.

pointerId

Identi cation of the pointer.

pointerPress

The GameObject that received the OnPointerDown.

pointerPressRaycast

RaycastResult associated with the pointer press.

position

Current pointer position.

pressEventCamera

The camera associated with the last OnPointerPress event.

pressPosition

The screen space coordinates of the last pointer click.

rawPointerPress

The object that the press happened on even if it can not handle the press event.

scrollDelta

The amount of scroll since the last update.

useDragThreshold

Should a drag threshold be used?

Public Methods
IsPointerMoving

Is the pointer moving.

IsScrolling

Is scroll being used on the input device.

Inherited Members
Properties
used

Is the event used?

currentInputModule

A reference to the BaseInputModule that sent this event.

selectedObject

The object currently considered selected by the EventSystem.

Public Methods
Reset

Reset the event.

Use

Use the event.

Leave feedback

Description
The state of a press for the given frame.

Properties
Pressed

Button was pressed this frame.

Released

Button was released this frame.

PressedAndReleased

Button was pressed and released this frame.

NotChanged

Same as last frame.

Leave feedback

Description
Input press tracking.

Properties
Left

Left button.

Right

Right button.

Middle

Middle button.

Leave feedback

Description
A BaseInputModule for pointer input.
Used by TouchInputModule and StandaloneInputModule.

Static Properties
kFakeTouchesId

Touch id for when simulating touches on a non touch device.

kMouseLeftId

Id of the cached left mouse pointer event.

kMouseMiddleId

Id of the cached middle mouse pointer event.

kMouseRightId

Id of the cached right mouse pointer event.

Protected Methods
ClearSelection

Clear all pointers and deselect any selected objects in the EventSystem.

CopyFromTo

Copy one PointerEventData to another.

DeselectIfSelectionChanged

Deselect the current selected GameObject if the currently pointed-at
GameObject is di erent.

GetLastPointerEventData

Return the last PointerEventData for the given touch / mouse id.

GetMousePointerEventData

Return the current MouseState.

GetPointerData

Search the cache for currently active pointers, return true if found.

GetTouchPointerEventData

Given a touch populate the PointerEventData and return if we are pressed or
released.

ProcessDrag

Process the drag for the current frame with the given pointer event.

ProcessMove

Process movement for the current frame with the given pointer event.

RemovePointerData

Remove the PointerEventData from the cache.

StateForMouseButton

Given a mouse button return the current state for the frame.

Inherited Members
Properties
input

The current BaseInput being used by the input module.

inputOverride

Used to override the default BaseInput for the input module.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ActivateModule

Called when the module is activated. Override this if you want custom code to
execute when you activate your module.

DeactivateModule

Called when the module is deactivated. Override this if you want custom code to
execute when you deactivate your module.

IsModuleSupported

Check to see if the module is supported. Override this if you have a platfrom
speci c module (eg. TouchInputModule that you do not want to activate on
standalone.

IsPointerOverGameObject

Is the pointer with the given ID over an EventSystem object?

Process

Process the current tick for the module.

ShouldActivateModule

Should be activated.

UpdateModule

Update the internal state of the Module.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
GetAxisEventData

Given some input data generate an AxisEventData that can be used by
the event system.

GetBaseEventData

Generate a BaseEventData that can be used by the EventSystem.

HandlePointerExitAndEnter

Handle sending enter and exit events when a new enter target is
found.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
DetermineMoveDirection

Given an input movement, determine the best MoveDirection.

FindCommonRoot

Given 2 GameObjects, return a common root GameObject (or null).

FindFirstRaycast

Return the rst valid RaycastResult.

print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use
Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new
Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Information about a mouse button event.

Properties
buttonData

Pointer data associated with the mouse event.

buttonState

The state of the button this frame.

Public Methods
PressedThisFrame

Was the button pressed this frame?

ReleasedThisFrame

Was the button released this frame?

Leave feedback

Description
A hit result from a BaseRaycaster.

Properties
depth

The relative depth of the element.

distance

Distance to the hit.

gameObject

The GameObject that was hit by the raycast.

index

Hit index.

isValid

Is there an associated module and a hit GameObject.

module

BaseInputModule that raised the hit.

screenPosition

The screen position from which the raycast was generated.

sortingLayer

The SortingLayer of the hit object.

sortingOrder

The SortingOrder for the hit object.

worldNormal

The normal at the hit location of the raycast.

worldPosition

The world position of the where the raycast has hit.

Public Methods
Clear

Reset the result.

Leave feedback

Description
A BaseInputModule designed for mouse / keyboard / controller input.
Input module for working with, mouse, keyboard, or controller.

Properties
cancelButton

Input manager name for the 'cancel' button.

forceModuleActive

Force this module to be active.

horizontalAxis

Input manager name for the horizontal axis button.

inputActionsPerSecond

Number of keyboard / controller inputs allowed per second.

repeatDelay

Delay in seconds before the input actions per second repeat rate takes e ect.

submitButton

Maximum number of input events handled per second.

verticalAxis

Input manager name for the vertical axis.

Public Methods
ActivateModule

See BaseInputModule.

DeactivateModule

See BaseInputModule.

IsModuleSupported

See BaseInputModule.

Process

See BaseInputModule.

ShouldActivateModule

See BaseInputModule.

UpdateModule

See BaseInputModule.

Protected Methods
ProcessMouseEvent

Iterate through all the di erent mouse events.

ProcessMousePress

Calculate and process any mouse button state changes.

ProcessTouchPress

This method is called by Unity whenever a touch event is processed.
Override this method with a custom implementation to process touch
events yourself.

SendMoveEventToSelectedObject

Calculate and send a move event to the current selected object.

SendSubmitEventToSelectedObject

Calculate and send a submit event to the current selected object.

SendUpdateEventToSelectedObject

Send a update event to the currently selected object.

Inherited Members
Static Properties
kFakeTouchesId

Touch id for when simulating touches on a non touch device.

kMouseLeftId

Id of the cached left mouse pointer event.

kMouseMiddleId

Id of the cached middle mouse pointer event.

kMouseRightId

Id of the cached right mouse pointer event.

Properties
input

The current BaseInput being used by the input module.

inputOverride

Used to override the default BaseInput for the input module.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
IsPointerOverGameObject

Is the pointer with the given ID over an EventSystem object?

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
GetAxisEventData

Given some input data generate an AxisEventData that can be used by
the event system.

GetBaseEventData

Generate a BaseEventData that can be used by the EventSystem.

HandlePointerExitAndEnter

Handle sending enter and exit events when a new enter target is
found.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

ClearSelection

Clear all pointers and deselect any selected objects in the
EventSystem.

CopyFromTo

Copy one PointerEventData to another.

DeselectIfSelectionChanged

Deselect the current selected GameObject if the currently pointed-at
GameObject is di erent.

GetLastPointerEventData

Return the last PointerEventData for the given touch / mouse id.

GetMousePointerEventData

Return the current MouseState.

GetPointerData

Search the cache for currently active pointers, return true if found.

GetTouchPointerEventData

Given a touch populate the PointerEventData and return if we are
pressed or released.

ProcessDrag

Process the drag for the current frame with the given pointer event.

ProcessMove

Process movement for the current frame with the given pointer event.

RemovePointerData

Remove the PointerEventData from the cache.

StateForMouseButton

Given a mouse button return the current state for the frame.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
DetermineMoveDirection

Given an input movement, determine the best MoveDirection.

FindCommonRoot

Given 2 GameObjects, return a common root GameObject (or null).

FindFirstRaycast

Return the rst valid RaycastResult.

print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use
Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new
Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Obsolete

Description
Input module used for touch based input.

Inherited Members
Static Properties
kFakeTouchesId

Touch id for when simulating touches on a non touch device.

kMouseLeftId

Id of the cached left mouse pointer event.

kMouseMiddleId

Id of the cached middle mouse pointer event.

kMouseRightId

Id of the cached right mouse pointer event.

Properties
input

The current BaseInput being used by the input module.

inputOverride

Used to override the default BaseInput for the input module.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ActivateModule

Called when the module is activated. Override this if you want custom code to
execute when you activate your module.

DeactivateModule

Called when the module is deactivated. Override this if you want custom code to
execute when you deactivate your module.

IsModuleSupported

Check to see if the module is supported. Override this if you have a platfrom
speci c module (eg. TouchInputModule that you do not want to activate on
standalone.

IsPointerOverGameObject

Is the pointer with the given ID over an EventSystem object?

Process

Process the current tick for the module.

ShouldActivateModule

Should be activated.

UpdateModule

Update the internal state of the Module.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
GetAxisEventData

Given some input data generate an AxisEventData that can be used by
the event system.

GetBaseEventData

Generate a BaseEventData that can be used by the EventSystem.

HandlePointerExitAndEnter

Handle sending enter and exit events when a new enter target is
found.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

ClearSelection

Clear all pointers and deselect any selected objects in the
EventSystem.

CopyFromTo

Copy one PointerEventData to another.

DeselectIfSelectionChanged

Deselect the current selected GameObject if the currently pointed-at
GameObject is di erent.

GetLastPointerEventData

Return the last PointerEventData for the given touch / mouse id.

GetMousePointerEventData

Return the current MouseState.

GetPointerData

Search the cache for currently active pointers, return true if found.

GetTouchPointerEventData

Given a touch populate the PointerEventData and return if we are
pressed or released.

ProcessDrag

Process the drag for the current frame with the given pointer event.

ProcessMove

Process movement for the current frame with the given pointer event.

RemovePointerData

Remove the PointerEventData from the cache.

StateForMouseButton

Given a mouse button return the current state for the frame.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
DetermineMoveDirection

Given an input movement, determine the best MoveDirection.

FindCommonRoot

Given 2 GameObjects, return a common root GameObject (or null).

FindFirstRaycast

Return the rst valid RaycastResult.

print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use
Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new
Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with

Network.Instantiate.
OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Base behaviour that has protected implementations of Unity lifecycle functions.

Public Methods
IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a

network view.
OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnBeginDrag callbacks.
Note: You need to implement IDragHandler in addition to IBeginDragHandler.
See Also: IDragHandler.

Public Methods
OnBeginDrag

Called by a BaseInputModule before a drag is started.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnCancel callbacks.

Public Methods
OnCancel

Called by a BaseInputModule when a Cancel event occurs.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnDeselect callbacks.

Public Methods
OnDeselect

Called by the EventSystem when a new object is being selected.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnDrag callbacks.

using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

[RequireComponent(typeof(Image))]
public class DragMe : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHa
{
public bool dragOnSurfaces = true;

private GameObject m_DraggingIcon;
private RectTransform m_DraggingPlane;

public void OnBeginDrag(PointerEventData eventData)
{
var canvas = FindInParents(gameObject);
if (canvas == null)
return;

// We have clicked something that can be dragged.
// What we want to do is create an icon for this.
m_DraggingIcon = new GameObject("icon");

m_DraggingIcon.transform.SetParent(canvas.transform, false);
m_DraggingIcon.transform.SetAsLastSibling();

var image = m_DraggingIcon.AddComponent();

image.sprite = GetComponent().sprite;
image.SetNativeSize();

if (dragOnSurfaces)
m_DraggingPlane = transform as RectTransform;
else
m_DraggingPlane = canvas.transform as RectTransform;

SetDraggedPosition(eventData);
}

public void OnDrag(PointerEventData data)
{
if (m_DraggingIcon != null)
SetDraggedPosition(data);
}

private void SetDraggedPosition(PointerEventData data)
{
if (dragOnSurfaces && data.pointerEnter != null && data.pointerEnter.tra
m_DraggingPlane = data.pointerEnter.transform as RectTransform;

var rt = m_DraggingIcon.GetComponent();
Vector3 globalMousePos;
if (RectTransformUtility.ScreenPointToWorldPointInRectangle(m_DraggingPl
{
rt.position = globalMousePos;
rt.rotation = m_DraggingPlane.rotation;
}
}

public void OnEndDrag(PointerEventData eventData)
{
if (m_DraggingIcon != null)
Destroy(m_DraggingIcon);
}

static public T FindInParents(GameObject go) where T : Component
{
if (go == null) return null;
var comp = go.GetComponent();

if (comp != null)
return comp;

Transform t = go.transform.parent;
while (t != null && comp == null)
{
comp = t.gameObject.GetComponent();
t = t.parent;
}
return comp;
}
}

Public Methods
OnDrag

When draging is occuring this will be called every time the cursor is moved.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnDrop callbacks.

using UnityEngine;
using UnityEngine.EventSystems;

public class Example : MonoBehaviour, IDropHandler
{
public void OnDrop(PointerEventData data)
{
if (data.pointerDrag != null)
{
Debug.Log("Dropped object was: " + data.pointerDrag);
}
}
}

Public Methods
OnDrop

Called by a BaseInputModule on a target that can accept a drop.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnEndDrag callbacks.
Note: You need to implement IDragHandler in addition to IEndDragHandler.
See Also: IDragHandler.

Public Methods
OnEndDrag

Called by a BaseInputModule when a drag is ended.

Leave feedback

Description
Base class that all EventSystem events inherit from.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnInitializePotentialDrag callbacks.

Public Methods
OnInitializePotentialDrag

Called by a BaseInputModule when a drag has been found but before it is valid to
begin the drag.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnMove callbacks.

Public Methods
OnMove

Called by a BaseInputModule when a move event occurs.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnPointerClick callbacks.
Use the IPointerClickHandler Interface to handle click input using OnPointerClick callbacks. Ensure an Event
System exists in the Scene to allow click detection. For click detection on non-UI GameObjects, ensure a
PhysicsRaycaster is attached to the Camera.

using UnityEngine;
using UnityEngine.EventSystems;

public class Example : MonoBehaviour, IPointerClickHandler
{
//Detect if a click occurs
public void OnPointerClick(PointerEventData pointerEventData)
{
//Output to console the clicked GameObject's name and the following mess
Debug.Log(name + " Game Object Clicked!");
}
}

Public Methods
OnPointerClick

Use this callback to detect clicks.

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnPointerDown callbacks.
Detects ongoing mouse clicks until release of the mouse button. Use IPointerUpHandler to handle the release of
the mouse button.

//Attach this script to the GameObject you would like to have mouse clicks detec
//This script outputs a message to the Console when a click is currently detecte

using UnityEngine;
using UnityEngine.EventSystems;

public class Example : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
//Detect current clicks on the GameObject (the one with the script attached)
public void OnPointerDown(PointerEventData pointerEventData)
{
//Output the name of the GameObject that is being clicked
Debug.Log(name + "Game Object Click in Progress");
}

//Detect if clicks are no longer registering
public void OnPointerUp(PointerEventData pointerEventData)
{
Debug.Log(name + "No longer being clicked");
}
}

Public Methods
OnPointerDown

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnPointerEnter callbacks.
Use to detect when the mouse begins to hover over a certain GameObject. To detect when the mouse stops
hovering over the GameObject, use IPointerExitHandler.

//Attach this script to the GameObject you would like to have mouse hovering det
//This script outputs a message to the Console when the mouse pointer is current

using UnityEngine;
using UnityEngine.EventSystems;

public class Example : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
//Detect if the Cursor starts to pass over the GameObject
public void OnPointerEnter(PointerEventData pointerEventData)
{
//Output to console the GameObject's name and the following message
Debug.Log("Cursor Entering " + name + " GameObject");
}

//Detect when Cursor leaves the GameObject
public void OnPointerExit(PointerEventData pointerEventData)
{
//Output the following message with the GameObject's name
Debug.Log("Cursor Exiting " + name + " GameObject");
}
}

Public Methods
OnPointerEnter

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnPointerExit callbacks.

Public Methods
OnPointerExit

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnPointerUp callbacks.
Note: In order to receive OnPointerUp callbacks, you must also implement the IPointerDownHandler interface

Public Methods
OnPointerUp

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnScroll callbacks.

Public Methods
OnScroll

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnSelect callbacks.

Public Methods
OnSelect

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnSubmit callbacks.

Public Methods
OnSubmit

Leave feedback
Implements interfaces:IEventSystemHandler

Description
Interface to implement if you wish to receive OnUpdateSelected callbacks.

Public Methods
OnUpdateSelected

Called by the EventSystem when the object associated with this EventTrigger is updated.

Leave feedback

Description
Enum that tracks event State.

Properties
Unused

Unused.

Used

Used.

Leave feedback

Description
The type of event the TriggerEvent is intercepting.

Properties
PointerEnter

Intercepts a IPointerEnterHandler.OnPointerEnter.

PointerExit

Intercepts a IPointerExitHandler.OnPointerExit.

PointerDown

Intercepts a IPointerDownHandler.OnPointerDown.

PointerUp

Intercepts a IPointerUpHandler.OnPointerUp.

PointerClick

Intercepts a IPointerClickHandler.OnPointerClick.

Drag

Intercepts a IDragHandler.OnDrag.

Drop

Intercepts a IDropHandler.OnDrop.

Scroll

Intercepts a IScrollHandler.OnScroll.

UpdateSelected

Intercepts a IUpdateSelectedHandler.OnUpdateSelected.

Select

Intercepts a ISelectHandler.OnSelect.

Deselect

Intercepts a IDeselectHandler.OnDeselect.

Move

Intercepts a IMoveHandler.OnMove.

InitializePotentialDrag

Intercepts IInitializePotentialDrag.InitializePotentialDrag.

BeginDrag

Intercepts IBeginDragHandler.OnBeginDrag.

EndDrag

Intercepts IEndDragHandler.OnEndDrag.

Submit

Intercepts ISubmitHandler.Submit.

Cancel

Intercepts ICancelHandler.OnCancel.

Leave feedback

Description
This is an 8 direction movement enum.
MoveDirection provides a way of switching between moving states. You must assign these states to actions, such
as moving the GameObject by an up vector when in the Up state.
Having states like these are easier to identify than always having to include a large amount of vectors and
calculations. Instead, you de ne what you want the state to do in only one part, and switch to the appropriate
state when it is needed.

//This is a full example of how a GameObject changes direction using MoveDirecti
//Assign this script to a visible GameObject (with a Rigidbody attached) to see

using UnityEngine;
using UnityEngine.EventSystems;

public class Example : MonoBehaviour
{
Vector3 m_StartPosition, m_StartForce;
Rigidbody m_Rigidbody;
//Use Enum for easy switching between direction states
MoveDirection m_MoveDirection;

//Use these Vectors for moving Rigidbody components
Vector3 m_ResetVector;
Vector3 m_UpVector;
Vector3 m_RightVector;
const float speed = 5.0f;

void Start()
{
//You get the Rigidbody component attached to the GameObject
m_Rigidbody = GetComponent();
//This starts with the Rigidbody not moving in any direction at all
m_MoveDirection = MoveDirection.None;

//These are the GameObject’s starting position and Rigidbody position

m_StartPosition = transform.position;
m_StartForce = m_Rigidbody.transform.position;

//This Vector is set to 1 in the y axis (for moving upwards)
m_UpVector = Vector3.up;
//This Vector is set to 1 in the x axis (for moving in the right directi
m_RightVector = Vector3.right;
//This Vector is zeroed out for when the Rigidbody should not move
m_ResetVector = Vector3.zero;
}

void Update()
{
//This switches the direction depending on button presses
switch (m_MoveDirection)
{
//The starting state which resets the object
case MoveDirection.None:
//Reset to the starting position of the GameObject and Rigidbody
transform.position = m_StartPosition;
m_Rigidbody.transform.position = m_StartForce;
//This resets the velocity of the Rigidbody
m_Rigidbody.velocity = m_ResetVector;
break;

//This is for moving in an upwards direction
case MoveDirection.Up:
//Change the velocity so that the Rigidbody travels upwards
m_Rigidbody.velocity = m_UpVector * speed;
break;

//This is for moving left
case MoveDirection.Left:
//This moves the Rigidbody to the left (minus right Vector)
m_Rigidbody.velocity = -m_RightVector * speed;
break;

//This is for moving right
case MoveDirection.Right:
//This moves the Rigidbody to the right
m_Rigidbody.velocity = m_RightVector * speed;

break;

//This is for moving down
case MoveDirection.Down:
//This moves the Rigidbody down
m_Rigidbody.velocity = -m_UpVector * speed;
break;
}
}

void OnGUI()
{
//Press the reset Button to switch to no mode
if (GUI.Button(new Rect(100, 0, 150, 30), "Reset"))
{
//Switch to start/reset case
m_MoveDirection = MoveDirection.None;
}

//Press the Left button to switch the Rigidbody direction to the left
if (GUI.Button(new Rect(100, 30, 150, 30), "Move Left"))
{
//Switch to the left direction
m_MoveDirection = MoveDirection.Left;
}

//Press the Up button to switch the Rigidbody direction to upwards
if (GUI.Button(new Rect(100, 60, 150, 30), "Move Up"))
{
//Switch to Up Direction
m_MoveDirection = MoveDirection.Up;
}

//Press the Down button to switch the direction to down
if (GUI.Button(new Rect(100, 90, 150, 30), "Move Down"))
{
//Switch to Down Direction
m_MoveDirection = MoveDirection.Down;
}

//Press the right button to switch to the right direction
if (GUI.Button(new Rect(100, 120, 150, 30), "Move Right"))
{
//Switch to Right Direction
m_MoveDirection = MoveDirection.Right;
}
}
}

Properties
Left

This is the Left state of MoveDirection. Assign functionality for moving to the left.

Up

This is the Up state of MoveDirection. Assign functionality for moving in an upward
direction.

Right

This is the Right state of MoveDirection. Assign functionality for moving to the right.

Down

The Down State of MoveDirection. Assign functionality for moving in a downward
direction.

None

This is the None state. Assign functionality that stops movement.

Leave feedback

Description
A world position that is guaranteed to be on the surface of the NavMesh.
The NavMeshLocation stores the position on the NavMesh surface together with the PolygonId of the NavMesh
node containing that position. Using NavMeshLocations with NavMeshQuery operations remove the need to
project the desired world position onto the NavMesh at the beginning of each and every operation.
A NavMeshLocation can be invalid in two situations: 1. When it has been created empty, instead of being the
result of a NavMeshQuery operation. 2. When the NavMesh has been removed or modi ed at the indicated
position or in its close vicinity.
If a NavMeshLocation is made invalid by a NavMeshObstacle carving the NavMesh in its vicinity the
NavMeshLocation returns to a valid state if the NavMeshObstacle is removed. This is because removing a
NavMeshObstacle restores the NavMesh to its original form without regenerating it.
See Also: NavMeshQuery.MapLocation, NavMeshQuery.IsValid, PolygonId.

Properties
polygon

Unique identi er for the node in the NavMesh to which the world position has been
mapped.

position

A world position that sits precisely on the surface of the NavMesh or along its links.

Leave feedback

Description
Object used for doing navigation operations in a NavMeshWorld.
NavMeshQuery operations can be executed inside jobs (IJob, IJobParallelFor), as opposed to the operations in the
NavMesh-related structures.
To obtain a path between two locations on the NavMesh, the query must have been created with a
pathNodePoolSize value greater than 0 and the following methods need to be called in sequence:
BeginFindPath, UpdateFindPath (repeatedly, if necessary), EndFindPath, GetPathResult. These methods
rely on storing some state data inside the NavMeshQuery but all the other methods do not change the object's
state and can be called any time.
All methods throw exceptions if any of their parameters are not valid when executed in the Editor.
Note: The intended feature set for NavMeshQuery is not yet fully complete.

Constructors
NavMeshQuery

Creates the NavMeshQuery object and allocates memory to store NavMesh node
information, if required.

Public Methods
BeginFindPath

Initiates a path nding operation between two locations on the NavMesh.

CreateLocation

Returns a valid NavMeshLocation for a position and a polygon provided by the
user.

Dispose

Destroys the NavMeshQuery and deallocates all memory used by it.

EndFindPath

Obtains the number of nodes in the path that has been computed during a
successful NavMeshQuery.UpdateFindPath operation.

GetAgentTypeIdForPolygon

Returns the identi er of the agent type the NavMesh was baked for or for
which the link has been con gured.

GetPathResult

Copies into the provided array the list of NavMesh nodes that form the path
found by the NavMeshQuery operation.

GetPolygonType

Returns whether the NavMesh node is a polygon or a link.

GetPortalPoints

Obtains the end points of the line segment common to two adjacent NavMesh
nodes.

IsValid

Returns true if the node referenced by the speci ed PolygonId is active in the
NavMesh.

MapLocation

Finds the closest point and PolygonId on the NavMesh for a given world
position.

MoveLocation

Translates a NavMesh location to another position without losing contact with
the surface.

MoveLocations

Translates a series of NavMesh locations to other positions without losing
contact with the surface.

MoveLocationsInSameAreas

Translates a series of NavMesh locations to other positions without losing
contact with the surface, given one common area lter for all of them.

PolygonLocalToWorldMatrix

Returns the transformation matrix of the NavMesh surface that contains the
speci ed NavMesh node (Read Only).

PolygonWorldToLocalMatrix

Returns the inverse transformation matrix of the NavMesh surface that
contains the speci ed NavMesh node (Read Only).

Raycast

Trace a line between two points on the NavMesh.

UpdateFindPath

Continues a path search that is in progress.

Leave feedback

Description
Assembles together a collection of NavMesh surfaces and links that are used as a whole for performing
navigation operations.
Operations are initialized against one world, can use only the NavMeshes inside that world and are not aware of
the existence of any other NavMeshWorld.
Copying this object only produces a new reference to the same NavMesh data, it does not duplicate the data in
memory.
Important note: Currently only a single NavMesh world can be used and a reference to it can be obtained
through the NavMeshWorld.GetDefaultWorld method. In the future, multiple NavMesh worlds will be able to be
created and any two of them will be completely isolated from each other.
See Also: NavMeshQuery.

Public Methods
AddDependency

Tells the NavMesh world to halt any changes until the speci ed job is completed.

IsValid

Returns true if the NavMeshWorld has been properly initialized.

Static Methods
GetDefaultWorld

Returns a reference to the single NavMeshWorld that can currently exist and be used in
Unity.

Leave feedback

Description
Represents a compact identi er for the data of a NavMesh node.
It is used in NavMeshQuery operations for pinpointing and getting access to relevant nodes in the NavMesh. Each
node can be used by only one type of agent. See Also: NavMeshSurface.
This identi er becomes invalid once the node gets removed from the NavMesh, either by completely removing
the surface or by modifying the surface in the node's immediate vicinity.
See Also: NavMeshQuery.IsValid.

Public Methods
Equals

Returns true if two PolygonId objects refer to the same NavMesh node.

GetHashCode

Returns the hash code for use in collections.

IsNull

Returns true if the PolygonId has been created empty and has never pointed to any node
in the NavMesh.

Operators
operator !=

Returns true if two PolygonId objects refer to di erent NavMesh nodes or if only one of
them is null.

operator ==

Returns true if two PolygonId objects refer to the same NavMesh node or if they are both
null.

Leave feedback

Description
The types of nodes in the navigation data.
Navigation data is comprised geometrically of polygons and segments connected together.
See Also: NavMeshQuery.GetPolygonType, NavMeshSurface, NavMeshLink, O -mesh Link.

Properties
Ground

Type of node in the NavMesh representing one surface polygon.

O MeshConnection

Type of node in the NavMesh representing a point-to-point connection between two
positions on the NavMesh surface.

Leave feedback

Description
Bit ags representing the resulting state of NavMeshQuery operations.
The main values are Success, Failure and InProgress. A status will usually have only one of these main ags
set. The secondary ags (details) are set when speci c issues have been encountered during the operation.
StatusDetailMask is a bit mask that can be used to lter out these secondary ags.
Note: Issues highlighted by the presence of certain detail ags in certain situations might refer to internal
structures outside the control of users, thus they will not always be able to mitigate them by taking the necessary
actions in their code. Ways for handling these situations will be made available in the future.

Properties
Failure

The operation has failed.

Success

The operation was successful.

InProgress

The operation is in progress.

StatusDetailMask

Bitmask that has 0 set for the Success, Failure and InProgress bits and 1 set for all the
other ags.

WrongMagic

Data in the NavMesh cannot be recognized and used.

WrongVersion

Data in the NavMesh world has a wrong version.

OutOfMemory

Operation ran out of memory.

InvalidParam

A parameter did not contain valid information, useful for carring out the NavMesh query.

Bu erTooSmall

The node bu er of the query was too small to store all results.

OutOfNodes

Query ran out of node stack space during a search.

PartialResult

Query did not reach the end location, returning best guess.

Leave feedback

Description
The humanoid stream of animation data passed from one Playable to another.
The AnimationHumanStream structure is passed through the animation Playable structures, like
AnimationClipPlayable and AnimationMixerPlayable. They can be modi ed when used with an
IAnimationJobPlayable, like the AnimationScriptPlayable.
The Playables implementing IAnimationJobPlayable take a custom C# job, which must implement IAnimationJob,
and the AnimationHumanStream is then passed to its callbacks during the animation processing pass.
See Also: AnimationStream, AnimationStream.isHumanStream, and AnimationStream.AsHuman().

Properties
bodyLocalPosition

The position of the body center of mass relative to the root.

bodyLocalRotation

The rotation of the body center of mass relative to the root.

bodyPosition

The position of the body center of mass in world space.

bodyRotation

The rotation of the body center of mass in world space.

humanScale

The scale of the Avatar. (Read Only)

isValid

Returns true if the stream is valid; false otherwise. (Read Only)

leftFootHeight

The left foot height from the oor. (Read Only)

leftFootVelocity

The left foot velocity from the last evaluated frame. (Read Only)

rightFootHeight

The right foot height from the oor. (Read Only)

rightFootVelocity

The right foot velocity from the last evaluated frame. (Read Only)

Public Methods
GetGoalLocalPosition

Returns the position of this IK goal relative to the root.

GetGoalLocalRotation

Returns the rotation of this IK goal relative to the root.

GetGoalPosition

Returns the position of this IK goal in world space.

GetGoalPositionFromPose

Returns the position of this IK goal in world space computed from the stream
current pose.

GetGoalRotation

Returns the rotation of this IK goal in world space.

GetGoalRotationFromPose

Returns the rotation of this IK goal in world space computed from the stream
current pose.

GetGoalWeightPosition

Returns the position weight of the IK goal.

GetGoalWeightRotation

Returns the rotation weight of the IK goal.

GetHintPosition

Returns the position of this IK Hint in world space.

GetHintWeightPosition

Returns the position weight of the IK Hint.

GetMuscle

Returns the muscle value.

ResetToStancePose

Reset the current pose to the stance pose (T Pose).

SetGoalLocalPosition

Sets the position of this IK goal relative to the root.

SetGoalLocalRotation

Sets the rotation of this IK goal relative to the root.

SetGoalPosition

Sets the position of this IK goal in world space.

SetGoalRotation

Sets the rotation of this IK goal in world space.

SetGoalWeightPosition

Sets the position weight of the IK goal.

SetGoalWeightRotation

Sets the rotation weight of the IK goal.

SetHintPosition

Sets the position of this IK hint in world space.

SetHintWeightPosition

Sets the position weight of the IK Hint.

SetLookAtBodyWeight

Sets the LookAt body weight.

SetLookAtClampWeight

Sets the LookAt clamp weight.

SetLookAtEyesWeight

Sets the LookAt eyes weight.

SetLookAtHeadWeight

Sets the LookAt head weight.

SetLookAtPosition

Sets the look at position in world space.

SetMuscle

Sets the muscle value.

SolveIK

Execute the IK solver.

Leave feedback
Implements interfaces:IAnimationJobPlayable, IPlayable

Description
A Playable that can run a custom, multi-threaded animation job.
This playable allows to create a custom C# job that will give read and write access to the AnimationStream during
the animation process pass in the PlayableGraph. The C# job must implement the interface IAnimationJob.
NOTE: You can use PlayableExtensions methods with AnimationScriptPlayable objects.
See Also: IAnimationJob, and AnimationScriptPlayable.Create.

Public Methods
GetJobData

Gets the job data contained in the playable.

GetProcessInputs

Returns whether the playable inputs will be processed or not.

SetJobData

Sets a new job data in the playable.

SetProcessInputs

Sets the new value for processing the inputs or not.

Static Methods
Create

Creates an AnimationScriptPlayable in the PlayableGraph.

Leave feedback

Description
The stream of animation data passed from one Playable to another.
The AnimationStream structure is passed through the animation Playable structures, like AnimationClipPlayable
and AnimationMixerPlayable. They can be modi ed when used with an IAnimationJobPlayable, like the
AnimationScriptPlayable.
The Playables implementing IAnimationJobPlayable take a custom C# job, which must implement IAnimationJob,
and the AnimationStream is then passed to its callbacks during the animation processing pass.
See Also: IAnimationJob, AnimationScriptPlayable, TransformStreamHandle, PropertyStreamHandle,
TransformSceneHandle, and PropertySceneHandle.

Properties
angularVelocity

Gets or sets the avatar angular velocity for the evaluated frame.

deltaTime

Gets the delta time for the evaluated frame. (Read Only)

inputStreamCount

Gets the number of input streams. (Read Only)

isHumanStream

Returns true if the stream is from a humanoid avatar; false otherwise. (Read Only)

isValid

Returns true if the stream is valid; false otherwise. (Read Only)

rootMotionPosition

Gets the root motion position for the evaluated frame. (Read Only)

rootMotionRotation

Gets the root motion rotation for the evaluated frame. (Read Only)

velocity

Gets or sets the avatar velocity for the evaluated frame.

Public Methods
AsHuman

Gets the same stream, but as an AnimationHumanStream.

GetInputStream

Gets the AnimationStream of the playable input at index.

Leave feedback

Description
Static class providing extension methods for Animator and the animation C# jobs.
The extension methods in this class can directly be used on an Animator.
See Also: IAnimationJobPlayable.

Static Methods
BindSceneProperty

Create a PropertySceneHandle representing the new binding on the Component
property of a Transform in the Scene.

BindSceneTransform

Create a TransformSceneHandle representing the new binding between the
Animator and a Transform in the Scene.

BindStreamProperty

Create a PropertyStreamHandle representing the new binding on the Component
property of a Transform already bound to the Animator.

BindStreamTransform

Create a TransformStreamHandle representing the new binding between the
Animator and a Transform already bound to the Animator.

CloseAnimationStream

Close a stream that has been opened using OpenAnimationStream.

OpenAnimationStream

Open a new stream on the Animator.

ResolveAllSceneHandles

Newly created handles are always resolved lazily on the next access when the
jobs are run. To avoid a cpu spike while evaluating the jobs you can manually
resolve all handles from the main thread.

ResolveAllStreamHandles

Newly created handles are always resolved lazily on the next access when the
jobs are run. To avoid a cpu spike while evaluating the jobs you can manually
resolve all handles from the main thread.

Leave feedback

Description
Handle for a muscle in the AnimationHumanStream.
MuscleHandle can only be used on AnimationHumanStream, otherwise an InvalidOperationException is
thrown.

using
using
using
using

UnityEngine;
UnityEngine.Animations;
UnityEngine.Playables;
UnityEngine.Experimental.Animations;

public struct MuscleHandleExampleJob : IAnimationJob
{
public MuscleHandle muscleHandle;

public void ProcessRootMotion(AnimationStream stream) {}
public void ProcessAnimation(AnimationStream stream)
{
AnimationHumanStream humanStream = stream.AsHuman();

// Get a muscle value.
float muscleValue = humanStream.GetMuscle(muscleHandle);

// Set a muscle value.
humanStream.SetMuscle(muscleHandle, muscleValue);
}
}

[RequireComponent(typeof(Animator))]
public class MuscleHandleExample : MonoBehaviour
{
void Start()
{
var graph = PlayableGraph.Create();
var output = AnimationPlayableOutput.Create(graph, "output", GetComponen

var job = new MuscleHandleExampleJob();
job.muscleHandle = new MuscleHandle(HumanPartDof.LeftArm, ArmDof.HandDow

var scriptPlayable = AnimationScriptPlayable.Create(graph, job);
output.SetSourcePlayable(scriptPlayable);

graph.Evaluate(1.0f);

graph.Destroy();
}
}

Static Properties
muscleHandleCount

The total number of DoF parts in a humanoid. (Read Only)

Properties
dof

The muscle human sub-part. (Read Only)

humanPartDof

The muscle human part. (Read Only)

name

The name of the muscle. (Read Only)

Constructors
MuscleHandle

The di erent constructors that creates the muscle handle.

Static Methods
GetMuscleHandles

Fills the array with all the possible muscle handles on a humanoid.

Leave feedback

Description
Handle for a Component property on an object in the Scene.

using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;

using UnityEngine.Experimental.Animations;

public struct PropertySceneHandleJob : IAnimationJob
{
public PropertySceneHandle handleR;
public PropertySceneHandle handleG;
public PropertySceneHandle handleB;
public Color color;

public void ProcessRootMotion(AnimationStream stream)
{
}

public void ProcessAnimation(AnimationStream stream)
{
// Set the new light color.
handleR.SetFloat(stream, color.r);
handleG.SetFloat(stream, color.g);
handleB.SetFloat(stream, color.b);
}
}

[RequireComponent(typeof(Animator))]
[RequireComponent(typeof(Light))]
public class PropertySceneHandleExample : MonoBehaviour
{
public Light sceneLight;
public Color color = Color.white;

PlayableGraph m_Graph;
AnimationScriptPlayable m_AnimationScriptPlayable;

void Start()
{
if (sceneLight == null)
return;

var animator = GetComponent();

m_Graph = PlayableGraph.Create("PropertySceneHandleExample");
var output = AnimationPlayableOutput.Create(m_Graph, "output", animator)

var animationJob = new PropertySceneHandleJob();
animationJob.handleR = animator.BindSceneProperty(sceneLight.transform,
animationJob.handleG = animator.BindSceneProperty(sceneLight.transform,
animationJob.handleB = animator.BindSceneProperty(sceneLight.transform,
m_AnimationScriptPlayable = AnimationScriptPlayable.Create(m_Graph, anim

output.SetSourcePlayable(m_AnimationScriptPlayable);
m_Graph.Play();
}

void Update()
{
if (sceneLight == null)
return;

var animationJob = m_AnimationScriptPlayable.GetJobData();

m_Graph = PlayableGraph.Create("PropertyStreamHandleExample");
var output = AnimationPlayableOutput.Create(m_Graph, "output", animator)

var animationJob = new PropertyStreamHandleJob();
animationJob.handleR = animator.BindStreamProperty(gameObject.transform,
animationJob.handleG = animator.BindStreamProperty(gameObject.transform,
animationJob.handleB = animator.BindStreamProperty(gameObject.transform,
m_AnimationScriptPlayable = AnimationScriptPlayable.Create(m_Graph, anim

output.SetSourcePlayable(m_AnimationScriptPlayable);
m_Graph.Play();
}

void Update()
{
var animationJob = m_AnimationScriptPlayable.GetJobData();

m_Graph = PlayableGraph.Create("TransformSceneHandleExample");
var output = AnimationPlayableOutput.Create(m_Graph, "output", animator)

var animationJob = new TransformSceneHandleJob();
animationJob.handle = animator.BindSceneTransform(sceneTransform);
m_AnimationScriptPlayable = AnimationScriptPlayable.Create(m_Graph, anim

output.SetSourcePlayable(m_AnimationScriptPlayable);
m_Graph.Play();
}

void Update()
{
if (sceneTransform == null)
return;

var animationJob = m_AnimationScriptPlayable.GetJobData();

m_Graph = PlayableGraph.Create("TransformStreamHandleExample");
var output = AnimationPlayableOutput.Create(m_Graph, "output", animator)

var animationJob = new TransformStreamHandleJob();
animationJob.handle = animator.BindStreamTransform(gameObject.transform)
m_AnimationScriptPlayable = AnimationScriptPlayable.Create(m_Graph, anim

output.SetSourcePlayable(m_AnimationScriptPlayable);
m_Graph.Play();
}

void Update()
{
var animationJob = m_AnimationScriptPlayable.GetJobData();
vp.audioOutputMode = VideoAudioOutputMode.APIOnly;
vp.prepareCompleted += Prepared;
vp.Prepare();
}

void Prepared(VideoPlayer vp)
{
provider = vp.GetAudioSampleProvider(0);
provider.sampleFramesAvailable += SampleFramesAvailable;
provider.enableSampleFramesAvailableEvents = true;
provider.freeSampleFrameCountLowThreshold = provider.maxSampleFrameCount
vp.Play();
}

void SampleFramesAvailable(AudioSampleProvider provider, uint sampleFrameCoun
{

using (NativeArray buffer = new NativeArray(
(int)sampleFrameCount * provider.channelCount, Allocator.T
{
var sfCount = provider.ConsumeSampleFrames(buffer);
Debug.LogFormat("SetupSoftwareAudioOut.Available got {0} sample frame
// Do something with the samples here...
}
}
}

The following is an example of how to access samples from C++. The setup has to be done in C# and then Unity's
core and the native plug-in can call into each other without having to go through managed code.

using
using
using
using
using
using

System;
System.Runtime.InteropServices;
UnityEngine;
UnityEngine.Experimental.Video;
UnityEngine.Experimental.Audio;
UnityEngine.Video;

public class NativeAudioOutput : MonoBehaviour
{
AudioSampleProvider provider;
AudioSampleProvider.SampleFramesEventNativeFunction sampleFramesAvailableNati
SampleFramesAvailable;

void Start()
{
VideoPlayer vp = GetComponent();
vp.audioOutputMode = VideoAudioOutputMode.APIOnly;
vp.prepareCompleted += Prepared;
vp.Prepare();
}

void Prepared(VideoPlayer vp)
{
provider = vp.GetAudioSampleProvider(0);
provider.freeSampleFrameCountLowThreshold = provider.maxSampleFrameCount

SetConsumeSampleFramesFunction(

AudioSampleProvider.consumeSampleFramesNativeFunction, provider.id,
provider.channelCount, provider.sampleRate);
provider.SetSampleFramesAvailableNativeHandler(
sampleFramesAvailableNativeHandler, (IntPtr)0);

vp.Play();
}

private const string pluginName =
#if UNITY_IPHONE
"__Internal"
#else
"NativeAudioOutputPlugin"
#endif
;

[DllImport(pluginName, ExactSpelling = true, CallingConvention = CallingConve
private static extern void SetConsumeSampleFramesFunction(
AudioSampleProvider.ConsumeSampleFramesNativeFunction cb, uint id, ushort

[AOT.MonoPInvokeCallback(typeof(AudioSampleProvider.SampleFramesEventNativeFu
[DllImport(pluginName, ExactSpelling = true, CallingConvention = CallingConve
private static extern void SampleFramesAvailable(IntPtr userData, uint id, ui
}

And here is the accompanying C++ plug-in:

#include 
#include 

typedef uint32_t(__cdecl *ConsumeSampleFramesFunction)(
uint32_t providerId, float* interleavedSampleFrames, uint32_t sampleFrameCoun

ConsumeSampleFramesFunction ConsumeSampleFrames = NULL;
uint32_t providerId = -1;
float* buffer = NULL;
uint32_t bufferSampleFrameCount = 0;
uint32_t availableSampleFrameCount = 0;

extern "C" __cdecl void SetConsumeSampleFramesFunction(
ConsumeSampleFramesFunction function, uint32_t id, uint16_t channelCount, uin
{
ConsumeSampleFrames = function;
providerId = id;
delete[] buffer;
buffer = new float[channelCount * sampleRate]; // 1s worth of sample frames.
bufferSampleFrameCount = sampleRate;
}

extern "C" __cdecl void SampleFramesAvailable(void* userData, uint32_t id, uint32
{
if (ConsumeSampleFrames == NULL)
return;

// We consume the sample frames from the handler that tells us that there are
// But we could also invoke this regularly from another thread, for example t
// samples to an audio device.
const uint32_t consumedSampleFrameCount = ConsumeSampleFrames(
providerId, buffer, std::min(bufferSampleFrameCount, sampleFrameCount
// Do something with the samples here...
}

Static Properties
consumeSampleFramesNativeFunction

Pointer to the native function that provides access to audio sample
frames.

Properties
availableSampleFrameCount

Number of sample frames available for consuming with
AudioSampleProvider.ConsumeSampleFrames.

channelCount

The number of audio channels per sample frame.

enableSampleFramesAvailableEvents

Enables the AudioSampleProvider.sampleFramesAvailable events.

enableSilencePadding

If true, bu ers produced by ConsumeSampleFrames will get padded
when silence if there are less available than asked for. Otherwise, the
extra sample frames in the bu er will be left unchanged.

freeSampleFrameCount

Number of sample frames that can still be written to by the sample
producer before over owing.

freeSampleFrameCountLowThreshold

Then the free sample count falls below this threshold, the
AudioSampleProvider.sampleFramesAvailable event and associated
native is emitted.

id

Unique identi er for this instance.

maxSampleFrameCount

The maximum number of sample frames that can be accumulated
inside the internal bu er before an over ow event is emitted.

owner

Object where this provider came from.

sampleRate

The expected playback rate for the sample frames produced by this
class.

trackIndex

Index of the track in the object that created this provider.

valid

True if the object is valid.

Public Methods
ClearSampleFramesAvailableNativeHandler

Clear the native handler set with
AudioSampleProvider.SetSampleFramesAvailableNativeHandler.

ClearSampleFramesOver owNativeHandler

Clear the native handler set with
AudioSampleProvider.SetSampleFramesOver owNativeHandler.

ConsumeSampleFrames

Consume sample frames from the internal bu er.

Dispose

Release internal resources. Inherited from IDisposable.

SetSampleFramesAvailableNativeHandler

Set the native event handler for events emitted when the
number of available sample frames crosses the threshold.

SetSampleFramesOver owNativeHandler

Set the native event handler for events emitted when the
internal sample frame bu er over ows.

Events
sampleFramesAvailable

Invoked when the number of available sample frames goes beyond the threshold
set with AudioSampleProvider.freeSampleFrameCountLowThreshold.

sampleFramesOver ow

Invoked when the number of available sample frames goes beyond the maximum
that ts in the internal bu er.

Delegates

ConsumeSampleFramesNativeFunction

Type that represents the native function pointer for consuming
sample frames.

SampleFramesEventNativeFunction

Type that represents the native function pointer for handling
sample frame events.

SampleFramesHandler

Delegate for sample frame events.

Leave feedback

Description
A helper structure used to initialize a LightDataGI structure as a directional light.

Properties
color

The direct light color.

direction

The direction of the light.

indirectColor

The indirect light color.

instanceID

The light's instanceID.

mode

The lightmode.

penumbraWidthRadian

The penumbra width for soft shadows in radians.

shadow

True if the light casts shadows, otherwise False.

Leave feedback

Description
The interop structure to pass light information to the light baking backends. There are helper structures for
Directional, Point, Spot and Rectangle lights to correctly initialize this structure.

Properties
color

The color of the light.

coneAngle

The cone angle for spot lights.

fallo

The fallo model to use for baking point and spot lights.

indirectColor

The indirect color of the light.

innerConeAngle

The inner cone angle for spot lights.

instanceID

The light's instanceID.

mode

The lightmap mode for the light.

orientation

The orientation of the light.

position

The position of the light.

range

The range of the light. Unused for directional lights.

shadow

Set to 1 for shadow casting lights, 0 otherwise.

shape0

The light's sphere radius for point and spot lights, or the width for rectangle lights.

shape1

The height for rectangle lights.

type

The type of the light.

Public Methods
Init

Initialize the struct with the parameters from the given light type.

InitNoBake

Initialize a light so that the baking backends ignore it.

Leave feedback

Description
Utility class for converting Unity Lights to light types recognized by the baking backends.

Static Methods
Extract

Extracts informations from Lights.

ExtractIndirect

Extracts the indirect color from a light.

ExtractInnerCone

Extracts the inner cone angle of spot lights.

Leave feedback

Description
Interface to the light baking backends.

Static Methods
GetDelegate

Get the currently set conversion delegate.

ResetDelegate

Resets the light conversion delegate to Unity's default conversion function.

SetDelegate

Set a delegate that converts a list of lights to a list of LightDataGI structures that are
passed to the baking backends. Must be reset by calling ResetDelegate again.

Delegates
RequestLightsDelegate

Delegate called when converting lights into a form that the baking backends
understand.

Leave feedback

Description
Contains normalized linear color values for red, green, blue in the range of 0 to 1, and an additional intensity
value.

Properties
blue

The blue color value in the range of 0.0 to 1.0.

green

The green color value in the range of 0.0 to 1.0.

intensity

The intensity value used to scale the red, green and blue values.

red

The red color value in the range of 0.0 to 1.0.

Static Methods
Black

Returns a black color.

Convert

Converts a Light's color value to a normalized linear color value, automatically handling
gamma conversion if necessary.

Leave feedback

Description
A helper structure used to initialize a LightDataGI structure as a point light.

Properties
color

The direct light color.

fallo

The fallo model to use for baking the point light.

indirectColor

The indirect light color.

instanceID

The light's instanceID.

mode

The lightmode.

position

The light's position.

range

The light's range.

shadow

True if the light casts shadows, otherwise False.

sphereRadius

The light's sphere radius, in uencing soft shadows.

Leave feedback

Description
A helper structure used to initialize a LightDataGI structure as a rectangle light.

Properties
color

The direct light color.

height

The height of the rectangle light.

indirectColor

The indirect light color.

instanceID

The light's instanceID.

mode

The lightmode.

orientation

The light's orientation.

position

The light's position.

range

The light's range.

shadow

True if the light casts shadows, otherwise False.

width

The width of the rectangle light.

Leave feedback

Description
A helper structure used to initialize a LightDataGI structure as a spot light.

Properties
color

The direct light color.

coneAngle

The outer angle for the spot light.

fallo

The fallo model to use for baking the spot light.

indirectColor

The indirect light color.

innerConeAngle

The inner angle for the spot light.

instanceID

The light's instanceID.

mode

The lightmode.

orientation

The light's orientation.

position

The light's position.

range

The light's range.

shadow

True if the light casts shadows, otherwise False.

sphereRadius

The light's sphere radius, in uencing soft shadows.

Leave feedback

Description
Available fallo models for baking.

Properties
InverseSquared

Inverse squared distance fallo model.

InverseSquaredNoRangeAttenuation

Inverse squared distance fallo model (without smooth range
attenuation).

Linear

Linear fallo model.

Legacy

Quadratic fallo model.

Unde ned

Fallo model is unde ned.

Leave feedback

Description
The lightmode. A light can be realtime, mixed, baked or unknown. Unknown lights will be ignored by the baking
backends.

Properties
Realtime

The light is realtime. No contribution will be baked in lightmaps or light probes.

Mixed

The light is mixed. Mixed lights are interpreted based on the global light mode setting in
the lighting window.

Baked

The light is fully baked and has no realtime component.

Unknown

The light should be ignored by the baking backends.

Leave feedback

Description
The light type.

Properties
Directional

An in nite directional light.

Point

A point light emitting light in all directions.

Spot

A spot light emitting light in a direction with a cone shaped opening angle.

Rectangle

A light shaped like a rectangle emitting light into the hemisphere that it is facing.

Disc

A light shaped like a disc emitting light into the hemisphere that it is facing.

Leave feedback

Description
The class representing the player loop in Unity.
This class contains functions for interacting with the player loop in the core of Unity. You can use this class to get
the update order of all native systems and set a custom order with new script entry points inserted.

Static Methods
GetDefaultPlayerLoop

Returns the default update order of all engine systems in Unity.

SetPlayerLoop

Set a new custom update order of all engine systems in Unity.

Leave feedback

Description
The representation of a single system being updated by the player loop in Unity.
This struct represents a single system in the player loop. A system can be one of Unity's built-in native systems, or
you can new custom systems to add to the player loop using C#. Native systems can only be retrieved by calling
PlayerLoop.GetDefaultPlayerLoop, and the parameters of them should not be modi ed.

Properties
loopConditionFunction

The loop condition for a native engine system. To get a valid value for this, you must
copy it from one of the PlayerLoopSystems returned by
PlayerLoop.GetDefaultPlayerLoop.

subSystemList

A list of sub systems which run as part of this item in the player loop.

type

This property is used to identify which native system this belongs to, or to get the
name of the managed system to show in the pro ler.

updateDelegate

A managed delegate. You can set this to create a new C# entrypoint in the player
loop.

updateFunction

A native engine system. To get a valid value for this, you must copy it from one of the
PlayerLoopSystems returned by PlayerLoop.GetDefaultPlayerLoop.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that produces a Camera texture.
NOTE: You can use PlayableExtensions methods with CameraPlayable objects.

Static Methods
Create

Creates a CameraPlayable in the PlayableGraph.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that allows application of a Material shader to one or many texture inputs to
produce a texture output.
NOTE: You can use PlayableExtensions methods with MaterialE ectPlayable objects.

Static Methods
Create

Creates a MaterialE ectPlayable in the PlayableGraph.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that allows mixing two textures.
NOTE: You can use PlayableExtensions methods with TextureMixerPlayable objects.

Static Methods
Create

Creates a TextureMixerPlayable in the PlayableGraph.

Leave feedback

Description
A PlayableBinding that contains information representing a TexturePlayableOutput.

Static Methods
Create

Creates a PlayableBinding that contains information representing a
TexturePlayableOutput.

Leave feedback
Implements interfaces:IPlayableOutput

Description
An IPlayableOutput implementation that will be used to manipulate textures.
NOTE: You can use PlayableOutputExtensions methods with TexturePlayableOutput objects.

Static Properties
Null

Returns an invalid TexturePlayableOutput.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Update phase in the native player loop.
This is the C# representation of an update phase in the native player loop. It can only be used to identify the
update phase in native.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Native engine system updated by the native player loop.

Leave feedback

Description
Values for the blend state.
See Also: RenderStateBlock, ShaderLab: Blending.

Static Properties
Default

Default values for the blend state.

Properties
alphaToMask

Turns on alpha-to-coverage.

blendState0

Blend state for render target 0.

blendState1

Blend state for render target 1.

blendState2

Blend state for render target 2.

blendState3

Blend state for render target 3.

blendState4

Blend state for render target 4.

blendState5

Blend state for render target 5.

blendState6

Blend state for render target 6.

blendState7

Blend state for render target 7.

separateMRTBlendStates

Determines whether each render target uses a separate blend state.

Constructors
BlendState

Creates a new blend state with the speci ed values.

Leave feedback

Description
Camera related properties in CullingParameters.
Typical use case is to compute culling parameters from Camera data, see CullResults.GetCullingParameters.

Public Methods
GetCameraCullingPlane

Get a camera culling plane.

GetShadowCullingPlane

Get a shadow culling plane.

SetCameraCullingPlane

Set a camera culling plane.

SetShadowCullingPlane

Set a shadow culling plane.

Leave feedback

Description
Core Camera related properties in CullingParameters.
Typical use case is to compute culling parameters from Camera data, see CullResults.GetCullingParameters.

Leave feedback

Description
Culling results (visible objects, lights, re ection probes).
In a scriptable render loop, the rendering process is typically doing culling for each camera (CullResults.Cull),
followed by rendering subsets of visible objects (RenderLoop.DrawRenderers) and processing visible lights
(visibleLights, visibleRe ectionProbes).
CullResults also provides several functions to aid shadow rendering
(ComputeDirectionalShadowMatricesAndCullingPrimitives, ComputeSpotShadowMatricesAndCullingPrimitives,
ComputePointShadowMatricesAndCullingPrimitives).

Properties
visibleLights

Array of visible lights.

visibleO screenVertexLights

O screen lights that still e ect visible Scene vertices.

visibleRe ectionProbes

Array of visible re ection probes.

visibleRenderers

Visible renderers.

Public Methods
ComputeDirectionalShadowMatricesAndCullingPrimitives

Calculates the view and projection matrices and
shadow split data for a directional light.

ComputePointShadowMatricesAndCullingPrimitives

Calculates the view and projection matrices and
shadow split data for a point light.

ComputeSpotShadowMatricesAndCullingPrimitives

Calculates the view and projection matrices and
shadow split data for a spot light.

FillLightIndices

Fills a compute bu er with per-object light
indices.

GetLightIndexMap

If a RenderPipeline sorts or otherwise modi es
the VisibleLight list, an index remap will be
necessary to properly make use of per-object light
lists.

GetLightIndicesCount

Gets the number of per-object light indices.

GetShadowCasterBounds

Returns the bounding box that encapsulates the
visible shadow casters. Can be used to, for
instance, dynamically adjust cascade ranges.

SetLightIndexMap

If a RenderPipeline sorts or otherwise modi es
the VisibleLight list, an index remap will be
necessary to properly make use of per-object light
lists. If an element of the array is set to -1, the
light corresponding to that element will be
disabled.

Static Methods
Cull

Perform culling for a Camera.

GetCullingParameters

Get culling parameters for a camera.

Leave feedback

Description
Values for the depth state.
See Also: RenderStateBlock, ShaderLab: Culling & Depth Testing.

Static Properties
Default

Default values for the depth state.

Properties
compareFunction

How should depth testing be performed.

writeEnabled

Controls whether pixels from this object are written to the depth bu er.

Constructors
DepthState

Creates a new depth state with the given values.

Leave feedback

Description
Settings for ScriptableRenderContext.DrawRenderers.
DrawRendererSettings describes how to sort visible objects are sorted (sorting) and which shader passes to use
(shaderPassName).
See Also: ScriptableRenderContext.DrawRenderers, CullResults.Cull, FilterRenderersSettings.

Static Properties
maxShaderPasses

The maxiumum number of passes that can be rendered in 1 DrawRenderers call.

Properties
ags

Other ags controlling object rendering.

rendererCon guration

What kind of per-object data to setup during rendering.

sorting

How to sort objects during rendering.

Constructors
DrawRendererSettings

Create a draw settings struct.

Public Methods
SetOverrideMaterial

Set the Material to use for all drawers that would render in this group.

SetShaderPassName

Set the shader passes that this draw call can render.

Leave feedback

Description
This struct describes the methods to sort objects during rendering.
See Also: DrawRendererSettings, RenderLoop.DrawRenderers.

Properties
cameraCustomSortAxis

Used to calculate distance to objects, by comparing the positions of objects to this
axis.

cameraPosition

Used to calculate the distance to objects.

ags

What kind of sorting to do while rendering.

sortMode

Type of sorting to use while rendering.

worldToCameraMatrix

Used to calculate the distance to objects.

Leave feedback

Description
Settings for ScriptableRenderContext.DrawShadows.
This structure describes which shadow light to render (lightIndex) with what split settings (splitData).
See Also: ShadowSplitData.

Properties
cullResults

Culling results to use.

lightIndex

The index of the shadow-casting light to be rendered.

splitData

The split data.

Constructors
DrawShadowsSettings

Create a shadow settings object.

Leave feedback

Description
Filter settings for ScriptableRenderContext.DrawRenderers.
FilterRenderersSettings describes how to lter the given set of visible objects to render.
See Also: ScriptableRenderContext.DrawRenderers.

Properties
excludeMotionVectorObjects

Set to true to exclude objects that are currently in motion from rendering. The
default value is false.

layerMask

Only render objects in the given layer mask.

renderingLayerMask

The rendering layer mask to use when ltering available renderers for
drawing.

renderQueueRange

Render objects whose material render queue in inside this range.

Constructors
FilterRenderersSettings

Leave feedback

Description
Describes a subset of objects to be rendered.
See Also: ScriptableRenderContext.DrawRenderers.
.

Leave feedback

Description
LODGroup culling parameters.
See Also: CullingParameters.

Properties
cameraPixelHeight

Rendering view height in pixels.

cameraPosition

Camera position.

eldOfView

Camera's eld of view.

isOrthographic

Indicates whether camera is orthographic.

orthoSize

Orhographic camera size.

Leave feedback

Description
Values for the raster state.
See Also: ShaderLab: Culling & Depth Testing.

Static Properties
Default

Default values for the raster state.

Properties
cullingMode

Controls which sides of polygons should be culled (not drawn).

depthClip

Enable clipping based on depth.

o setFactor

Scales the maximum Z slope.

o setUnits

Scales the minimum resolvable depth bu er value.

Constructors
RasterState

Creates a new raster state with the given values.

Leave feedback

Description
Object encapsulating the duration of a single renderpass that contains one or more subpasses.
The RenderPass object provides a new way to switch rendertargets in the context of a Scriptable Rendering
Pipeline. As opposed to the SetRenderTargets function, the RenderPass object speci es a clear beginning and an
end for the rendering, alongside explicit load/store actions on the rendering surfaces.
The RenderPass object also allows running multiple subpasses within the same renderpass, where the pixel
shaders have a read access to the current pixel value within the renderpass. This allows for e cient
implementation of various rendering methods on tile-based GPUs, such as deferred rendering.
RenderPasses are natively implemented on Metal (iOS) and Vulkan, but the API is fully functional on all rendering
backends via emulation (using legacy SetRenderTargets calls and reading the current pixel values via texel
fetches).
A quick example on how to use the RenderPass API within the Scriptable Render Pipeline to implement deferred
rendering:
The RenderPass mechanism has the following limitations: - All attachments must have the same resolution and
MSAA sample count - The rendering results of previous subpasses are only available within the same screenspace pixel coordinate via the UNITY_READ_FRAMEBUFFER_INPUT(x) macro in the shader; the attachments cannot
be bound as textures or otherwise accessed until the renderpass has ended - iOS Metal does not allow reading
from the Z-Bu er, so an additional render target is needed to work around that - The maximum amount of
attachments allowed per RenderPass is currently 8 + depth, but note that various GPUs may have stricter limits.

using UnityEngine;
using UnityEngine.Experimental.Rendering;

public class DeferredRenderer
{
private RenderPassAttachment
private RenderPassAttachment
private RenderPassAttachment
private RenderPassAttachment
private RenderPassAttachment

m_Albedo;
m_SpecRough;
m_Normal;
m_Emission;
m_Depth;

public DeferredRenderer()
{
// Create the attachment objects. If these attachments are not specifica
// these are treated as temporary surfaces that are discarded at the end

// NOTE: DO NOT ALLOCATE NEW RENDERPASSATTACHMENTS EVERY FRAME!
// These objects only get garbage collected when a Scene is unloaded, so
m_Albedo = new RenderPassAttachment(RenderTextureFormat.ARGB32);
m_SpecRough = new RenderPassAttachment(RenderTextureFormat.ARGB32);
m_Normal = new RenderPassAttachment(RenderTextureFormat.ARGB2101010);
m_Emission = new RenderPassAttachment(RenderTextureFormat.ARGBHalf);
m_Depth = new RenderPassAttachment(RenderTextureFormat.Depth);

// At the beginning of the render pass, clear the emission buffer to all
m_Emission.Clear(new Color(0.0f, 0.0f, 0.0f, 0.0f), 1.0f, 0);
m_Depth.Clear(new Color(), 1.0f, 0);
}

public void ExecuteRenderLoop(Camera camera, CullResults cullResults, Script
{
// Bind the albedo surface to the current camera target, so the final pa
// The second argument specifies whether the existing contents of the su
// in our case we do not need that because we'll be clearing the attachm
// bandwidth on tiled GPUs.
// The third argument specifies whether the rendering results need to be
// the renderpass. We need this as we'll be generating the final image t
// We could do this in the constructor already, but the camera target ma
m_Albedo.BindSurface(BuiltinRenderTextureType.CameraTarget, false, true)

// All other attachments are transient surfaces that are not stored anyw
// those surfaces do not even have a memory allocated for the pixel valu

// Start the renderpass using the given scriptable rendercontext, resolu
using (RenderPass rp = new RenderPass(scriptableRenderContext, camera.pi
{
// Start the first subpass, GBuffer creation: render to albedo, spec
using (new RenderPass.SubPass(rp, new[] { m_Albedo, m_SpecRough, m_N
{
// Render the deferred G-Buffer
RenderGBuffer(cullResults, camera, scriptableRenderContext);
}
// Second subpass, lighting: Render to the emission buffer, read fro
// The last parameter indicates whether the depth buffer can be boun
// Note that some renderers (notably iOS Metal) won't allow reading
// so those renderers should write the Z into an additional FP32 ren
using (new RenderPass.SubPass(rp, new[] { m_Emission }, new[] { m_Al
{

PushGlobalShadowParams(scriptableRenderContext);

RenderLighting(camera, cullResults, scriptableRenderContext);

scriptableRenderContext.DrawSkybox(camera);
}
// Third subpass, tonemapping: Render to albedo (which is bound to t
using (new RenderPass.SubPass(rp, new[] { m_Albedo }, new[] { m_Emis
{
// present frame buffer.
FinalPass(scriptableRenderContext);
}
}
}
}

Properties
colorAttachments

Read only: array of RenderPassAttachment objects currently bound into this RenderPass.

context

Read only: The ScriptableRenderContext object this RenderPass was created for.

depthAttachment

Read only: The depth/stencil attachment used in this RenderPass, or null if none.

height

Read only: The height of the RenderPass surfaces in pixels.

sampleCount

Read only: MSAA sample count for this RenderPass.

width

Read only: The width of the RenderPass surfaces in pixels.

Constructors
RenderPass

Create a RenderPass and start it within the ScriptableRenderContext.

Public Methods
Dispose

End the RenderPass.

Leave feedback

Description
This class encapsulates a single subpass within a RenderPass. RenderPasses can never be standalone, they must
always contain at least one SubPass. See Also: RenderPass.

Constructors
RenderPass.SubPass

Create a subpass and start it.

Public Methods
Dispose

End the subpass.

Leave feedback

Description
A declaration of a single color or depth rendering surface to be attached into a RenderPass.
A RenderPassAttachment object identi es a single color or depth rendering surface that can be used with a
RenderPass. Note that the RenderPassAttachment object derives from UnityEngine.Object so they do not get
garbage collected like normal C# objects. Instead, they are only GC'd when unloading a Scene or when
Resources.UnloadUnusedAssets() is called. Therefore do not create these objects each frame: Instead, create
these objects in the constructor of your rendering class, and reuse those objects each frame.

Properties
clearColor

The currently assigned clear color for this attachment. Default is black.

clearDepth

Currently assigned depth clear value for this attachment. Default value is 1.0.

clearStencil

Currently assigned stencil clear value for this attachment. Default is 0.

format

The RenderTextureFormat of this attachment.

loadAction

The load action to be used on this attachment when the RenderPass starts.

storeAction

The store action to use with this attachment when the RenderPass ends. Only used when
either BindSurface or BindResolveSurface has been called.

Constructors
RenderPassAttachment

Create a RenderPassAttachment to be used with RenderPass.

Public Methods
BindResolveSurface

When the renderpass that uses this attachment ends, resolve the MSAA surface into the
given target.

BindSurface

Binds this RenderPassAttachment to the given target surface.

Clear

When the RenderPass starts, clear this attachment into the color or depth/stencil values
given (depending on the format of this attachment). Changes loadAction to
RenderBu erLoadAction.Clear.

Inherited Members
Properties

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:IRenderPipeline

Description
De nes a series of commands and settings that describes how Unity renders a frame.

Properties
disposed

When the IRenderPipeline is invalid or destroyed this returns true.

Public Methods
Dispose

Dispose the Renderpipeline destroying all internal state.

Render

De nes custom rendering for this RenderPipeline.

Static Methods
BeginCameraRendering

Call the delegate used during SRP rendering before a single camera starts
rendering.

BeginFrameRendering

Call the delegate used during SRP rendering before a render begins.

Events
beginCameraRendering

Call that should be issued by an SRP when the SRP begins to render a Camera so
that other systems can inject per camera render logic.

beginFrameRendering

Call that should be issued by an SRP when the SRP begins to render so that other
systems can inject 'pre render' logic.

Leave feedback
Implements interfaces:IRenderPipelineAsset

Description
An asset that produces a speci c IRenderPipeline.
Default implementation of IRenderPipelineAsset. This manages the lifecylces of inherited types, as well as ensures
that created IRenderPipeline's are invalidated when the asset is changed.
See Also: IRenderPipelineAsset.

Public Methods
CreatePipeline

Create a IRenderPipeline speci c to this asset.

DestroyCreatedInstances

Destroys all cached data and created IRenderLoop's.

GetAutodeskInteractiveMaskedShader

Retrieves the default Autodesk Interactive masked Shader for
this pipeline.

GetAutodeskInteractiveShader

Retrieves the default Autodesk Interactive Shader for this
pipeline.

GetAutodeskInteractiveTransparentShader

Retrieves the default Autodesk Interactive transparent Shader
for this pipeline.

GetDefault2DMaterial

Return the default 2D Material for this pipeline.

GetDefaultLineMaterial

Return the default Line Material for this pipeline.

GetDefaultMaterial

Return the default Material for this pipeline.

GetDefaultParticleMaterial

Return the default particle Material for this pipeline.

GetDefaultShader

Return the default Shader for this pipeline.

GetDefaultTerrainMaterial

Return the default Terrain Material for this pipeline.

GetDefaultUIETC1SupportedMaterial

Return the default UI ETC1 Material for this pipeline.

GetDefaultUIMaterial

Return the default UI Material for this pipeline.

GetDefaultUIOverdrawMaterial

Return the default UI overdraw Material for this pipeline.

GetRenderingLayerMaskNames

Returns the list of names used to display Rendering Layer Mask
UI for this pipeline.

GetTerrainBrushPassIndex

The render index for the terrain brush in the editor.

Protected Methods
CreatedInstances

Returns the list of current IRenderPipeline's created by the asset.

InternalCreatePipeline

Create a IRenderPipeline speci c to this asset.

OnDisable

Default implementation of OnDisable for RenderPipelineAsset. See
ScriptableObject.OnDisable

OnValidate

Default implementation of OnValidate for RenderPipelineAsset. See
MonoBehaviour.OnValidate

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Render Pipeline manager.

Static Properties
currentPipeline

Returns the instance of the currently used Render Pipeline.

Leave feedback

Description
Describes a material render queue range.
See Also: ScriptableRenderContext.DrawRenderers, FilterRenderersSettings.renderQueueRange.

Static Properties
all

A range that includes all objects.

opaque

A range that includes only opaque objects.

transparent

A range that includes only transparent objects.

Properties
max

Inclusive upper bound for the range.

min

Inclusive lower bound for the range.

Leave feedback

Description
A set of values used to override the render state. Note that it is not enough to set e.g. blendState, but that mask
must also include RenderStateMask.Blend for the override to occur.
See Also: ScriptableRenderContext.DrawRenderers, RenderStateMask, RenderStateMapping.

Properties
blendState

Speci es the new blend state.

depthState

Speci es the new depth state.

mask

Speci es which parts of the render state that is overriden.

rasterState

Speci es the new raster state.

stencilReference

The value to be compared against and/or the value to be written to the bu er based on
the stencil state.

stencilState

Speci es the new stencil state.

Constructors
RenderStateBlock

Creates a new render state block with the speci ed mask.

Leave feedback

Description
Maps a RenderType to a speci c render state override.
See Also: ScriptableRenderContext.DrawRenderers, RenderStateBlock.

Properties
renderType

Speci ces the RenderType to override the render state for.

stateBlock

Speci es the values to override the render state with.

Constructors
RenderStateMapping

Creates a new render state mapping with the speci ed values.

Leave feedback

Description
Values for the blend state.
See Also: RenderStateBlock, ShaderLab: Blending.

Static Properties
Default

Default values for the blend state.

Properties
alphaBlendOperation

Operation used for blending the alpha (A) channel.

colorBlendOperation

Operation used for blending the color (RGB) channel.

destinationAlphaBlendMode

Blend factor used for the alpha (A) channel of the destination.

destinationColorBlendMode

Blend factor used for the color (RGB) channel of the destination.

sourceAlphaBlendMode

Blend factor used for the alpha (A) channel of the source.

sourceColorBlendMode

Blend factor used for the color (RGB) channel of the source.

writeMask

Speci es which color components will get written into the target framebu er.

Constructors
RenderTargetBlendState

Creates a new blend state with the given values.

Leave feedback

Description
Parameters controlling culling process in CullResults.
Typical use case is to compute culling parameters from Camera data, see CullResults.GetCullingParameters.

Properties
accurateOcclusionThreshold

This parameter determines query distance for occlusion culling. The
accurateOcclusionThreshold controls the distance where the level of detail
(LOD) changes.The default value of this parameter is -1, and any value less
than 0 has the same e ect. Default values result in automatic calculation of the
LOD.When you use occlusion culling, the occlusion data of the world varies in
level of detail. In the occlusion data, there are tiles of various sizes. Each tile
contains a cells-and-portals graph. In each cell, visibility is the same. This
means that any two points are visible within the cell. Portals are the openings
between the cells, which determine the visibility between them.The tiles are in
a k-d tree. The tree contains di erent sized tiles, where each tile represents a
level of detail. When you query a small tile, you get accurate culling results at
the price of query time.During the culling, the tile size varies with the distance
from the camera. This gives ner detail closer to the camera, and coarser detail
at further distance.The higher the value is, the higher the accuracy is far away
form the camera. High values can have a negative impact on performance.

cameraProperties

Camera Properties used for culling.

cullingFlags

Culling Flags for the culling.

cullingMask

CullingMask used for culling.

cullingMatrix

CullingMatrix used for culling.

cullingPlaneCount

Number of culling planes to use.

cullStereoProj

The projection matrix generated for single-pass stereo culling.

cullStereoSeparation

Distance between the virtual eyes.

cullStereoView

The view matrix generated for single-pass stereo culling.

isOrthographic

Is the cull orthographic.

layerCull

Layers to cull.

lodParameters

LODParameters for culling.

position

Position for the origin of th cull.

re ectionProbeSortOptions

Re ection Probe Sort options for the cull.

sceneMask

Scene Mask to use for the cull.

shadowDistance

Shadow distance to use for the cull.

Public Methods
GetCullingPlane

Fetch the culling plane at the given index.

GetLayerCullDistance

Get the distance for the culling of a speci c layer.

SetCullingPlane

Set the culling plane at a given index.

SetLayerCullDistance

Set the distance for the culling of a speci c layer.

Leave feedback

Description
De nes state and drawing commands used in a custom render pipelines.
When de ning a custom RenderPipeline, a ScriptableRenderContext is used to set state and drawing commands to be submitted to the GPU.
A RenderPipeline.Render method implementation typically culls objects that don't need to be rendered for all the Cameras (see CullResults), and then makes a series of
calls to ScriptableRenderContext.DrawRenderers intermixed with ScriptableRenderContext.ExecuteCommandBu er calls. These calls set up global Shader properties,
change render targets, dispatch compute shaders, and other rendering tasks. Finally, ScriptableRenderContext.Submit is called to execute the render loop.
See Also: RenderPipeline.

Public Methods
DrawRenderers

Draw subset of visible objects.

DrawShadows

Draw shadow casters for a single light.

DrawSkybox

Draw skybox.

ExecuteCommandBu er

Execute a custom graphics command bu er.

ExecuteCommandBu erAsync

Executes a command bu er on an async compute queue with the queue selected based on the ComputeQueueType parameter passed.
execution:CommandBu er.BeginSampleCommandBu er.CopyCounterValueCommandBu er.CopyTextureCommandBu er.CreateGPUF
of the commands within the bu er are guaranteed to be executed on the same queue. If the target platform does not support async com

SetupCameraProperties

Setup camera speci c global shader variables.

StartMultiEye

Fine-grain control to begin stereo rendering on the scriptable render context.

StereoEndRender

Indicate completion of stereo rendering on a single frame.

StopMultiEye

Stop stereo rendering on the scriptable render context.

Submit

Submit rendering loop for execution.

Static Methods
EmitWorldGeometryForSceneView

Emit UI geometry into the Scene view for rendering.

Leave feedback

Description
Shader pass name identi er.
See Also: DrawRendererSettings, RenderLoop.DrawRenderers.

Constructors
ShaderPassName

Create shader pass name identi er.

Leave feedback

Description
Describes the culling information for a given shadow split (e.g. directional cascade).

Properties
cullingPlaneCount

The number of culling planes.

cullingSphere

The culling sphere. The rst three components of the vector describe the sphere center,
and the last component speci es the radius.

Public Methods
GetCullingPlane

Gets a culling plane.

SetCullingPlane

Sets a culling plane.

Leave feedback

Description
Values for the stencil state.
See Also: RenderStateBlock, ShaderLab: Stencil.

Static Properties
Default

Default values for the stencil state.

Properties
compareFunction

The function used to compare the reference value to the current contents of the
bu er.

compareFunctionBack

The function used to compare the reference value to the current contents of the
bu er for back-facing geometry.

compareFunctionFront

The function used to compare the reference value to the current contents of the
bu er for front-facing geometry.

enabled

Controls whether the stencil bu er is enabled.

failOperation

What to do with the contents of the bu er if the stencil test fails.

failOperationBack

What to do with the contents of the bu er if the stencil test fails for back-facing
geometry.

failOperationFront

What to do with the contents of the bu er if the stencil test fails for front-facing
geometry.

passOperation

What to do with the contents of the bu er if the stencil test (and the depth test)
passes.

passOperationBack

What to do with the contents of the bu er if the stencil test (and the depth test)
passes for back-facing geometry.

passOperationFront

What to do with the contents of the bu er if the stencil test (and the depth test)
passes for front-facing geometry.

readMask

An 8 bit mask as an 0–255 integer, used when comparing the reference value with
the contents of the bu er.

writeMask

An 8 bit mask as an 0–255 integer, used when writing to the bu er.

zFailOperation

What to do with the contents of the bu er if the stencil test passes, but the depth
test fails.

zFailOperationBack

What to do with the contents of the bu er if the stencil test passes, but the depth
test fails for back-facing geometry.

zFailOperationFront

What to do with the contents of the bu er if the stencil test passes, but the depth
test fails for front-facing geometry.

Constructors
StencilState

Creates a new stencil state with the given values.

Leave feedback

Description
Describes the rendering features supported by a given render pipeline.
Set the active supported rendering features when enabling a render pipeline. This will change the state of the
editor UI to re ect the changes.

Static Properties
active

Get / Set a SupportedRenderingFeatures.

Properties
defaultMixedLightingMode

This is the fallback mode if the mode the user had previously
selected is no longer available. See
SupportedRenderingFeatures.supportedMixedLightingModes.

re ectionProbeSupportFlags

Flags for supported re ection probes.

rendererOverridesEnvironmentLighting

Determines if the renderer will override the Environment
Lighting and will no longer need the built-in UI for it.

rendererOverridesFog

Determines if the renderer will override the fog settings in the
Lighting Panel and will no longer need the built-in UI for it.

rendererOverridesOtherLightingSettings

Determines if the renderer will override halo and are settings
in the Lighting Panel and will no longer need the built-in UI for it.

rendererSupportsLightProbeProxyVolumes

Are light probe proxy volumes supported?

rendererSupportsMotionVectors

Are motion vectors supported?

rendererSupportsReceiveShadows

Can renderers support receiving shadows?

rendererSupportsRe ectionProbes

Are re ection probes supported?

rendererSupportsRendererPriority

Determines if the renderer supports renderer priority sorting.

supportedLightmapBakeTypes

What baking types are supported. The unsupported ones will be
hidden from the UI. See LightmapBakeType.

supportedLightmapsModes

Speci es what modes are supported. Has to be at least one. See
LightmapsMode.

supportedMixedLightingModes

Speci es what LightmapMixedBakeMode that are supported.
Please de ne a

SupportedRenderingFeatures.defaultMixedLightingMode in
case multiple modes are supported.

Leave feedback

Description
Same as MixedLightingMode for baking, but is used to determine what is supported by the pipeline.

Properties
None

No mode is supported.

IndirectOnly

Same as MixedLightingMode.IndirectOnly but determines if it is supported by the
pipeline.

Subtractive

Same as MixedLightingMode.Subtractive but determines if it is supported by the pipeline.

Shadowmask

Determines what is supported by the rendering pipeline. This enum is similar to
MixedLightingMode.

Leave feedback

Description
Supported modes for Re ectionProbes.

Properties
None

Default re ection probe support.

Rotation

Rotated re ection probes are supported.

Leave feedback

Description
Holds data of a visible light.
After CullResults.Cull is done, CullResults.visibleLights will contain an array of lights that are visible. The visible
light structure contains packed information for most commonly used Light variables, and a VisibleLight.light
reference to the Light component itself.
See Also: CullResults.visibleLights, Light.

Properties
nalColor

Light color multiplied by intensity.

ags

Light ags, see VisibleLightFlags.

light

Accessor to Light component.

lightType

Light type.

localToWorld

Light transformation matrix.

range

Light range.

screenRect

Light's in uence rectangle on screen.

spotAngle

Spot light angle.

Leave feedback

Description
Holds data of a visible re ection probe.
After CullResults.Cull is done, CullResults.visibleRe ectionProbes will contain an array of re ection probes that are
visible. The visible re ection probe structure contains packed information for most commonly used
Re ectionProbe variables, and a VisibleRe ectionProbe.probe reference to the component itself.
See Also: CullResults.visibleRe ectionProbes, Re ectionProbe.

Properties
blendDistance

Probe blending distance.

bounds

Probe bounding box.

boxProjection

Should probe use box projection.

center

Probe projection center.

hdr

Shader data for probe HDR texture decoding.

importance

Probe importance.

localToWorld

Probe transformation matrix.

probe

Accessor to Re ectionProbe component.

texture

Probe texture.

Leave feedback

Description
De nes a series of commands and settings that describes how Unity renders a frame.
Unity supports a few built-in rendering pipelines optimized for speci c platforms. These pipelines are open
source and available in the Github project.
You can also de ne your own custom RenderPipeline tailored for your speci c project needs. To create a custom
RenderPipeline:
1) Create a script that extends RenderPipelineAsset or IRenderPipelineAsset, this will become the manager and
provider for you RenderPipeline. 2) Implement IRenderPipeline and override IRenderPipeline.Render and
IRenderPipeline._disposed 3) Create a RenderPipeline Asset by using ScriptableObject.CreateAsset. 3) Use your
RenderPipeline either by assigning it in the GraphicsSettings in the Editor or by using the scripting interface
GraphicsSettings.renderPipeline".

Properties
disposed

When the IRenderPipeline is invalid or destroyed this returns true.

Public Methods
Render

De nes custom rendering for this RenderPipeline.

Leave feedback

Description
An asset that produces a speci c IRenderPipeline.
A RenderPipelineAsset is responsible for constructing and managing the lifecycle of a IRenderPipeline. This
involves holding settings information, producing the instance used for rendering, and destroying created
pipelines when the settings become invalid.

Public Methods
CreatePipeline

Create a IRenderPipeline speci c to this asset.

DestroyCreatedInstances

Override this method to destroy RenderPipeline cached state.

GetTerrainBrushPassIndex

The render index for the terrain brush in the editor.

Leave feedback

Description
Flags controlling RenderLoop.DrawRenderers.
See Also: DrawRendererSettings. ags, RenderLoop.DrawRenderers.

Properties
None

No ags are set.

EnableDynamicBatching

When set, enables dynamic batching.

EnableInstancing

When set, enables GPU instancing.

Leave feedback

Description
Use this format usages to gure out the capabilities of speci c GraphicsFormat
Each graphics card may not support all usages across formats. Use SystemInfo.IsFormatSupported to check which
usages the graphics card supports.
See Also: Texture2D, texture assets.

Properties
Sample

To create and sample textures.

Linear

To sample textures with a linear lter

Render

To create and render to a rendertexture.

Blend

To blend on a rendertexture.

LoadStore

To perform resource load and store on a texture

MSAA2x

To create and render to a MSAA 2X rendertexture.

MSAA4x

To create and render to a MSAA 4X rendertexture.

MSAA8x

To create and render to a MSAA 8X rendertexture.

Leave feedback

Description
Use this format to create either Textures or RenderTextures from scripts.

using UnityEngine;
using UnityEngine.Experimental.Rendering;

public class ExampleScript : MonoBehaviour
{
TextureCreationFlags flags;
void Start()
{
// Create a new texture and assign it to the material of the renderer.
var texture = new Texture2D(128, 128, GraphicsFormat.R8G8B8A8_SRGB, flag
GetComponent().material.mainTexture = texture;
}
}

Each graphics card may not support all usages across formats. Use SystemInfo.IsFormatSupported to check which
usages the graphics card supports.
Each "format" is represented by a single enum value. The name of a format is based on the following criteria: - For
color formats, the component-format speci es the size of the R, G, B, and A components (if present). - For
depth/stencil formats, the component-format speci es the size of the depth (D) and stencil (S) components (if
present). - UNorm: The components are unsigned normalized values in the range [0,1]. - SNorm: The components
are signed normalized values in the range [-1,1]. - UInt: The components are unsigned integer values in the range
[0, 2^(n-1)]. - SInt: The components are signed integer values in the range [-2^(n-1),2^(n-1)-1]. - UFloat: The
components are unsigned oating-point numbers (used by packed, shared exponent, and some compressed
formats). - SFloat: The components are signed oating-point numbers. - SRGB: The R, G, and B components are
unsigned normalized values that represent values using sRGB nonlinear encoding, while the A component (if one
exists) is a regular unsigned normalized value. - PACKnn: The format is packed into an underlying type with nn
bits.
See Also: Texture2D, texture assets.

Properties
None

The format is not speci ed.

R8_SRGB

A one-component, 8-bit unsigned normalized format that has a single 8bit R component stored with sRGB nonlinear encoding.

R8G8_SRGB

A two-component, 16-bit unsigned normalized format that has an 8-bit R
component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G
component stored with sRGB nonlinear encoding in byte 1.

R8G8B8_SRGB

A three-component, 24-bit unsigned normalized format that has an 8-bit
R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G
component stored with sRGB nonlinear encoding in byte 1, and an 8-bit B
component stored with sRGB nonlinear encoding in byte 2.

R8G8B8A8_SRGB

A four-component, 32-bit unsigned normalized format that has an 8-bit R
component stored with sRGB nonlinear encoding in byte 0, an 8-bit G
component stored with sRGB nonlinear encoding in byte 1, an 8-bit B
component stored with sRGB nonlinear encoding in byte 2, and an 8-bit A
component in byte 3.

R8_UNorm

A one-component, 8-bit unsigned normalized format that has a single 8bit R component.

R8G8_UNorm

A two-component, 16-bit unsigned normalized format that has an 8-bit R
component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G
component stored with sRGB nonlinear encoding in byte 1.

R8G8B8_UNorm

A three-component, 24-bit unsigned normalized format that has an 8-bit
R component in byte 0, an 8-bit G component in byte 1, and an 8-bit B
component in byte 2.

R8G8B8A8_UNorm

A four-component, 32-bit unsigned normalized format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, an 8-bit B
component in byte 2, and an 8-bit A component in byte 3.

R8_SNorm

A one-component, 8-bit signed normalized format that has a single 8-bit R
component.

R8G8_SNorm

A two-component, 16-bit signed normalized format that has an 8-bit R
component stored with sRGB nonlinear encoding in byte 0, and an 8-bit G
component stored with sRGB nonlinear encoding in byte 1.

R8G8B8_SNorm

A three-component, 24-bit signed normalized format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, and an 8-bit B
component in byte 2.

R8G8B8A8_SNorm

A four-component, 32-bit signed normalized format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, an 8-bit B
component in byte 2, and an 8-bit A component in byte 3.

R8_UInt

A one-component, 8-bit unsigned integer format that has a single 8-bit R
component.

R8G8_UInt

A two-component, 16-bit unsigned integer format that has an 8-bit R
component in byte 0, and an 8-bit G component in byte 1.

R8G8B8_UInt

A three-component, 24-bit unsigned integer format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, and an 8-bit B
component in byte 2.

R8G8B8A8_UInt

A four-component, 32-bit unsigned integer format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, an 8-bit B
component in byte 2, and an 8-bit A component in byte 3.

R8_SInt

A one-component, 8-bit signed integer format that has a single 8-bit R
component.

R8G8_SInt

A two-component, 16-bit signed integer format that has an 8-bit R
component in byte 0, and an 8-bit G component in byte 1.

R8G8B8_SInt

A three-component, 24-bit signed integer format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, and an 8-bit B
component in byte 2.

R8G8B8A8_SInt

A four-component, 32-bit signed integer format that has an 8-bit R
component in byte 0, an 8-bit G component in byte 1, an 8-bit B
component in byte 2, and an 8-bit A component in byte 3.

R16_UNorm

A one-component, 16-bit unsigned normalized format that has a single
16-bit R component.

R16G16_UNorm

A two-component, 32-bit unsigned normalized format that has a 16-bit R
component in bytes 0..1, and a 16-bit G component in bytes 2..3.

R16G16B16_UNorm

A three-component, 48-bit unsigned normalized format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit
B component in bytes 4..5.

R16G16B16A16_UNorm

A four-component, 64-bit unsigned normalized format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B
component in bytes 4..5, and a 16-bit A component in bytes 6..7.

R16_SNorm

A one-component, 16-bit signed normalized format that has a single 16bit R component.

R16G16_SNorm

A two-component, 32-bit signed normalized format that has a 16-bit R
component in bytes 0..1, and a 16-bit G component in bytes 2..3.

R16G16B16_SNorm

A three-component, 48-bit signed normalized format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit
B component in bytes 4..5.

R16G16B16A16_SNorm

A four-component, 64-bit signed normalized format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B
component in bytes 4..5, and a 16-bit A component in bytes 6..7.

R16_UInt

A one-component, 16-bit unsigned integer format that has a single 16-bit

R component.
R16G16_UInt

A two-component, 32-bit unsigned integer format that has a 16-bit R
component in bytes 0..1, and a 16-bit G component in bytes 2..3.

R16G16B16_UInt

A three-component, 48-bit unsigned integer format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit
B component in bytes 4..5.

R16G16B16A16_UInt

A four-component, 64-bit unsigned integer format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B
component in bytes 4..5, and a 16-bit A component in bytes 6..7.

R16_SInt

A one-component, 16-bit signed integer format that has a single 16-bit R
component.

R16G16_SInt

A two-component, 32-bit signed integer format that has a 16-bit R
component in bytes 0..1, and a 16-bit G component in bytes 2..3.

R16G16B16_SInt

A three-component, 48-bit signed integer format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit
B component in bytes 4..5.

R16G16B16A16_SInt

A four-component, 64-bit signed integer format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B
component in bytes 4..5, and a 16-bit A component in bytes 6..7.

R32_UInt

A one-component, 32-bit unsigned integer format that has a single 32-bit
R component.

R32G32_UInt

A two-component, 64-bit unsigned integer format that has a 32-bit R
component in bytes 0..3, and a 32-bit G component in bytes 4..7.

R32G32B32_UInt

A three-component, 96-bit unsigned integer format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit
B component in bytes 8..11.

R32G32B32A32_UInt

A four-component, 128-bit unsigned integer format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B
component in bytes 8..11, and a 32-bit A component in bytes 12..15.

R32_SInt

A one-component, 32-bit signed integer format that has a single 32-bit R
component.

R32G32_SInt

A two-component, 64-bit signed integer format that has a 32-bit R
component in bytes 0..3, and a 32-bit G component in bytes 4..7.

R32G32B32_SInt

A three-component, 96-bit signed integer format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit
B component in bytes 8..11.

R32G32B32A32_SInt

A four-component, 128-bit signed integer format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B
component in bytes 8..11, and a 32-bit A component in bytes 12..15.

R16_SFloat

A one-component, 16-bit signed oating-point format that has a single 16bit R component.

R16G16_SFloat

A two-component, 32-bit signed oating-point format that has a 16-bit R
component in bytes 0..1, and a 16-bit G component in bytes 2..3.

R16G16B16_SFloat

A three-component, 48-bit signed oating-point format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit
B component in bytes 4..5.

R16G16B16A16_SFloat

A four-component, 64-bit signed oating-point format that has a 16-bit R
component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B
component in bytes 4..5, and a 16-bit A component in bytes 6..7.

R32_SFloat

A one-component, 32-bit signed oating-point format that has a single 32bit R component.

R32G32_SFloat

A two-component, 64-bit signed oating-point format that has a 32-bit R
component in bytes 0..3, and a 32-bit G component in bytes 4..7.

R32G32B32_SFloat

A three-component, 96-bit signed oating-point format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit
B component in bytes 8..11.

R32G32B32A32_SFloat

A four-component, 128-bit signed oating-point format that has a 32-bit R
component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B
component in bytes 8..11, and a 32-bit A component in bytes 12..15.

B8G8R8_SRGB

A three-component, 24-bit unsigned normalized format that has an 8-bit
R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G
component stored with sRGB nonlinear encoding in byte 1, and an 8-bit B
component stored with sRGB nonlinear encoding in byte 2.

B8G8R8A8_SRGB

A four-component, 32-bit unsigned normalized format that has an 8-bit B
component stored with sRGB nonlinear encoding in byte 0, an 8-bit G
component stored with sRGB nonlinear encoding in byte 1, an 8-bit R
component stored with sRGB nonlinear encoding in byte 2, and an 8-bit A
component in byte 3.

B8G8R8_UNorm

A three-component, 24-bit unsigned normalized format that has an 8-bit
B component in byte 0, an 8-bit G component in byte 1, and an 8-bit R
component in byte 2.

B8G8R8A8_UNorm

A four-component, 32-bit unsigned normalized format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, an 8-bit R
component in byte 2, and an 8-bit A component in byte 3.

B8G8R8_SNorm

A three-component, 24-bit signed normalized format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, and an 8-bit R
component in byte 2.

B8G8R8A8_SNorm

A four-component, 32-bit signed normalized format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, an 8-bit R
component in byte 2, and an 8-bit A component in byte 3.

B8G8R8_UInt

A three-component, 24-bit unsigned integer format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, and an 8-bit R
component in byte 2

B8G8R8A8_UInt

A four-component, 32-bit unsigned integer format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, an 8-bit R
component in byte 2, and an 8-bit A component in byte 3.

B8G8R8_SInt

A three-component, 24-bit signed integer format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, and an 8-bit R
component in byte 2.

B8G8R8A8_SInt

A four-component, 32-bit signed integer format that has an 8-bit B
component in byte 0, an 8-bit G component in byte 1, an 8-bit R
component in byte 2, and an 8-bit A component in byte 3.

R4G4B4A4_UNormPack16

A four-component, 16-bit packed unsigned normalized format that has a
4-bit R component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit
B component in bits 4..7, and a 4-bit A component in bits 0..3.

B4G4R4A4_UNormPack16

A four-component, 16-bit packed unsigned normalized format that has a
4-bit B component in bits 12..15, a 4-bit G component in bits 8..11, a 4-bit
R component in bits 4..7, and a 4-bit A component in bits 0..3.

R5G6B5_UNormPack16

A three-component, 16-bit packed unsigned normalized format that has a
5-bit R component in bits 11..15, a 6-bit G component in bits 5..10, and a
5-bit B component in bits 0..4.

B5G6R5_UNormPack16

A three-component, 16-bit packed unsigned normalized format that has a
5-bit B component in bits 11..15, a 6-bit G component in bits 5..10, and a
5-bit R component in bits 0..4.

R5G5B5A1_UNormPack16

A four-component, 16-bit packed unsigned normalized format that has a
5-bit R component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit
B component in bits 1..5, and a 1-bit A component in bit 0.

B5G5R5A1_UNormPack16

A four-component, 16-bit packed unsigned normalized format that has a
5-bit B component in bits 11..15, a 5-bit G component in bits 6..10, a 5-bit
R component in bits 1..5, and a 1-bit A component in bit 0.

A1R5G5B5_UNormPack16

A four-component, 16-bit packed unsigned normalized format that has a
1-bit A component in bit 15, a 5-bit R component in bits 10..14, a 5-bit G

component in bits 5..9, and a 5-bit B component in bits 0..4.
E5B9G9R9_UFloatPack32

A three-component, 32-bit packed unsigned oating-point format that has
a 5-bit shared exponent in bits 27..31, a 9-bit B component mantissa in
bits 18..26, a 9-bit G component mantissa in bits 9..17, and a 9-bit R
component mantissa in bits 0..8.

B10G11R11_UFloatPack32

A three-component, 32-bit packed unsigned oating-point format that has
a 10-bit B component in bits 22..31, an 11-bit G component in bits 11..21,
an 11-bit R component in bits 0..10.

A2B10G10R10_UNormPack32

A four-component, 32-bit packed unsigned normalized format that has a
2-bit A component in bits 30..31, a 10-bit B component in bits 20..29, a 10bit G component in bits 10..19, and a 10-bit R component in bits 0..9.

A2B10G10R10_UIntPack32

A four-component, 32-bit packed unsigned integer format that has a 2-bit
A component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G
component in bits 10..19, and a 10-bit R component in bits 0..9.

A2B10G10R10_SIntPack32

A four-component, 32-bit packed signed integer format that has a 2-bit A
component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G
component in bits 10..19, and a 10-bit R component in bits 0..9.

A2R10G10B10_UNormPack32

A four-component, 32-bit packed unsigned normalized format that has a
2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10bit G component in bits 10..19, and a 10-bit B component in bits 0..9.

A2R10G10B10_UIntPack32

A four-component, 32-bit packed unsigned integer format that has a 2-bit
A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G
component in bits 10..19, and a 10-bit B component in bits 0..9.

A2R10G10B10_SIntPack32

A four-component, 32-bit packed signed integer format that has a 2-bit A
component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G
component in bits 10..19, and a 10-bit B component in bits 0..9.

A2R10G10B10_XRSRGBPack32

A four-component, 32-bit packed unsigned normalized format that has a
2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The
components are gamma encoded and their values range from -0.5271 to
1.66894. The alpha component is clamped to either 0.0 or 1.0 on
sampling, rendering, and writing operations.

A2R10G10B10_XRUNormPack32

A four-component, 32-bit packed unsigned normalized format that has a
2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10bit G component in bits 10..19, and a 10-bit B component in bits 0..9. The
components are linearly encoded and their values range from -0.752941
to 1.25098 (pre-expansion). The alpha component is clamped to either 0.0
or 1.0 on sampling, rendering, and writing operations.

R10G10B10_XRSRGBPack32

A four-component, 32-bit packed unsigned normalized format that has a

10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and
a 10-bit B component in bits 0..9. The components are gamma encoded
and their values range from -0.5271 to 1.66894. The alpha component is
clamped to either 0.0 or 1.0 on sampling, rendering, and writing
operations.
R10G10B10_XRUNormPack32

A four-component, 32-bit packed unsigned normalized format that has a
10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and
a 10-bit B component in bits 0..9. The components are linearly encoded
and their values range from -0.752941 to 1.25098 (pre-expansion).

A10R10G10B10_XRSRGBPack32

A four-component, 64-bit packed unsigned normalized format that has a
10-bit A component in bits 30..39, a 10-bit R component in bits 20..29, a
10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9.
The components are gamma encoded and their values range from
-0.5271 to 1.66894. The alpha component is clamped to either 0.0 or 1.0
on sampling, rendering, and writing operations.

A10R10G10B10_XRUNormPack32

A four-component, 64-bit packed unsigned normalized format that has a
10-bit A component in bits 30..39, a 10-bit R component in bits 20..29, a
10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9.
The components are linearly encoded and their values range from
-0.752941 to 1.25098 (pre-expansion). The alpha component is clamped
to either 0.0 or 1.0 on sampling, rendering, and writing operations.

D16_UNorm

A one-component, 16-bit unsigned normalized format that has a single
16-bit depth component.

D24_UNorm

A two-component, 32-bit format that has 24 unsigned normalized bits in
the depth component and, optionally: 8 bits that are unused.

D24_UNorm_S8_UInt

A two-component, 32-bit packed format that has 8 unsigned integer bits
in the stencil component, and 24 unsigned normalized bits in the depth
component.

D32_SFloat

A one-component, 32-bit signed oating-point format that has 32-bits in
the depth component.

D32_SFloat_S8_Uint

A two-component format that has 32 signed oat bits in the depth
component and 8 unsigned integer bits in the stencil component. There
are optionally: 24-bits that are unused.

S8_Uint

A one-component, 8-bit unsigned integer format that has 8-bits in the
stencil component.

RGBA_DXT1_SRGB

A three-component, block-compressed format. Each 64-bit compressed
texel block encodes a 4×4 rectangle of unsigned normalized RGB texel
data with sRGB nonlinear encoding. This format has a 1 bit alpha channel.

RGBA_DXT1_UNorm

A three-component, block-compressed format. Each 64-bit compressed

texel block encodes a 4×4 rectangle of unsigned normalized RGB texel
data. This format has a 1 bit alpha channel.
RGBA_DXT3_SRGB

A four-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values with sRGB nonlinear encoding.

RGBA_DXT3_UNorm

A four-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values.

RGBA_DXT5_SRGB

A four-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values with sRGB nonlinear encoding.

RGBA_DXT5_UNorm

A four-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values.

R_BC4_UNorm

A one-component, block-compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
red texel data.

R_BC4_SNorm

A one-component, block-compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of signed normalized red
texel data.

RG_BC5_UNorm

A two-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RG texel data with the rst 64 bits encoding red values followed by 64 bits
encoding green values.

RG_BC5_SNorm

A two-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of signed normalized RG
texel data with the rst 64 bits encoding red values followed by 64 bits
encoding green values.

RGB_BC6H_UFloat

A three-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned oatingpoint RGB texel data.

RGB_BC6H_SFloat

A three-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of signed oating-point
RGB texel data.

RGBA_BC7_SRGB

A four-component, block-compressed format where each 128-bit

compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with sRGB nonlinear encoding applied to the RGB
components.
RGBA_BC7_UNorm

A four-component, block-compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data.

RGB_PVRTC_2Bpp_SRGB

A three-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 8×4 rectangle of unsigned normalized
RGB texel data with sRGB nonlinear encoding. This format has no alpha
and is considered opaque.

RGB_PVRTC_2Bpp_UNorm

A three-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 8×4 rectangle of unsigned normalized
RGB texel data. This format has no alpha and is considered opaque.

RGB_PVRTC_4Bpp_SRGB

A three-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data with sRGB nonlinear encoding. This format has no alpha
and is considered opaque.

RGB_PVRTC_4Bpp_UNorm

A three-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data. This format has no alpha and is considered opaque.

RGBA_PVRTC_2Bpp_SRGB

A four-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 8×4 rectangle of unsigned normalized
RGBA texel data with the rst 32 bits encoding alpha values followed by
32 bits encoding RGB values with sRGB nonlinear encoding applied.

RGBA_PVRTC_2Bpp_UNorm

A four-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 8×4 rectangle of unsigned normalized
RGBA texel data with the rst 32 bits encoding alpha values followed by
32 bits encoding RGB values.

RGBA_PVRTC_4Bpp_SRGB

A four-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 32 bits encoding alpha values followed by
32 bits encoding RGB values with sRGB nonlinear encoding applied.

RGBA_PVRTC_4Bpp_UNorm

A four-component, PVRTC compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 32 bits encoding alpha values followed by
32 bits encoding RGB values.

RGB_ETC_UNorm

A three-component, ETC compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data. This format has no alpha and is considered opaque.

RGB_ETC2_SRGB

A three-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data with sRGB nonlinear encoding. This format has no alpha
and is considered opaque.

RGB_ETC2_UNorm

A three-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data. This format has no alpha and is considered opaque.

RGB_A1_ETC2_SRGB

A four-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data with sRGB nonlinear encoding, and provides 1 bit of alpha.

RGB_A1_ETC2_UNorm

A four-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGB texel data, and provides 1 bit of alpha.

RGBA_ETC2_SRGB

A four-component, ETC2 compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values with sRGB nonlinear encoding applied.

RGBA_ETC2_UNorm

A four-component, ETC2 compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with the rst 64 bits encoding alpha values followed by
64 bits encoding RGB values.

R_EAC_UNorm

A one-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
red texel data.

R_EAC_SNorm

A one-component, ETC2 compressed format where each 64-bit
compressed texel block encodes a 4×4 rectangle of signed normalized red
texel data.

RG_EAC_UNorm

A two-component, ETC2 compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RG texel data with the rst 64 bits encoding red values followed by 64 bits
encoding green values.

RG_EAC_SNorm

A two-component, ETC2 compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of signed normalized RG
texel data with the rst 64 bits encoding red values followed by 64 bits
encoding green values.

RGBA_ASTC4X4_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data with sRGB nonlinear encoding applied to the RGB
components.

RGBA_ASTC4X4_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 4×4 rectangle of unsigned normalized
RGBA texel data.

RGBA_ASTC5X5_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 5×5 rectangle of unsigned normalized
RGBA texel data with sRGB nonlinear encoding applied to the RGB
components.

RGBA_ASTC5X5_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 5×5 rectangle of unsigned normalized
RGBA texel data.

RGBA_ASTC6X6_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 6×6 rectangle of unsigned normalized
RGBA texel data with sRGB nonlinear encoding applied to the RGB
components.

RGBA_ASTC6X6_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 6×6 rectangle of unsigned normalized
RGBA texel data.

RGBA_ASTC8X8_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes an 8×8 rectangle of unsigned normalized
RGBA texel data with sRGB nonlinear encoding applied to the RGB
components.

RGBA_ASTC8X8_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes an 8×8 rectangle of unsigned normalized
RGBA texel data.

RGBA_ASTC10X10_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 10×10 rectangle of unsigned
normalized RGBA texel data with sRGB nonlinear encoding applied to the
RGB components.

RGBA_ASTC10X10_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 10×10 rectangle of unsigned
normalized RGBA texel data.

RGBA_ASTC12X12_SRGB

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 12×12 rectangle of unsigned
normalized RGBA texel data with sRGB nonlinear encoding applied to the
RGB components.

RGBA_ASTC12X12_UNorm

A four-component, ASTC compressed format where each 128-bit
compressed texel block encodes a 12×12 rectangle of unsigned
normalized RGBA texel data.

Leave feedback

Description
Visible re ection probes sorting options.
See Also: CullingParameters.re ectionProbeSortOptions.

Properties
None

Do not sort re ection probes.

Importance

Sort probes by importance.

Size

Sort probes from largest to smallest.

ImportanceThenSize

Sort probes by importance, then by size.

Leave feedback

Description
What kind of per-object data to setup during rendering.
At minimum, object transformation matrices are set up per-object, but extra data (e.g. lightmaps, light probes
etc.) can be set up by combining RendererCon guration ags.
See Also: DrawRendererSettings, RenderLoop.DrawRenderers.

Properties
None

Do not setup any particular per-object data besides the
transformation matrix.

PerObjectLightProbe

Setup per-object light probe SH data.

PerObjectRe ectionProbes

Setup per-object re ection probe data.

PerObjectLightProbeProxyVolume

Setup per-object light probe proxy volume data.

PerObjectLightmaps

Setup per-object lightmaps.

ProvideLightIndices

Setup per-object light indices.

PerObjectMotionVectors

Setup per-object motion vectors.

PerObjectOcclusionProbe

Setup per-object occlusion probe data.

PerObjectOcclusionProbeProxyVolume

Setup per-object occlusion probe proxy volume data (occlusion in
alpha channels).

PerObjectShadowMask

Setup per-object shadowmask.

Leave feedback

Description
Speci es which parts of the render state that is overriden.
In order to override multiple parts of the render state, the desired values should be logically OR'd together.
See Also: RenderStateBlock.

Properties
Nothing

No render states are overridden.

Blend

When set, the blend state is overridden.

Raster

When set, the raster state is overridden.

Depth

When set, the depth state is overridden.

Stencil

When set, the stencil state and reference value is overridden.

Everything

When set, all render states are overridden.

Leave feedback

Description
How to sort objects during rendering.
Control the way Unity sorts objects before drawing them by using and combining these ags.
The basic ags are:
- SortingLayer,
- RenderQueue,
- BackToFront,
- QuantizedFrontToBack,
- OptimizeStateChanges,
- CanvasOrder.
Multiple ags, when combined, are applied in the above order.
Some commonly-used sorting combinations are provided for convenience. Use CommonOpaque for opaque
objects. This combination of ags includes optimization for reducing draw state changes and draws roughly frontto-back to reduce drawing over the same pixels many times. Use CommonTransparent for transparent objects,
which need to be sorted from back to front before being drawn for them all to be visible.
See Also: DrawRendererSettings.sorting, RenderLoop.DrawRenderers.

Properties
None

Do not sort objects.

SortingLayer

Sort by renderer sorting layer.

RenderQueue

Sort by material render queue.

BackToFront

Sort objects back to front.

QuantizedFrontToBack

Sort objects in rough front-to-back buckets.

OptimizeStateChanges

Sort objects to reduce draw state changes.

CanvasOrder

Sort renderers taking canvas order into account.

RendererPriority

Sorts objects by renderer priority.

CommonOpaque

Typical sorting for opaque objects.

CommonTransparent

Typical sorting for transparencies.

Leave feedback

Description
Flags for VisibleLight.
See Also: VisibleLight. ags, CullResults.visibleLights.

Properties
None

No ags are set.

IntersectsNearPlane

Light intersects near clipping plane.

IntersectsFarPlane

Light intersects far clipping plane.

Leave feedback

Description
Describes the information about the edge and how to tessellate it.

Properties
end

The maximum angle to be considered within this range.

order

The render order of the edges that belong in this range.

sprites

The list of Sprites that are associated with this range.

start

The minimum angle to be considered within this range.

Leave feedback

Description
A collection of APIs that facilitate pixel perfect rendering of sprite-based renderers.

Static Properties
pixelSnapSpacing

To achieve a pixel perfect render, Sprites must be displaced to discrete positions at
render time. This value de nes the minimum distance between these positions. This
doesn’t a ect the GameObject's transform position.

Leave feedback

Description
Data that describes the important points of the shape.

Properties
leftTangent

The position of the left tangent in local space.

mode

The various modes of the tangent handles. They could be continuous or broken.

position

The position of this point in the object's local space.

rightTangent

The position of the right tangent point in the local space.

Leave feedback

Description
A struct that holds a rich set of information that describes the bind pose of this Sprite.
Most importantly this struct describes the hierarchy and various other spatial relationships between the bones.

Properties
length

The length of the bone. This is important for the leaf bones to describe their length
without needing another bone as the terminal bone.

name

The name of the bone. This is useful when recreating bone hierarchy at editor or runtime.
You can also use this as a way of resolving the bone path when a Sprite is bound to a
more complex or richer hierarchy.

parentId

The ID of the parent of this bone.

position

The position in local space of this bone.

rotation

The rotation of this bone in local space.

Leave feedback

Description
A list of methods designed for reading and writing to the rich internal data of a Sprite.
It is now possible to read and write to all the channels of the VertexAttribute, BoneWeight, BindPose and the
SpriteBones of a Sprite.

Static Methods
GetBindPoses

Returns an array of BindPoses.

GetBones

Returns a list of SpriteBone in this Sprite.

GetBoneWeights

Returns a list of BoneWeight that corresponds to each and every vertice in this Sprite.

GetIndices

Returns a list of indices. This is the same as Sprite.triangle.

GetVertexAttribute

Retrieves a strided accessor to the internal vertex attributes.

GetVertexCount

Returns the number of vertices in this Sprite.

HasVertexAttribute

Checks if a speci c channel exists for this Sprite.

SetBindPoses

Sets the bind poses for this Sprite.

SetBones

Sets the SpriteBones for this Sprite.

SetBoneWeights

Sets the BoneWeight for this Sprite. The length of the input array must match the
number of vertices.

SetIndices

Set the indices for this Sprite. This is the same as Sprite.triangle.

SetVertexAttribute

Sets a speci c channel of the VertexAttribute.

SetVertexCount

Sets the vertex count. This resizes the internal bu er. It also preserves any
con gurations of VertexAttributes.

Leave feedback

Description
A list of methods that allow the caller to override what the SpriteRenderer renders.
This feature is used mainly in the Sprite Animation feature. The SpriteSkin component gets the deformable bu er
and deforms it using the skin weights and bones. After the deformation is complete, the Sprite Renderer uses it to
render the Sprite instead of the Sprite's original mesh.

Static Methods
DeactivateDeformableBu er

Stop using the deformable bu er to render the Sprite and use the original
mesh instead.

GetDeformableVertices

Returns an array of vertices to be deformed by the caller.

UpdateDeformableBu er

Provides the JobHandle that updates the deform bu er to the SpriteRenderer.

Leave feedback

Description
Additional data about the shape's control point. This is useful during tessellation of the shape.

Properties
bevelCuto

The threshold of the angle that decides if it should be tessellated as a curve or a corner.

bevelSize

The radius of the curve to be tessellated.

corner

True will indicate that this point should be tessellated as a corner or a continuous line
otherwise.

height

The height of the tessellated edge.

spriteIndex

The Sprite to be used for a particular edge.

Leave feedback

Description
Input parameters for the SpriteShape tessellator.

Properties
adaptiveUV

If enabled, the tessellator will adapt the size of the quads based on the height of the edge.

angleThreshold

The threshold of the angle that indicates whether it is a corner or not.

bevelCuto

The threshold of the angle that decides if it should be tessellated as a curve or a corner.

bevelSize

The radius of the curve to be tessellated.

borderPivot

The local displacement of the Sprite when tessellated.

carpet

If true, the Shape will be tessellated as a closed form.

llScale

The scale to be used to calculate the UVs of the ll texture.

llTexture

The texture to be used for the ll of the SpriteShape.

smartSprite

If enabled the tessellator will consider creating corners based on the various input
parameters.

splineDetail

The tessellation quality of the input Spline that determines the complexity of the mesh.

spriteBorders

The borders to be used for calculating the uv of the edges based on the border info found
in Sprites.

transform

The world space transform of the game object used for calculating the UVs of the ll
texture.

Leave feedback

Description
Renders SpriteShapes de ned through the SpriteShapeUtility.GenerateSpriteShape API.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or

re ection probe.
realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback

Description
A static class that helps tessellate a SpriteShape mesh.

Static Methods
Generate

Generate a mesh based on input parameters.

GenerateSpriteShape

Generate a mesh based on input parameters.

Leave feedback

Description
This enumeration contains values to control how an element is aligned in its parent during the layout phase.
The cross axis of a container is perpendicular to the primary axis on which children are laid out, that is, its ex
direction.

Properties
Auto

Default value (currently FlexStart).

FlexStart

Items are aligned at the beginning on the cross axis.

Center

Items are centered on the cross axis.

FlexEnd

Items are aligned at the end on the cross axis.

Stretch

Stretches items on the cross axis.

Leave feedback

Description
This enumeration de nes values used to control in which direction a container will place its children during
layout.

Properties
Column

Vertical layout.

ColumnReverse

Vertical layout in reverse order.

Row

Horizontal layout.

RowReverse

Horizontal layout in reverse order.

Leave feedback

Description
This enumeration contains values to control how children are justi ed during layout.
The main axis of a container is the primary axis on which children are laid out, that is, its ex direction.

Properties
FlexStart

Items are justi ed towards the beginning of the main axis.

Center

Items are centered.

FlexEnd

Items are justi ed towards the end of the layout direction.

SpaceBetween

Items are evenly distributed in the line; rst item is at the beginning of the line, last item is
at the end.

SpaceAround

Items are evenly distributed in the line with extra space on each end of the line.

Leave feedback

Description
This enumeration contains values to control how an element is positioned in its parent container.

Properties
Relative

The element is positioned in relation to its default box as calculated by layout.

Absolute

The element is positioned in relation to its parent box and does not contribute to the
layout anymore.

Leave feedback

Description
This enumeration contains values to specify whether or not an element is visible.

Properties
Visible

The element is drawn normally (default).

Hidden

The picking and rendering of this element is skipped. It still takes space in the layout.

Leave feedback

Description
This enumeration contains values to control how elements are placed in a container if not enough space is
available.

Properties
NoWrap

All elements are placed on the same line.

Wrap

Elements are placed over multiple lines.

WrapReverse

Elements are placed over multiple lines with new lines occuring in the reverse order set in
the container.

Leave feedback

Description
This generic structure encodes a value type that can come from USS or be speci ed programmatically.
A StyleValue struct wraps value types such as an integer or a color along with some metadata for the
application of USS at runtime.

Static Properties
nil

This represents the default value for a StyleValue of the according generic type.

Properties
value

The actual value of the StyleValue.

Constructors
StyleValue_1

This constructor can be used to speci ed an alternate default value but it is
recommended to use StyleValue.nil.

Public Methods
GetSpeci edValueOrDefault

Utility function to be used when reading custom styles values and provide a
default value in one step.

Static Methods
Create

Creates a StyleValue of the according generic type directly from a value.

Leave feedback

Description
This interface exposes methods to read custom style properties applied from USS les to visual elements.

Public Methods
ApplyCustomProperty

Read a style property value into the speci ed StyleValue.

Leave feedback

Description
Event sent after an element is added to an element that is a descendent of a panel.

Constructors
AttachToPanelEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool
of reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

destinationPanel

In the case of AttachToPanelEvent, the panel to which the event target
element is now attached. In the case of DetachFromPanelEvent, the panel
to which the event target element will be attached.

originPanel

In the case of AttachToPanelEvent, the panel to which the event target
element was attached. In the case of DetachFromPanelEvent, the panel
from which the event target element is detached.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this

function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent immediately after an element has lost focus. This event trickles down, it does not bubble up, and it
cannot be cancelled.

Constructors
BlurEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

direction

Direction of the focus change.

relatedTarget

For FocusOut and Blur events, contains the element that gains the focus.
For FocusIn and Focus events, contains the element that loses the focus.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes the event with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Styled visual element to match the IMGUI Box Style.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods

HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of

its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.
GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods

OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback
Implements interfaces:IEventHandler

Description
Interface for classes capable of having callbacks to handle events.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase have
been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown phase, are
attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already been
registered for the same phase (either TrickleDown or BubbleUp) then this method
has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Leave feedback
Implements interfaces:IChangeEvent

Description
Sends an event when a value in a eld changes.

Properties
newValue

The new value.

previousValue

The value before the change occured.

Constructors
ChangeEvent_1

Constructor.

Protected Methods
Init

Sets the event to its initial state.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since

not all events are generated by IMGUI.
isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback
Implements interfaces:ICommandEvent

Description
Base class for command events.

Properties
commandName

Name of the command.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
The event sent when clicking the right mouse button.

Constructors
ContextClickEvent

Constructor.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the

TrickleDown phase.
actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Use this class to display a contextual menu.

Public Methods
DisplayMenu

Displays the contextual menu.

DisplayMenuIfEventMatches

Checks if the event triggers the display of the contextual menu. This method
also displays the menu.

Leave feedback

Description
Manipulator that displays a contextual menu when the user clicks the right mouse button or presses the menu
key on the keyboard.

Constructors
ContextualMenuManipulator

Constructor.

Protected Methods
RegisterCallbacksOnTarget

Register the event callbacks on the manipulator target.

UnregisterCallbacksFromTarget

Unregister the event callbacks from the manipulator target.

Inherited Members
Properties
target

The element that handles the interaction.

Leave feedback

Description
The event sent when a contextual menu requires menu items.

Properties
menu

The menu to populate.

triggerEvent

The event that triggered the ContextualMenuPopulateEvent.

Constructors
ContextualMenuPopulateEvent

Constructor.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Retrieves an event from the event pool. Use this method to retrieve a mouse event and
initialize the event, instead of creating a new mouse event. Events obtained from this
method should be released back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods

Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
This class is used during UXML template instantiation.

Leave feedback

Description
Script interface for VisualElement cursor style property IStyle.cursor.

Properties
hotspot

The o set from the top left of the texture to use as the target point (must be within the
bounds of the cursor).

texture

The texture to use for the cursor style. To use a texture as a cursor, import the texture
with "Read/Write enabled" in the texture importer (or using the "Cursor" defaults).

Leave feedback

Description
Event sent just before an element is detach from its parent, if the parent is the descendant of a panel.

Constructors
DetachFromPanelEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a
pool of reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

destinationPanel

In the case of AttachToPanelEvent, the panel to which the event target
element is now attached. In the case of DetachFromPanelEvent, the panel
to which the event target element will be attached.

originPanel

In the case of AttachToPanelEvent, the panel to which the event target
element was attached. In the case of DetachFromPanelEvent, the panel
from which the event target element is detached.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this

function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback
Implements interfaces:IDragAndDropEvent

Description
Base class for drag and drop events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Use the DragEnterEvent class to manage events that occur when dragging enters an element or one of its
descendants. The DragEnterEvent is cancellable, it does not trickle down, and it does not bubble up.

Constructors
DragEnterEvent

Constructor. Avoid renewing events. Instead, use GetPooled() to get an event from a pool
of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
The event sent to a dragged element when the drag and drop process ends.

Constructors
DragExitedEvent

Constructor.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements

along the propagation path.
timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Use the DragLeaveEvent class to manage events sent when dragging leaves an element or one of its descendants.
The DragLeaveEvent is cancellable, it does not trickle down, and it does not bubble up.

Constructors
DragLeaveEvent

Constructor. Avoid renewing events. Instead, use GetPooled() to get an event from a pool
of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
The event sent to an element when another element is dragged and dropped on the element.

Constructors
DragPerformEvent

Constructor.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the

TrickleDown phase.
actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
The event sent when the element being dragged enters a possible drop target.

Constructors
DragUpdatedEvent

Constructor.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the

TrickleDown phase.
actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
The base class for all UIElements events.

Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Protected Methods
Init

Resets all event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

Leave feedback

Description
Generic base class for events, implementing event pooling and automatic registration to the event type system.

Public Methods
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Static Methods
RegisterEventType

Registers an event class to the event type system.

Leave feedback

Description
The event sent when an element should execute a command.

Constructors
ExecuteCommandEvent

Constructor.

Inherited Members
Properties
commandName

Name of the command.

bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets the event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Base class for objects that can get the focus.
The focus is used to designate an element that will receive keyboard events.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

Public Methods
Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Inherited Members
Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase have
been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown phase, are
attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already been
registered for the same phase (either TrickleDown or BubbleUp) then this method
has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Leave feedback

Description
Base class for de ning in which direction the focus moves in a focus ring.
Focus ring implementations can move the focus in various direction; they can derive from this class to formalize
the various ways the focus can change from one element to the other.

Static Properties
lastValue

Last value for the direction de ned by this class.

none

The null direction. This is usually used when the focus stays on the same element.

unspeci ed

Focus came from an unspeci ed direction, for example after a mouse down.

Operators
int

The underlying integer value for this direction.

Leave feedback

Description
Class in charge of managing the focus inside a Panel.
Each Panel should have an instance of this class. The instance holds the currently focused element and is
responsible for changing it.

Properties
focusedElement

The currently focused element.

Constructors
FocusController

Constructor.

Public Methods
SwitchFocusOnEvent

Ask the controller to change the focus according to the event. The focus controller will
use its focus ring to choose the next element to be focused.

Leave feedback

Description
Event sent immediately after an element has gained focus. This event trickles down, it does not bubble up, and it
cannot be cancelled.

Constructors
FocusEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

direction

Direction of the focus change.

relatedTarget

For FocusOut and Blur events, contains the element that gains the focus.
For FocusIn and Focus events, contains the element that loses the focus.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes the event with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback
Implements interfaces:IFocusEvent

Description
Base class for focus related events.

Properties
direction

Direction of the focus change.

relatedTarget

For FocusOut and Blur events, contains the element that gains the focus. For FocusIn and
Focus events, contains the element that loses the focus.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes the event with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Event sent immediately before an element gains focus. This event trickles down and bubbles up. This event
cannot be cancelled.

Constructors
FocusInEvent

Constructor.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,

this target does not change when the event is sent to other elements
along the propagation path.
timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

direction

Direction of the focus change.

relatedTarget

For FocusOut and Blur events, contains the element that gains the focus.
For FocusIn and Focus events, contains the element that loses the focus.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes the event with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent immediately before an element loses focus. This event trickles down and bubbles up. This event
cannot be cancelled.

Constructors
FocusOutEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

direction

Direction of the focus change.

relatedTarget

For FocusOut and Blur events, contains the element that gains the focus.
For FocusIn and Focus events, contains the element that loses the focus.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes the event with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent after layout calculations, when the position or the dimension of an element changes. This event cannot
be cancelled, it does not trickle down, and it does not bubble up.

Properties
newRect

The new dimensions of the element.

oldRect

The old dimensions of the element.

Constructors
GeometryChangedEvent

Constructor.

Protected Methods
Init

Resets the event values to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes the event with the speci ed values. Use
this method instead of instancing new events. Use Dispose() to release events back to the
event pool.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since

not all events are generated by IMGUI.
isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
A VisualElement representing a source texture.

Properties
image

The source texture of the Image element.

sourceRect

The source rectangle inside the texture relative to the top left corner.

uv

The base texture coordinates of the Image relative to the bottom left corner.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside

the VisualTree hierarchy
GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
Class used to send a IMGUI event that has no equivalent UIElements event.

Constructors
IMGUIEvent

Constructor. Use GetPooled() to get an event from a pool of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed

to the current target local coordinates.
pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Sends an event when text from a TextField changes.

Properties
newData

The new text.

previousData

The text before the change occured.

Constructors
InputEvent

Constructor.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback
Implements interfaces:IKeyboardEvent

Description
Base class for keyboard events.

Properties
actionKey

Returns true if the platform speci c action key is pressed. This key is Command on macOS
and Control otherwise.

altKey

Returns true if the Alt key is pressed.

character

The character.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

keyCode

The key code.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift, Windows/Command).

shiftKey

Returns true if the Shift key is pressed.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets a keyboard event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event

cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.
ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Event sent when a key is pressed on the keyboard. This event trickles down and bubbles up. This event is
cancellable.

Constructors
KeyDownEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

character

The character.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

keyCode

The key code.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets a keyboard event from the event pool and initializes it with the given values. Use
this function instead of creating new events. Events obtained from this method should
be released back to the pool using Dispose().

Leave feedback

Description
Event sent when a key is released on the keyboard. This event trickles down and bubbles up. This event is
cancellable.

Constructors
KeyUpEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

character

The character.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

keyCode

The key code.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets a keyboard event from the event pool and initializes it with the given values. Use
this function instead of creating new events. Events obtained from this method should
be released back to the pool using Dispose().

Leave feedback

Description
A vertically scrollable area that only creates visual elements for visible items while allowing the binding of many
more items. As the user scrolls, visual elements are recycled and re-bound to new data items.

Properties
bindItem

Callback for binding a data item to the visual element.

itemHeight

ListView requires all visual elements to have the same height so that it can calculate a
sensible scroller size. This property must be set for the list view to function.

itemsSource

The items data source. This property must be set for the list view to function.

makeItem

Callback for constructing the VisualElement that will serve as the template for each
recycled and re-bound element in the list. This property must be set for the list view to
function.

selectedIndex

Currently selected item index in the items source. If multiple items are selected, this will
return the rst selected item's index.

selectedItem

The currently selected item from the items source. If multiple items are selected, this will
return the rst selected item.

selectionType

Controls the selection state, whether: selections are disabled, there is only one selectable
item, or if there are multiple selectable items.

Public Methods
Refresh

Clear, recreate all visible visual elements, and rebind all items. This should be called
whenever the items source changes.

ScrollTo

Scroll to a speci c visual element.

ScrollToItem

Scroll so that a speci c item index from the items source is visible.

Events
onItemChosen

Callback for when an item is chosen (double-click). This is di erent from just a
selection.

onSelectionChanged

Callback for a selection change.

Inherited Members

Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
Used by manipulators to match events against their requirements.

using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.UIElements;

public class ClickableTest
{
public void CreateClickable()
{
var clickable = new Clickable(() => { Debug.Log("Clicked!"); });
clickable.activators.Add(new ManipulatorActivationFilter { button = Mous
clickable.activators.Add(new ManipulatorActivationFilter { button = Mous
}
}

Properties
button

The button that activates the manipulation.

clickCount

Number of mouse clicks required to activate the manipulator.

modi ers

Any modi er keys (ie. ctrl, alt, ...) that are needed to activate the manipulation.

Public Methods
Matches

Returns true if the current mouse event satis es the activation requirements.

Leave feedback

Description
Class that manages capturing mouse events.

Static Methods
CaptureMouse

Assigns an event handler to capture mouse events.

HasMouseCapture

Checks if the event handler is capturing the mouse.

IsMouseCaptured

Checks if there is a handler capturing the mouse.

ReleaseMouse

Stops an event handler from capturing the mouse.

Leave feedback

Description
Event sent after a handler starts capturing the mouse.

Constructors
MouseCaptureEvent

Constructor.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the

TrickleDown phase.
relatedTarget

In the case of a MouseCaptureEvent, this property is the IEventHandler
that loses the capture. In the case of a MouseCaptureOutEvent, this
property is the IEventHandler that gains the capture.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Retrieves an event from the event pool. Use this method to retrieve a mouse event and
initialize the event, instead of creating a new mouse event. Events obtained from this
method should be released back to the pool using Dispose().

Leave feedback
Implements interfaces:IMouseCaptureEvent

Description
Event sent when the handler capturing the mouse changes.

Properties
relatedTarget

In the case of a MouseCaptureEvent, this property is the IEventHandler that loses the
capture. In the case of a MouseCaptureOutEvent, this property is the IEventHandler that
gains the capture.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Retrieves an event from the event pool. Use this method to retrieve a mouse event and
initialize the event, instead of creating a new mouse event. Events obtained from this
method should be released back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Event sent before a handler stops capturing the mouse.

Constructors
MouseCaptureOutEvent

Constructor.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags
imguiEvent

Flags for the event.
The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the

TrickleDown phase.
relatedTarget

In the case of a MouseCaptureEvent, this property is the IEventHandler
that loses the capture. In the case of a MouseCaptureOutEvent, this
property is the IEventHandler that gains the capture.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Retrieves an event from the event pool. Use this method to retrieve a mouse event and
initialize the event, instead of creating a new mouse event. Events obtained from this
method should be released back to the pool using Dispose().

Leave feedback

Description
Mouse down event.

Constructors
MouseDownEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent when the mouse pointer enters an element or one of its descendent elements. The event is
cancellable, it does not trickle down, and it does not bubble up.

Constructors
MouseEnterEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent when the mouse pointer enters a window. The event is cancellable, it does not trickle down, and it
does not bubble up.

Constructors
MouseEnterWindowEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a
pool of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback
Implements interfaces:IMouseEvent

Description
The base class for mouse events.

Properties
actionKey

Returns true if the platform speci c action key is pressed. This key is Command on
macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the propagation
path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift, Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event and the
current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event

handlers from executing on the current target.
StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Event sent when the mouse pointer exits an element and all its descendent elements. The event is cancellable, it
does not trickle down, and it does not bubble up.

Constructors
MouseLeaveEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent when the mouse pointer exits a window. The event is cancellable, it does not trickle down, and it does
not bubble up.

Constructors
MouseLeaveWindowEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from
a pool of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from

executing on the current target.
Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Mouse move event.

Constructors
MouseMoveEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent when the mouse pointer exits an element. The event trickles down, it bubbles up, and it is cancellable.

Constructors
MouseOutEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Event sent when the mouse pointer enters an element. The event trickles down, it bubbles up, and it is
cancellable.

Constructors
MouseOverEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Mouse up event.

Constructors
MouseUpEvent

Constructor. Avoid newing events. Instead, use GetPooled() to get an event from a pool of
reusable events.

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets the event members to their initial values.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

Leave feedback

Description
Styled visual element that matches the EditorGUILayout.Popup IMGUI element.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

text

The text associated with the element.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

MeasureTextSize

Computes the size needed to display a text string based on element style
values such as font, font-size, word-wrap, and so on.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the

class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
A button that executes an action repeatedly while it is pressed.

Constructors
RepeatButton

Constructor.

Public Methods
SetAction

Set the action that should be executed when the button is pressed.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

text

The text associated with the element.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

MeasureTextSize

Computes the size needed to display a text string based on element style
values such as font, font-size, word-wrap, and so on.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
Experimental.UIElements.Slider is a controller allowing the selection of a value from a range (min, max, value).

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
value

The value associated with the eld.

direction

This is the actual property to contain the direction of the slider.

highValue

This is the maximum value that the slider encodes.

lowValue

This is the minimum value that the slider encodes.

pageSize

This is a generic page size used to change the value when clicking in the slider.

range

This is the range from the minimum value to the maximum value of the slider.

value

The actual value of the slider.

binding

Binding object that will be updated.

bindingPath

Path of the target property to be bound.

canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
SetValueWithoutNotify

Allow to set a value without being of the change, if any.

AdjustDragElement

Method used to adjust the dragelement. Mainly used in a scroller.

HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's

contentContainer
RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
Template Container.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
binding

Binding object that will be updated.

bindingPath

Path of the target property to be bound.

canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this

VisualElement.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the

class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
A text eld is a rectangular area where the user can edit a string.

Properties
isPasswordField

Set this to true to mask the characters and false if otherwise.

multiline

Set this to true to allow multiple lines in the text eld and false if otherwise.

value

The string currently being exposed by the eld.

Constructors
TextField

Creates a new text eld.

Public Methods
OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or persistence
key have changed (VisualElement is properly parented).

SelectRange

Selects text in the text eld between cursorIndex and selectionIndex.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
value

The value associated with the eld.

binding

Binding object that will be updated.

bindingPath

Path of the target property to be bound.

canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that
the element can not be focused.

cursorColor

Color of the cursor.

cursorIndex

The current cursor position index in the text input eld.

doubleClickSelectsWord

Controls whether double clicking selects the word under the mouse pointer or not.

isDelayed

If set to true, the value property is not updated until either the user presses Enter
or the text eld loses focus.

isPasswordField

Returns true if the eld is used to edit a password.

maskChar

The character used for masking in a password eld.

maxLength

Maximum number of characters for the eld.

selectIndex

The current selection position index in the text input eld.

selectionColor

Background color of selected text.

tripleClickSelectsLine

Controls whether triple clicking selects the entire line under the mouse pointer or
not.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom
level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a
small amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods

SetValueWithoutNotify

Allow to set a value without being of the change, if any.

HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

SelectAll

Selects all the text.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst

VisualElement of this type
GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods

BuildContextualMenu

Add menu items to the text eld contextual menu.

OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback
Implements interfaces:IEventHandler

Description
Abstract base class used for all text-based elds.

Properties
cursorColor

Color of the cursor.

cursorIndex

The current cursor position index in the text input eld.

doubleClickSelectsWord

Controls whether double clicking selects the word under the mouse pointer or not.

isDelayed

If set to true, the value property is not updated until either the user presses Enter
or the text eld loses focus.

isPasswordField

Returns true if the eld is used to edit a password.

maskChar

The character used for masking in a password eld.

maxLength

Maximum number of characters for the eld.

selectIndex

The current selection position index in the text input eld.

selectionColor

Background color of selected text.

tripleClickSelectsLine

Controls whether triple clicking selects the entire line under the mouse pointer or
not.

Constructors
TextInputFieldBase_1

Constructor.

Public Methods
SelectAll

Selects all the text.

Protected Methods
BuildContextualMenu

Add menu items to the text eld contextual menu.

Inherited Members

Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
value

The value associated with the eld.

binding

Binding object that will be updated.

bindingPath

Path of the target property to be bound.

canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
SetValueWithoutNotify

Allow to set a value without being of the change, if any.

HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of

its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.
GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods

OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
This is the Toggle eld.

Properties
text

Optional text after the toggle.

Inherited Members
Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
value

The value associated with the eld.

binding

Binding object that will be updated.

bindingPath

Path of the target property to be bound.

canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
SetValueWithoutNotify

Allow to set a value without being of the change, if any.

HandleEvent

Handle an event, most often by executing the callbacks associated with
the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase
have been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown
phase, are attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already
been registered for the same phase (either TrickleDown or BubbleUp)
then this method has no e ect.

SendEvent

Sends an event to the event handler.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Leave feedback

Description
UQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a
complex hierarchy.

Leave feedback

Description
Utility Object that contructs a set of selection rules to be ran on a root visual element.

Constructors
UQuery.QueryBuilder_1

Initializes a QueryBuilder.

Public Methods
Active

Selects all elements that are active.

AtIndex

Convenience overload, shorthand for Build().AtIndex().

Build

Compiles the selection rules into a QueryState object.

Checked

Selects all elements that are checked.

Children

Selects all direct child elements of elements matching the previous rules.

Class

Selects all elements with the given class. Not to be confused with Type (see OfType<>()).

Descendents

Selects all elements that are descendants of currently matching ancestors.

Enabled

Selects all elements that are enabled.

First

Convenience overload, shorthand for Build().First().

Focused

Selects all elements that are enabled.

ForEach

Convenience overload, shorthand for Build().ForEach().

Hovered

Selects all elements that are hovered.

Last

Convenience overload, shorthand for Build().Last().

Name

Selects element with this name.

NotActive

Selects all elements that are not active.

NotChecked

Selects all elements that npot checked.

NotEnabled

Selects all elements that are not enabled.

NotFocused

Selects all elements that don't currently own the focus.

NotHovered

Selects all elements that are not hovered.

NotSelected

Selects all elements that are not selected.

NotVisible

Selects all elements that are not visible.

OfType

Selects all elements of the speci ed Type (eg: Label, Button, ScrollView, etc).

Selected

Selects all elements that are selected.

ToList

Convenience method. shorthand for Build().ToList.

Visible

Selects all elements that are visible.

Where

Selects all elements satifying the predicate.

Leave feedback

Description
Query object containing all the selection rules. Can be saved and rerun later without re-allocating memory.

Public Methods
AtIndex

Selects the n th element matching all the criteria, or null if not enough elements were
found.

First

The rst element matching all the criteria, or null if none was found.

ForEach

Invokes function on all elements matching the query.

Last

The last element matching all the criteria, or null if none was found.

RebuildOn

Creates a new QueryState with the same selection rules, applied on another
VisualElement.

ToList

Returns a list containing elements satisfying selection rules.

Leave feedback

Description
UQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a
complex hierarchy.

Static Methods
Q

Convenience overload, shorthand for Query.Build().First().

Query

Initializes a QueryBuilder with the speci ed selection rules.

Leave feedback

Description
Base class for describing an XML attribute.

Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
An enum to describe attribute use.

Properties
None

There is no restriction on the use of this attribute with the element.

Optional

The attribute is optional for the element.

Prohibited

The attribute should not appear for the element.

Required

The attribute must appear in the element tag.

Leave feedback

Description
Describes a XML bool attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlBoolAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describe an allowed child element for an element.

Properties
elementName

The name of the allowed child element.

elementNamespace

The namespace name of the allowed child element.

Constructors
UxmlChildElementDescription

Constructor.

Leave feedback

Description
Describes a XML attribute representing a Color as a string.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlColorAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describes a XML double attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlDoubleAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describes a XML attribute representing an enum as a string.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlEnumAttributeDescription_1

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Restricts the value of an attribute to be taken from a list of values.

Properties
values

The list of values the attribute can take.

Constructors
UxmlEnumeration

Constructor.

Public Methods
Equals

Indicates whether the current UxmlEnumeration object is equal to another object of the
same type.

Inherited Members

Leave feedback

Description
UxmlFactory specialization for classes that derive from VisualElement and that shares its traits,
VisualElementTraits.

Constructors
UxmlFactory_1

Constructor.

Inherited Members
Properties
canHaveAnyAttribute

Returns UxmlTraits.canHaveAnyAttribute (where UxmlTraits is the
argument for T1).

substituteForTypeName

Returns an empty string if T0 is not VisualElement; otherwise, returns
"VisualElement".

substituteForTypeNamespace

Returns the namespace for substituteForTypeName.

substituteForTypeQuali edName

Returns the fully quali ed name for substituteForTypeName.

uxmlAttributesDescription

Returns an empty enumerable.

uxmlChildElementsDescription

Returns an empty enumerable.

uxmlName

Returns the type name of T0.

uxmlNamespace

Returns the namespace name of T0.

uxmlQuali edName

Returns the typefully quali ed name of T0.

Public Methods
AcceptsAttributeBag

Returns true.

Create

Instantiate an object of type T0 and initialize it by calling T1 UxmlTraits.Init method.

Leave feedback
Implements interfaces:IUxmlFactory

Description
Generic base class for UXML factories, which instantiate a VisualElement using the data read from a UXML le.
T0 The type of the element that will be instantiated. It must derive from VisualElement.
T1 The traits of the element that will be instantiated. It must derive from UxmlTraits.

Properties
canHaveAnyAttribute

Returns UxmlTraits.canHaveAnyAttribute (where UxmlTraits is the
argument for T1).

substituteForTypeName

Returns an empty string if T0 is not VisualElement; otherwise, returns
"VisualElement".

substituteForTypeNamespace

Returns the namespace for substituteForTypeName.

substituteForTypeQuali edName

Returns the fully quali ed name for substituteForTypeName.

uxmlAttributesDescription

Returns an empty enumerable.

uxmlChildElementsDescription

Returns an empty enumerable.

uxmlName

Returns the type name of T0.

uxmlNamespace

Returns the namespace name of T0.

uxmlQuali edName

Returns the typefully quali ed name of T0.

Public Methods
AcceptsAttributeBag

Returns true.

Create

Instantiate an object of type T0 and initialize it by calling T1 UxmlTraits.Init method.

Leave feedback

Description
Describes a XML float attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlFloatAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describes a XML int attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlIntAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describes a XML long attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlLongAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Factory for the root UXML element.
This factory does not create any VisualElement. It exists solely for the purpose of schema generation.

Properties
substituteForTypeName

Returns the empty string, as the root element can not appear anywhere
else bit at the root of the document.

substituteForTypeNamespace

Returns the empty string, as the root element can not appear anywhere
else bit at the root of the document.

substituteForTypeQuali edName

Returns the empty string, as the root element can not appear anywhere
else bit at the root of the document.

uxmlName

Returns "UXML".

uxmlQuali edName

Returns the quali ed name for this element.

Constructors
UxmlRootElementFactory

Constructor.

Public Methods
Create

Returns null.

Inherited Members
Properties
canHaveAnyAttribute

Returns UxmlTraits.canHaveAnyAttribute (where UxmlTraits is the
argument for T1).

substituteForTypeName

Returns an empty string if T0 is not VisualElement; otherwise, returns
"VisualElement".

substituteForTypeNamespace

Returns the namespace for substituteForTypeName.

substituteForTypeQuali edName

Returns the fully quali ed name for substituteForTypeName.

uxmlAttributesDescription

Returns an empty enumerable.

uxmlChildElementsDescription

Returns an empty enumerable.

uxmlName

Returns the type name of T0.

uxmlNamespace

Returns the namespace name of T0.

uxmlQuali edName

Returns the typefully quali ed name of T0.

Public Methods
AcceptsAttributeBag

Returns true.

Leave feedback

Description
UxmlTraits for the UXML root element.

Properties
uxmlChildElementsDescription

Returns an enumerable containing
UxmlChildElementDescription(typeof(VisualElement)), since the root element
can contain VisualElements.

Constructors
UxmlRootElementTraits

Constructor.

Inherited Members
Properties
canHaveAnyAttribute

Must return true if the UXML element attributes are not restricted to the
values enumerated by UxmlTraits.uxmlAttributesDescription.

uxmlAttributesDescription

Describes the UXML attributes expected by the element. The attributes
enumerated here will appear in the UXML schema.

uxmlChildElementsDescription

Describes the types of element that can appear as children of this element in
a UXML le.

Public Methods
Init

Initialize a VisualElement instance with values from the UXML element attributes.

Leave feedback

Description
Describes a XML string attribute.

Properties
defaultValue

The default value for the attribute.

defaultValueAsString

The default value for the attribute, as a string.

Constructors
UxmlStringAttributeDescription

Constructor.

Public Methods
GetValueFromBag

Retrieves the value of this attribute from the attribute bag. Returns it if it is found,
otherwise return defaultValue.

Inherited Members
Properties
defaultValueAsString

The default value for the attribute, as a string.

name

The attribute name.

obsoleteNames

A list of obsolete names for this attribute.

restriction

Restrictions on the possible values of the attribute.

type

Attribute type.

typeNamespace

Attribute namespace.

use

Whether the attribute is optional, required or prohibited.

Protected Methods
GetValueFromBag

Get the attribute value from the attribute bag.

Leave feedback

Description
Describes a VisualElement derived class for the parsing of UXML les and the generation of UXML schema
de nition.
UxmlTraits describes the UXML attributes and children elements of a class deriving from VisualElement. It is used
by UxmlFactory to map UXML attributes to the C# class properties when reading UXML documents. It is also used
to generate UXML schema de nitions.

Properties
canHaveAnyAttribute

Must return true if the UXML element attributes are not restricted to the
values enumerated by UxmlTraits.uxmlAttributesDescription.

uxmlAttributesDescription

Describes the UXML attributes expected by the element. The attributes
enumerated here will appear in the UXML schema.

uxmlChildElementsDescription

Describes the types of element that can appear as children of this element in
a UXML le.

Public Methods
Init

Initialize a VisualElement instance with values from the UXML element attributes.

Leave feedback

Description
Base class to restricts the value of an attribute.

Public Methods
Equals

Indicates whether the current UxmlTypeRestriction object is equal to another object of the
same type.

Leave feedback

Description
Restricts the value of an attribute to be within the speci ed bounds.

Properties
excludeMax

True if the bounds exclude max.

excludeMin

True if the bounds exclude min.

max

The maximum value for the attribute.

min

The minimum value for the attribute.

Constructors
UxmlValueBounds

Constructor.

Public Methods
Equals

Indicates whether the current UxmlValueBounds object is equal to another object of the
same type.

Inherited Members

Leave feedback

Description
Restricts the value of an attribute to match a regular expression.

Properties
regex

The regular expression that should be matched by the value.

Constructors
UxmlValueMatches

Constructor.

Public Methods
Equals

Indicates whether the current UxmlValueMatches object is equal to another object of the
same type.

Inherited Members

Leave feedback

Description
The event sent to probe which elements accepts a command.

Constructors
ValidateCommandEvent

Constructor.

Inherited Members
Properties
commandName

Name of the command.

bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Protected Methods
Init

Resets the event members to their initial values.

Init

Resets all event members to their initial values.

Init

Resets all event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this
function instead of creating new events. Events obtained from this method should be
released back to the pool using Dispose().

RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback
Implements interfaces:IStyle, ITransform, IUIElementDataWatch, IVisualElementScheduler

Description
Base class for objects that are part of the UIElements visual tree.
VisualElement contains several features that are common to all controls in UIElements, such as layout, styling and
event handling. Several other classes derive from it to implement custom rendering and de ne behaviour for
controls.

Static Properties
defaultFocusIndex

The default focus index for newly created elements.

Properties
childCount

Number of child elements in this object's contentContainer

clippingOptions

Should this element clip painting to its boundaries.

contentContainer

child elements are added to this element, usually this

dataWatch

Access to this element data watch interface.

enabledInHierarchy

Returns true if the VisualElement is enabled in its own hierarchy.

enabledSelf

Returns true if the VisualElement is enabled locally.

persistenceKey

Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

schedule

Retrieves this VisualElement's IVisualElementScheduler

shadow

Access to this element physical hierarchy

style

Reference to the style object of this element.

this[int]

Access to this element physical hierarchy

tooltip

Text to display inside an information box after the user hovers the element for a small
amount of time.

userData

This property can be used to associate application-speci c user data with this
VisualElement.

Public Methods
Add

Add an element to this element's contentContainer

AddStyleSheetPath

Adds this stylesheet le to this element list of applied styles

BringToFront

Brings this element to the end of its parent children list. The element will
be visually in front of any overlapping sibling elements.

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

Contains

Returns true if the element is a direct child of this VisualElement

ElementAt

Retrieves the child element at position

EnableInClassList

Enables or disables the class with the given name.

FindAncestorUserData

Searchs up the hierachy of this VisualElement and retrieves stored
userData, if any is found.

FindCommonAncestor

Finds the lowest commont ancestor between two VisualElements inside
the VisualTree hierarchy

GetEnumerator

Allows to iterate into this elements children

GetFirstAncestorOfType

Walks up the hierarchy, starting from this element's parent, and returns
the rst VisualElement of this type

GetFirstOfType

Walks up the hierarchy, starting from this element, and returns the rst
VisualElement of this type

GetFullHierarchicalPersistenceKey

Combine this VisualElement's VisualElement.persistenceKey with those of
its parents to create a more unique key for use with
VisualElement.GetOrCreatePersistentData.

GetOrCreatePersistentData

Takes a reference to an existing persisted object and a key and returns
the object either lled with the persisted state or as-is.

HasStyleSheetPath

Checks if this stylesheet le is in this element list of applied styles

IndexOf

Retrieves the child index of the speci ed VisualElement.

Insert

Insert an element into this element's contentContainer

MarkDirtyRepaint

Triggers a repaint of the VisualElement on the next frame.

OnPersistentDataReady

Called when the persistent data is accessible and/or when the data or
persistence key have changed (VisualElement is properly parented).

OverwriteFromPersistedData

Overwrite object from the persistent data store.

PlaceBehind

Places this element right before the sibling element in their parent
children list. If the element and the sibling position overlap, the element
will be visually behind of its sibling.

PlaceInFront

Places this element right after the sibling element in their parent children
list. If the element and the sibling position overlap, the element will be
visually in front of its sibling.

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's
contentContainer

RemoveFromHierarchy

Removes this element from its parent hierarchy

RemoveStyleSheetPath

Removes this stylesheet le from this element list of applied styles

SavePersistentData

Write persistence data to le.

SendEvent

Sends an event to the event handler.

SendToBack

Sends this element to the beginning of its parent children list. The
element will be visually behind any overlapping sibling elements.

SetEnabled

Changes whether the current VisualElement is enabled or not. When
disabled, a VisualElement does not receive most events.

Sort

Reorders child elements from this VisualElement contentContainer.

ToggleInClassList

Toggles between adding and removing the given class name from the
class list.

Protected Methods
OnStyleResolved

Callback when the styles of an object have changed.

Inherited Members
Properties
canGrabFocus

Return true if the element can be focused.

focusController

Return the focus controller for this element.

focusIndex

An integer used to sort focusables in the focus ring. A negative value means that the
element can not be focused.

Public Methods
HandleEvent

Handle an event, most often by executing the callbacks associated with the event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase have

been attached on this object.
HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown phase, are
attached to this object.

RegisterCallback

Adds an event handler to the instance. If the event handler has already been
registered for the same phase (either TrickleDown or BubbleUp) then this method
has no e ect.

UnregisterCallback

Remove callback from the instance.

Blur

Tell the element to release the focus.

Focus

Attempt to give the focus to this element.

Leave feedback

Description
Hierarchy is a sctuct allowing access to the shadow hierarchy of visual elements

Properties
childCount

Number of child elements in this object's contentContainer

parent

Access the physical parent of this element in the hierarchy

this[int]

Access to this element physical hierarchy

Public Methods
Add

Add an element to this element's contentContainer

Children

Returns the elements from its contentContainer

Clear

Remove all child elements from this element's contentContainer

ElementAt

Retrieves the child element at position

IndexOf

Retrieves the index of the speci ed VisualElement in the Hierarchy.

Insert

Insert an element into this element's contentContainer

Remove

Removes this child from the hierarchy

RemoveAt

Remove the child element located at this position from this element's contentContainer

Sort

Reorders child elements from this VisualElement contentContainer.

Leave feedback

Description
Options to select clipping strategy.

Properties
ClipContents

Will enable clipping. This VisualElement and its children's content will be limited to
this element's bounds.

NoClipping

Will disable clipping and let children VisualElements paint outside its bounds.

ClipAndCacheContents

Enables clipping and renders contents to a cache texture.

Leave feedback

Description
The modes available to measure VisualElement sizes.
This enum value is passed to UIElements.VisualElement.DoMeasure. This lets UI elements indicate their natural
size during the layout algorithm.
See Also:UIElements.VisualElement.MeasureTextSize.

Properties
Unde ned

The element should give its preferred width/height without any constraint.

Exactly

The element should give the width/height that is passed in and derive the opposite site
from this value (for example, calculate text size from a xed width).

AtMost

At Most. The element should give its preferred width/height but no more than the value
passed.

Leave feedback

Description
VisualElementExtensions is a set of extension methods useful for VisualElement.

Static Methods
AddManipulator

Add a manipulator associated to a VisualElement.

RemoveManipulator

Remove a manipulator associated to a VisualElement.

StretchToParentWidth

The given VisualElement's left and right edges will be aligned with the corresponding
edges of the parent element.

Leave feedback

Description
De ne focus change directions for the VisualElementFocusRing.

Static Properties
lastValue

Last value for the direction de ned by this class.

left

The focus is moving to the left.

right

The focus is moving to the right.

Inherited Members
Static Properties
lastValue

Last value for the direction de ned by this class.

none

The null direction. This is usually used when the focus stays on the same element.

unspeci ed

Focus came from an unspeci ed direction, for example after a mouse down.

Operators
int

The underlying integer value for this direction.

Leave feedback
Implements interfaces:IFocusRing

Description
Implementation of a linear focus ring. Elements are sorted according to their focusIndex.

Properties
defaultFocusOrder

The focus order for elements having 0 has a focusIndex.

Constructors
VisualElementFocusRing

Constructor.

Public Methods
GetFocusChangeDirection

Get the direction of the focus change for the given event. For example, when the
Tab key is pressed, focus should be given to the element to the right in the focus
ring.

GetNextFocusable

Get the next element in the given direction.

Leave feedback

Description
Ordering of elements in the focus ring.

Properties
ChildOrder

Order elements using a depth- rst pre-order traversal of the element tree.

PositionXY

Order elements according to their position, rst by X, then by Y.

PositionYX

Order elements according to their position, rst by Y, then by X.

Leave feedback

Description
Mouse wheel event.

Properties
delta

The amount of scrolling applied with the mouse wheel.

Constructors
WheelEvent

Constructor. Use GetPooled() to get an event from a pool of reusable events.

Protected Methods
Init

Resets the event members to their initial values.

Static Methods
GetPooled

Gets an event from the event pool and initializes it with the given values. Use this function
instead of creating new events. Events obtained from this method should be released
back to the pool using Dispose().

Inherited Members
Properties
bubbles

Whether this event type bubbles up in the event propagation path.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

dispatch

Whether the event is being dispatched to a visual element. An event
cannot be redispatched while it being dispatched. If you need to
recursively dispatch an event, it is recommended that you use a copy of
the event.

ags

Flags for the event.

imguiEvent

The IMGUIEvent at the source of this event. The source can be null since
not all events are generated by IMGUI.

isDefaultPrevented

Return true if the default actions should not be executed for this event.

isImmediatePropagationStopped

Whether StopImmediatePropagation() was called for this event.

isPropagationStopped

Whether StopPropagation() was called for this event.

originalMousePosition

The original mouse position of the IMGUI event, before it is transformed
to the current target local coordinates.

pooled

Whether the event is allocated from a pool of events.

propagationPhase

The current propagation phase.

target

The target visual element that received this event. Unlike currentTarget,
this target does not change when the event is sent to other elements
along the propagation path.

timestamp

The time when the event was created.

tricklesDown

Whether this event is sent down the event propagation path during the
TrickleDown phase.

actionKey

Returns true if the platform speci c action key is pressed. This key is
Command on macOS and Control otherwise.

altKey

Returns true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is
center.

clickCount

Number of clicks.

commandKey

Returns true if the Windows/Command key is pressed.

ctrlKey

Returns true if the Control key is pressed.

currentTarget

The current target of the event. The current target is the element in the
propagation path for which event handlers are currently being executed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flags holding the pressed modi er keys (Alt, Control, Shift,
Windows/Command).

mouseDelta

The di erence of the mouse position between the previous mouse event
and the current mouse event.

mousePosition

The mouse position in the screen coordinate system.

shiftKey

Returns true if the Shift key is pressed.

Public Methods
Dispose

Implementation of IDisposable.

GetEventTypeId

Retrieves the type id for this event instance.

PreventDefault

Whether the default actions are prevented from being executed for this event.

StopImmediatePropagation

Immediately stops the propagation of the event. The event is not sent to other
elements along the propagation path. This method prevents other event
handlers from executing on the current target.

StopPropagation

Stops propagating this event. The event is not sent to other elements along the
propagation path. This method does not prevent other event handlers from
executing on the current target.

Dispose

Implementation of IDispose.

GetEventTypeId

Retrieves the type id for this event instance.

Static Methods
RegisterEventType

Registers an event class to the event type system.

GetPooled

Gets an event from the event pool. Use this function instead of creating new events.
Events obtained from this method should be released back to the pool using Dispose().

TypeId

Gets the type id for the event class.

Leave feedback

Description
Base interface for ChangeEvent.

Leave feedback

Description
Interface for Command events.

Properties
commandName

Name of the command.

Leave feedback

Description
Interface for drag and drop events.

Leave feedback

Description
Interface for class capable of handling events.

Public Methods
HandleEvent

Handle an event.

HasBubbleUpHandlers

Return true if event handlers for the event propagation BubbleUp phase have
been attached on this object.

HasTrickleDownHandlers

Returns true if event handlers, for the event propagation TrickleDown phase, are
attached to this object.

SendEvent

Sends an event to the event handler.

Leave feedback

Description
Interface for focus events.

Properties
direction

Direction of the focus change.

relatedTarget

Related target. See implementation for speci c meaning.

Leave feedback

Description
Interface for classes implementing focus rings.

Public Methods
GetFocusChangeDirection

Get the direction of the focus change for the given event. For example, when the
Tab key is pressed, focus should be given to the element to the right.

GetNextFocusable

Get the next element in the given direction.

Leave feedback

Description
Interface for keyboard events.

Properties
actionKey

Returns true if the platform speci c action key is pressed. This key is Command on macOS
and Control otherwise.

altKey

Return true if the Alt key is pressed.

character

The character.

commandKey

Return true if the Windows/Command key is pressed.

ctrlKey

Return true if the Control key is pressed.

keyCode

The key code.

modi ers

Flag set holding the pressed modi er keys (Alt, Control, Shift, Windows/Command).

shiftKey

Return true if the Shift key is pressed.

Leave feedback

Description
Interface for mouse capture events.

Leave feedback

Description
Interface for mouse events.

Properties
actionKey

Returns true if the platform speci c action key is pressed. This key is Command on
macOS and Control otherwise.

altKey

Return true if the Alt key is pressed.

button

Integer representing the pressed mouse button: 0 is left, 1 is right, 2 is center.

clickCount

Number of clicks.

commandKey

Return true if the Windows/Command key is pressed.

ctrlKey

Return true if the Control key is pressed.

localMousePosition

The mouse position in the current target coordinate system.

modi ers

Flag set holding the pressed modi er keys (Alt, Control, Shift, Windows/Command).

mouseDelta

Mouse position di erence between the last mouse event and this one.

mousePosition

The mouse position in the panel coordinate system.

shiftKey

Return true if the Shift key is pressed.

Leave feedback

Description
Interface for controls that hold a value and can notify when it is changed by user input.

Properties
value

The Value held by the control.

Public Methods
OnValueChanged

Registers this callback to receive ChangeEvent when value is changed by user
input.

RemoveOnValueChanged

Unregisters this callback from receiving ChangeEvent when value is changed
by user input.

SetValueWithoutNotify

Set the value and, even if di erent, does not notify registers callbacks with a
ChangeEvent

Leave feedback

Description
Interface for classes implementing UI panels.

Properties
focusController

Return the focus controller for this panel.

Leave feedback

Description
A reference to a scheduled action.

Leave feedback

Description
A scheduler allows you to register actions to be executed at a later point.

Public Methods
Schedule

Add this item to the list of scheduled tasks.

ScheduleForDuration

Schedule this action to be executed later. The item will be automatically unscheduled
after it has ran for the amount of time speci ed with the durationMs parameter.

ScheduleOnce

Schedule this action to be executed later. After the execution, the item will be
automatically unscheduled.

ScheduleUntil

Schedule this action to be executed later. Item will be unscheduled when condition is
met.

Unschedule

Manually unschedules a previously scheduled action.

Leave feedback

Description
This interface provides access to a VisualElement style data.
Reading properties from this object will read from the shared copy of style data, if multiple elements match the
same USS rules. When writing to any of the properties the target element will start owning its own style data and
stop using the shared copy. Writing to a property will mask the value coming from USS with the provided value
however other properties will still match the values from USS.

Properties
alignContent

Alignment of the whole area of children on the cross axis if they span over
multiple lines in this container.

alignItems

Alignment of children on the cross axis of this container.

alignSelf

Similar to align-items, but only for this speci c element.

backgroundColor

Background color to paint in the element's box.

backgroundImage

Background image to paint in the element's box.

backgroundScaleMode

Background image scaling in the element's box.

borderBottomLeftRadius

This is the radius of the bottom-left corner when a rounded rectangle is drawn in
the element's box.

borderBottomRightRadius

This is the radius of the bottom-right corner when a rounded rectangle is drawn
in the element's box.

borderBottomWidth

Space reserved for the bottom edge of the border during the layout phase.

borderColor

Color of the border to paint inside the element's box.

borderLeftWidth

Space reserved for the left edge of the border during the layout phase.

borderRadius

This is the radius of every corner when a rounded rectangle is drawn in the
element's box.

borderRightWidth

Space reserved for the right edge of the border during the layout phase.

borderTopLeftRadius

This is the radius of the top-left corner when a rounded rectangle is drawn in the
element's box.

borderTopRightRadius

This is the radius of the top-right corner when a rounded rectangle is drawn in
the element's box.

borderTopWidth

Space reserved for the top edge of the border during the layout phase.

color

Color to use when drawing the text of an element.

cursor

Mouse cursor to display when the mouse pointer is over an element.

ex

Ration of this element in its parent during the layout phase.

exBasis

Initial main size of a ex item, on the main ex axis. The nal layout mught be
smaller or larger, according to the ex shrinking and growing determined by the
ex property.

exDirection

Direction of the main axis to layout children in a container.

exGrow

Speci es how much the item will grow relative to the rest of the exible items
inside the same container.

exShrink

Speci es how the item will shrink relative to the rest of the exible items inside
the same container.

exWrap

Placement of children over multiple lines if not enough space is available in this
container.

font

Font to draw the element's text.

fontSize

Font size to draw the element's text.

fontStyleAndWeight

Font style and weight (normal, bold, italic) to draw the element's text.

height

Fixed height of an element for the layout.

justifyContent

Justi cation of children on the main axis of this container.

marginBottom

Space reserved for the bottom edge of the margin during the layout phase.

marginLeft

Space reserved for the left edge of the margin during the layout phase.

marginRight

Space reserved for the right edge of the margin during the layout phase.

marginTop

Space reserved for the top edge of the margin during the layout phase.

maxHeight

Maximum height for an element, when it is exible or measures its own size.

maxWidth

Maximum width for an element, when it is exible or measures its own size.

minHeight

Minimum height for an element, when it is exible or measures its own size.

minWidth

Minimum height for an element, when it is exible or measures its own size.

paddingBottom

Space reserved for the bottom edge of the padding during the layout phase.

paddingLeft

Space reserved for the left edge of the padding during the layout phase.

paddingRight

Space reserved for the right edge of the padding during the layout phase.

paddingTop

Space reserved for the top edge of the padding during the layout phase.

positionBottom

Bottom distance from the element's box during layout.

positionLeft

Left distance from the element's box during layout.

positionRight

Right distance from the element's box during layout.

positionTop

Top distance from the element's box during layout.

positionType

Element's positioning in its parent container.

sliceBottom

Size of the 9-slice's bottom edge when painting an element's background image.

sliceLeft

Size of the 9-slice's left edge when painting an element's background image.

sliceRight

Size of the 9-slice's right edge when painting an element's background image.

sliceTop

Size of the 9-slice's top edge when painting an element's background image.

textClipping

Clipping if the text does not t in the element's box.

unityTextAlign

Horizontal and vertical text alignment in the element's box.

visibility

Speci es whether or not an element is visible.

width

Fixed width of an element for the layout.

wordWrap

Word wrapping over multiple lines if not enough space is available to draw the
text of an element.

Leave feedback

Description
This interface provides access to a VisualElement transform data.
Reading properties of this object gives information about the tranform of its VisualElement. It is possible to write
the position, scale and rotation of the transform.

Properties
matrix

Transformation matrix calculated from the position, rotation and scale of the transform
(Read Only).

position

The position of the VisualElement's transform.

rotation

The rotation of the VisualElement's transform stored as a Quaternion.

scale

The scale of the VisualElement's transform.

Leave feedback

Description
Interface allowing access to this elements datawatch.

Public Methods
RegisterWatch

Starts watching an object. When watched, all changes on an object will trigger the callback
to be invoked.

UnregisterWatch

Unregisters a previously watched request.

Leave feedback

Description
An internal reference to a data watch request.

Leave feedback

Description
This type allows UXML attribute value retrieval during the VisualElement instantiation. An instance will be
provided to the factory method - see UXMLFactoryAttribute.

Public Methods
TryGetAttributeValue

Get the value of an attribute as a string.

Leave feedback

Description
Interface for UXML factories. While it is not strictly required, concrete factories should derive from the generic
class UxmlFactory.

Properties
canHaveAnyAttribute

Must return true if the UXML element attributes are not restricted to the
values enumerated by uxmlAttributesDescription.

substituteForTypeName

The type of element for which this element type can substitute for.

substituteForTypeNamespace

The UXML namespace for the type returned by substituteForTypeName.

substituteForTypeQuali edName

The fully quali ed XML name for the type returned by
substituteForTypeName.

uxmlAttributesDescription

Describes the UXML attributes expected by the element. The attributes
enumerated here will appear in the UXML schema.

uxmlChildElementsDescription

Describes the types of element that can appear as children of this element
in a UXML le.

uxmlName

The name of the UXML element read by the factory.

uxmlNamespace

The namespace of the UXML element read by the factory.

uxmlQuali edName

The fully quali ed name of the UXML element read by the factory.

Public Methods
AcceptsAttributeBag

Returns true if the factory accepts the content of the attribute bag.

Create

Instanciate and initialize an object of type T0.

Leave feedback

Description
Represents a scheduled task created with a VisualElement's schedule interface.

Properties
element

Returns the VisualElement this object is associated with.

isActive

Will be true when this item is scheduled. Note that an item's callback will only be executed
when it's VisualElement is attached to a panel.

Public Methods
Every

Repeats this action after a speci ed time.

ExecuteLater

Cancels any previously scheduled execution of this item and re-schedules the item.

ForDuration

After speci ed duration, the item will be automatically unscheduled.

Pause

Removes this item from its VisualElement's scheduler.

Resume

If not already active, will schedule this item on its VisualElement's scheduler.

StartingIn

Adds a delay to the rst invokation.

Until

Item will be unscheduled automatically when speci ed condition is met.

Leave feedback

Description
A scheduler allows you to register actions to be executed at a later point.

Public Methods
Execute

Schedule this action to be executed later.

Leave feedback

Description
Enum which describes the various types of changes that can occur on a VisualElement.

Properties
PersistentData

Persistence key or parent has changed on the current VisualElement.

PersistentDataPath

Persistence key or parent has changed on some child of the current VisualElement.

All

All change types have been agged.

Leave feedback

Description
The propagation phases of an event.
When an element receives an event, the event is propagated along a path built from the elements between the
panel root and the target element. In the TrickleDown phase, the event is sent from the root element to the target
parent element. In the AtTarget phase, the event is sent to the target element. In the BubbleUp phase, the event
is sent from the target parent element to the root element. In the last phase, the DefaultAction phase, the event is
resent to the target element.

Properties
None

The event is not being propagated.

TrickleDown

The event is being sent from the root element to the target parent element.

AtTarget

The event is being sent to the event target.

BubbleUp

The event is being sent to the event target parent element up to the root element.

DefaultAction

The event is being sent to the target element for it to execute its default actions for this
event. Event handlers do not get the events in this phase. Instead, ExecuteDefaultAction is
called on the target.

Leave feedback

Description
Controls how many items can be selected at once.

Properties
None

Selections are disabled.

Single

Only one item is selectable.

Multiple

Multiple items are selectable at once.

Leave feedback
Implements interfaces:IPlayable

Description
An implementation of IPlayable that controls playback of a VideoClip.
NOTE: You can use PlayableExtensions methods with VideoClipPlayable objects.

Static Methods
Create

Creates a VideoClipPlayable in the PlayableGraph.

Leave feedback

Description
Extension methods for the VideoPlayer class.

Static Methods
GetAudioSampleProvider

Return the AudioSampleProvider for the speci ed track, used to receive audio
samples during playback.

Leave feedback

Description
The BaseArmModel class is the base class intended for building "Arm Models" for 3 degrees of freedom (3DOF)
controllers. An arm model is intended to approximate a 6 degrees of freedom input device using only the rotation
of the 3DOF controller input. This is typically achieved by simulating the arm's motion using the rotation, and
acceleration information provided by the device.

Properties
headPoseSource

The head pose that will be used as an input to the arm simulation.

poseSource

The poseSource holds the input source to be used for the 3 degrees of freedom controller
data. It is this input that will be translated to a full 6 DOF pose by the Arm Model
implementation.

Protected Methods
TryGetTrackingDataFromSource

This method is used to allow BaseArmModel specializations to retrieve data
from the XRNode system.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
TryGetPoseFromProvider

This method is the interface point between PoseProviders and the
TrackedPoseDriver. Specializing types will implement this method to provide
pose data back to the attached TrackedPoseDriver. When a PoseProvider is
attached to a TrackedPoseDriver, the TrackedPoseDriver will call this interface
each time the TrackedPoseDriver requests a pose.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked

and has completed.
OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
The BasePoseProvider class is a basic implementation of a PoseProvider. A PoseProvider is used to extend the
behavior of the TrackedPoseDriver beyond the devices and endpoints that it can normally track. The PoseProvider
will override the values normally used by the TrackedPoseDriver. One example use for the PoseProvider is to
allow arm models to be attached to the TrackedPoseDriver.

Public Methods
TryGetPoseFromProvider

This method is the interface point between PoseProviders and the
TrackedPoseDriver. Specializing types will implement this method to provide pose
data back to the attached TrackedPoseDriver. When a PoseProvider is attached to
a TrackedPoseDriver, the TrackedPoseDriver will call this interface each time the
TrackedPoseDriver requests a pose.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's

collider (2D physics only).
OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching

the trigger.
OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Structure describing a bounded plane representing a real-world surface.
Unlike a Plane, which is in nite, a BoundedPlane has a size and a more detailed shape. A BoundedPlane can
change from frame to frame (see XRPlaneSubsystem.PlaneUpdated). Typically, this means the current
understanding of the plane has changed, rather than the real-world geometry. This can happen as the device
explores the physical space and is able to perceive more detail.

Properties
Alignment

The alignment of the plane, e.g., horizontal or vertical.

Center

Center point of the plane in device space.

Height

Current height of the plane.

Id

A session-unique identi er for the plane.

Normal

Normal vector of the plane in device space.

Plane

Returns the in nite Plane associated with this BoundedPlane.

Pose

Pose of the plane in device space.

Size

Current size of the plane.

SubsumedById

A session-unique identi er for the BoundedPlane that subsumed this plane.

Width

Current width of the plane.

Public Methods
GetCorners

Outputs four points, in device space, representing the four corners of the plane. The
corners are in clockwise order.

TryGetBoundary

Try to retrieve a list of positions in device space describing current plane boundary.

Leave feedback

Description
Structure containing data passed during Frame Received Event.

Properties
CameraSubsystem

Reference to the XRCameraSubsystem associated with this event.

Leave feedback

Description
Contains data supplied to a XRPlaneSubsystem.PlaneAdded event.
See Also: XRPlaneSubsystem, XRPlaneSubsystem.PlaneAdded

Properties
Plane

The BoundedPlane that was added.

PlaneSubsystem

A reference to the PlaneSubsystem object from which the event originated.

Leave feedback

Description
Contains data supplied to a XRPlaneSubsystem.PlaneRemoved event.
See Also: XRPlaneSubsystem, XRPlaneSubsystem.PlaneRemoved

Properties
Plane

The BoundedPlane that was removed.

PlaneSubsystem

A reference to the XRPlaneSubsystem object from which the event originated.

Leave feedback

Description
Contains data supplied to a XRPlaneSubsystem.PlaneUpdated event.
See Also: XRPlaneSubsystem, XRPlaneSubsystem.PlaneUpdated

Properties
Plane

The BoundedPlane that was updated.

PlaneSubsystem

A reference to the XRPlaneSubsystem object from which the event originated.

Leave feedback

Description
Contains data supplied to a XRDepth.PointCloudUpdated event.
See Also: XRDepth, XRDepth.PointCloudUpdated

Properties
DepthSubsystem

A reference to the XRDepthSubsystem object from which the event originated.

Leave feedback

Description
Describes the transform data of a real-world point.
To track and stabilize around important points in the real world, add a ReferencePoint at the point of interest, and
respond to updates to that ReferencePoint. Each frame, each ReferencePoint may have its position and rotation
updated (see Environment.ReferencePointUpdated) as the device gains a more thorough understanding of where
that point is in Unity space.

Properties
Id

ID for the reference point that is unique across the session.

Pose

The pose (position and rotation) of the reference point. Respond to changes in this pose
to correct for changes in the device's understanding of where this point is in the real
world.

TrackingState

The TrackingState of the reference point.

Leave feedback

Description
Data to be passed to the user when the device corrects its understanding of the world enough that the
ReferencePoint's position or rotation has changed.

Properties
PreviousPose

The previous Pose of the ReferencePoint, prior to this event.

PreviousTrackingState

The previous TrackingState of the ReferencePoint, prior to this event.

ReferencePoint

The reference point that has the value of its position, rotation, or both changed
enough through the device correcting its understanding of where this point should
be located in device space.

Leave feedback

Description
Structure de ning Tracking State Changed event arguments passed when tracking state changes.

Properties
NewState

New Tracking State.

SessionSubsystem

Reference to the XRSessionSubsystem object associated with the event.

Leave feedback

Description
A session-unique identi er for trackables in the environment, e.g., planes and feature points.
Ids are generally unique to a particular XRSessionSubsystem, but multiple sessions may produce identical ids for
di erent trackables.

Static Properties
InvalidId

Represents an invalid id.

Public Methods
ToString

Generates a nicely formatted version of the id.

Leave feedback

Description
Provides access to a device's camera.
The XRCameraSubsystem links a Unity Camera to a device camera for video overlay (pass-thru rendering). It also
allows developers to query for environmental light estimation, when available.

Properties
Camera

Set current Camera component within the app to be used by this
XRCameraInstance.

LastUpdatedFrame

The frame during which the camera subsystem was last successfully updated.

LightEstimationRequested

True if the XRCameraSubsystem should try to provide light estimation.

Material

Set current Material to be used while rendering to the render target.

Public Methods
GetTextures

Fills the provided texturesOut with the texture(s) associated with the
XRCameraSubsystem.

TryGetAverageBrightness

Provides brightness for the whole image as an average of all pixels'
brightness.

TryGetAverageColorTemperature

Provides color temperature for the whole image as an average of all
pixels' color temperature.

TryGetDisplayMatrix

Provides display matrix de ning how texture is being rendered on the
screen.

TryGetProjectionMatrix

Provides projection matrix used by camera subsystem.

TryGetShaderName

Provides shader name used by Camera subsystem to render texture.

TryGetTimestamp

Provides timestamp.

Events
FrameReceived

Event raised when a new camera frame is received.

Inherited Members

Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRCameraSubsystem registration.

Properties
ProvidesAverageBrightness

Speci es if current subsystem is allowed to provide average brightness.

ProvidesAverageColorTemperature

Speci es if current subsystem is allowed to provide average camera
temperature.

ProvidesDisplayMatrix

Speci es if current subsystem is allowed to provide display matrix.

ProvidesProjectionMatrix

Speci es if current subsystem is allowed to provide projection matrix.

ProvidesTimestamp

Speci es if current subsystem is allowed to provide timestamp.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
Provides access to depth data of the physical environment, such as a point cloud.

Properties
LastUpdatedFrame

The frame during which the point cloud was last updated.

Public Methods
GetCon dence

Retrieves the con dence values for each point in the point cloud.

GetPoints

Retrieves the point cloud points.

Events
PointCloudUpdated

Raised once during each frame in which the point cloud is updated.

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRDepthSubsystem registration.

Properties
SupportsFeaturePoints

When true, XRDepthSubsystem will provide list of feature points detected so far.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
XRInputSubsystem Instance is used to enable and disable the inputs coming from a speci c plugin.
Starting up an XRInputSubsystem Instance will cause that plugin to start feeding input device data to the following
InputTracking systems: InputTracking.GetLocalPosition and InputTracking.GetLocalRotation. Calling the Stop or
Shutdown functions will disable polling any input device data for that plugin.

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Information about an Input subsystem.

Properties
disablesLegacyInput

When true, will suppress legacy support for Daydream, Oculus, OpenVR, and Windows
MR built directly into the Unity runtime from generating input. This is useful when
adding an XRInputSubsystem that supports these devices.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
Provides methods, events, and properties that provides information about planes detected in the environment.

Properties
LastUpdatedFrame

The frame during which the planes were last updated.

Public Methods
GetAllPlanes

Get all the BoundedPlanes currently tracked by the system.

TryGetPlane

Get a BoundedPlane by TrackableId

TryGetPlaneBoundary

Try to retrieve a list of positions in device space describing the current plane
boundary.

Events
PlaneAdded

Raised for each BoundedPlane that has been added in the current frame.

PlaneRemoved

Raised for each BoundedPlane that has been removed in the current frame.

PlaneUpdated

Raised for each plane that has been updated in the current frame.

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRPlaneSubsystem registration.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
Structure describing the result of a XRRaycastSubsystem.Raycast hit.
See Also: XRRaycastSubsystem, BoundedPlane, TrackableType, TrackableId

Properties
Distance

The distance, in meters, from the screen to the hit's XRRaycastSubsystemHit.Position.

HitType

The TrackableType(s) that were hit.

Pose

The position and rotation of the hit result in device space where the ray hit the trackable.

TrackableId

The TrackableId of the trackable that was hit by the raycast.

Leave feedback

Description
Provides methods and properties that allow for querying portions of the physical environment that are near a
provided speci ed ray. These trackables include planes and depth data.

Public Methods
Raycast

Casts a ray from a screen point against selected trackables (e.g., planes and feature
points).

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRRaycastSubsystem registration.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
Provides methods and properties that allow for querying, creating, and removing of reference points. These
reference points are cues to the XRSessionSubsystem that indicate areas of interest in the environment which
helps assure that tracking of these points remains accurate.

Properties
LastUpdatedFrame

The frame during which the reference points were last updated.

Public Methods
GetAllReferencePoints

Retrieves all ReferencePoints added by calls to
XRReferencePointSubsystem.TryAddReferencePoint.

TryAddReferencePoint

Attempt to add a ReferencePoint that gets tracked by the device.

TryGetReferencePoint

Attempt to retrieve a ReferencePoint.

TryRemoveReferencePoint

Attempt to remove a ReferencePoint getting tracked by the device.

Events
ReferencePointUpdated

Raised each frame for each ReferencePoint that had the values of its position,
rotation, or both changed enough by the device correcting its understanding of
where the point should be located in Unity space.

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRReferencePointSubsystem registration.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
A collection of methods and properties used to interact with and con gure an XR session.

Properties
LastUpdatedFrame

The frame during which the tracking state was last updated.

TrackingState

Get current tracking status of the device.

Events
TrackingStateChanged

Raised when the TrackingState changes.

Inherited Members
Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Class providing information about XRSessionSubsystem registration.

Inherited Members
Properties
id

A unique string that identi es the subsystem that this Descriptor can create.

Leave feedback

Description
Describes current plane alignment in mixed reality space.

Properties
Horizontal

Plane has horizontal alignment.

Vertical

Plane has vertical alignment.

NonAxis

Plane is not alligned along cardinal (X, Y or Z) axis.

Leave feedback

Description
A trackable is feature in the physical environment that a device is able to track, such as a plane.
TrackableType may be used as a ag and passed to methods like XRRaycastSubsystem.Raycast to specify
di erent types of trackables to raycast against.

Properties
None

No trackable.

PlaneWithinPolygon

The boundary of a BoundedPlane

PlaneWithinBounds

Within the BoundedPlane.Size of a BoundedPlane

PlaneWithinIn nity

The in nite plane of a BoundedPlane

PlaneEstimated

An estimated plane.

Planes

Any of the plane types.

FeaturePoint

A feature point.

All

All trackables (planes and point cloud)

Leave feedback

Description
Current tracking state of the device.
Tracking refers to the ability of the device to know its position and orientation in space. Covering the device's
sensors, for example, may cause it to lose tracking.

Properties
Unknown

Tracking state is unknown.

Tracking

Tracking is currently working.

Unavailable

Tracking is not available.

Leave feedback
Implements interfaces:ISubsystem

Description
A Subsystem is initialized from a SubsystemDescriptor for a given Subsystem (Example, Input, Environment,
Display, etc.) and provides an interface to interact with that given Subsystem until it is Destroyed. After a
Subsystem is created it can be Started or Stopped to turn on and o functionality (and preserve performance).
The base type for Subsystem only exposes this functionality; this class is designed to be a base class for derived
classes that expose more functionality speci c to a given Subsystem.
Note: initializing a second Subsystem from the same SubsystemDescriptor will return a reference to the existing
Subsystem as only one Subsystem is currently allowed for a single Subsystem provider.

Public Methods
Destroy

Destroys this instance of a subsystem.

Start

Starts an instance of a subsystem.

Stop

Stops an instance of a subsystem.

Leave feedback

Description
Gives access to subsystems which provide additional functionality through plugins.
Provides the ability to query for SubsystemDescriptors which enumerate features. Given an SubsystemDescriptor,
you can create an Subsystem to utilize the subsystem.

Static Methods
GetInstances

Returns active Subsystems of a speci c instance type.

GetSubsystemDescriptors

Returns a list of SubsystemDescriptors which describe additional functionality
that can be enabled.

Leave feedback
Obsolete

Description
ADBannerView is a wrapper around the ADBannerView class found in the Apple iAd framework and is only
available on iOS.
It provides a view that displays banner advertisements to the user.
iOS.ADBannerView class is obsolete. Apple iAD service discontinued.

Leave feedback
Obsolete

Description
Speci es how banner should be layed out on screen.
Please note that Traditional Banner and Rect Banner (introduced in ios6) use di erent enum values. If you use
"wrong" enum value for current ad type: for Traditional Banner Top* and Center* will be considered Top, and
Bottom* will be considered Bottom* for Rect Banner Top will be considered TopLeft and Bottom - BottomLeft.

Leave feedback
Obsolete

Description
The type of the banner view.
Please check availability of banner type with ADBannerView.IsAvailable. Traditional banner is always available,
though.

Leave feedback
Obsolete

Description
ADInterstitialAd is a wrapper around the ADInterstitialAd class found in the Apple iAd framework and is only
available on iPad.
It provides full-screen advertisements that your iPad application can display to the user.
Please note that this class is a thin wrapper around the iOS native iAD class, so care should be taken when
creating/destroying instances of it frequently. If you need to show ads frequently, instead of constantly destroying
and recreating the object you should manually call ReloadAd, or create an auto-reloading ADInterstitialAd.
iOS.ADInterstitialAd class is obsolete. Apple iAD service discontinued.

Leave feedback

Description
Interface into iOS speci c functionality.

Static Properties
advertisingIdenti er

Advertising ID.

advertisingTrackingEnabled

Is advertising tracking enabled.

deferSystemGesturesMode

Defer system gestures until the second swipe on speci c edges.

generation

The generation of the device. (Read Only)

hideHomeButton

Speci es whether the home button should be hidden in the iOS build of this
application.

systemVersion

iOS version.

vendorIdenti er

Vendor ID.

Static Methods
RequestStoreReview

Request App Store rating and review from the user.

ResetNoBackupFlag

Reset "no backup" le ag: le will be synced with iCloud/iTunes backup and can be
deleted by OS in low storage situations.

SetNoBackupFlag

Set le ag to be excluded from iCloud/iTunes backup.

Leave feedback

Description
iOS.LocalNoti cation is a wrapper around the UILocalNoti cation class found in the Apple UIKit framework and is
only available on iPhone/iPad/iPod Touch.
It represents noti cations that an application can schedule for presentation to its user at speci c dates and times.
The operating system is responsible for delivering the noti cation at the speci ed time. Local noti cations are
similar to remote noti cations but are scheduled and delivered locally and do not require connection with remote
servers.
Local noti cations are scheduled and handled using Noti cationServices class.

Static Properties
defaultSoundName

The default system sound. (Read Only)

Properties
alertAction

The title of the action button or slider.

alertBody

The message displayed in the noti cation alert.

alertLaunchImage

Identi es the image used as the launch image when the user taps the action
button.

alertTitle

A short description of the reason for the alert.

applicationIconBadgeNumber

The number to display as the application's icon badge.

reDate

The date and time when the system should deliver the noti cation.

hasAction

A boolean value that controls whether the alert action is visible or not.

repeatCalendar

The calendar type (Gregorian, Chinese, etc) to use for rescheduling the
noti cation.

repeatInterval

The calendar interval at which to reschedule the noti cation.

soundName

The name of the sound le to play when an alert is displayed.

timeZone

The time zone of the noti cation's re date.

userInfo

A dictionary for passing custom information to the noti ed application.

Constructors

LocalNoti cation

Creates a new local noti cation.

Leave feedback

Description
Noti cationServices is only available on iPhone/iPad/iPod Touch.
It is used for scheduling, registering and handling noti cations.

Static Properties
deviceToken

Device token received from Apple Push Service after calling
Noti cationServices.RegisterForRemoteNoti cationTypes. (Read Only)

enabledNoti cationTypes

Enabled local and remote noti cation types.

localNoti cationCount

The number of received local noti cations. (Read Only)

localNoti cations

The list of objects representing received local noti cations. (Read Only)

registrationError

Returns an error that might occur on registration for remote noti cations via
Noti cationServices.RegisterForRemoteNoti cationTypes. (Read Only)

remoteNoti cationCount

The number of received remote noti cations. (Read Only)

remoteNoti cations

The list of objects representing received remote noti cations. (Read Only)

scheduledLocalNoti cations

All currently scheduled local noti cations.

Static Methods
CancelAllLocalNoti cations

Cancels the delivery of all scheduled local noti cations.

CancelLocalNoti cation

Cancels the delivery of the speci ed scheduled local noti cation.

ClearLocalNoti cations

Discards of all received local noti cations.

ClearRemoteNoti cations

Discards of all received remote noti cations.

GetLocalNoti cation

Returns an object representing a speci c local noti cation. (Read Only)

GetRemoteNoti cation

Returns an object representing a speci c remote noti cation. (Read Only)

PresentLocalNoti cationNow

Presents a local noti cation immediately.

RegisterForNoti cations

Register to receive local and remote noti cations of the speci ed types
from a provider via Apple Push Service.

ScheduleLocalNoti cation

Schedules a local noti cation.

UnregisterForRemoteNoti cations

Unregister for remote noti cations.

Leave feedback

Description
On Demand Resources API.
See Also: OnDemandResources.PreloadAsync and OnDemandResourcesRequest.

Static Properties
enabled

Indicates whether player was built with "Use On Demand Resources" player setting
enabled.

Static Methods
PreloadAsync

Creates an On Demand Resources (ODR) request.

Leave feedback

Description
Represents a request for On Demand Resources (ODR). It's an AsyncOperation and can be yielded in a coroutine.
NOTE: only available on iOS.
Creating an OnDemandResourcesRequest is equivalent to calling
NSBundleResourceRequest.beginAccessingResourcesWithCompletionHandler . The request will keep the on
demand resource alive until either Dispose() is called or the request object is collected by a garbage collector,
which is the equivalent of calling NSBundleResourceRequest.endAccessingResources .

using
using
using
using

UnityEngine;
UnityEngine.iOS;
System;
System.Collections;

public static class Loader
{
public static IEnumerator LoadAsset(string resourceName)
{
// Create the request
var request = OnDemandResources.PreloadAsync(new string[] { "Asset's ODR

// Wait until request is completed
yield return request;

// Check for errors
if (request.error != null)
throw new Exception("ODR request failed: " + request.error);

// Get path to the resource and use it
var path = request.GetResourcePath(resourceName);
Debug.Log(path);

// Call Dispose() when resource is no longer needed.
request.Dispose();
}
}

Properties
error

Returns an error after operation is complete.

loadingPriority

Sets the priority for request.

Public Methods
Dispose

Release all resources kept alive by On Demand Resources (ODR) request.

GetResourcePath

Gets le system's path to the resource available in On Demand Resources (ODR) request.

Inherited Members
Properties
allowSceneActivation

Allow Scenes to be activated as soon as it is ready.

isDone

Has the operation nished? (Read Only)

priority

Priority lets you tweak in which order async operation calls will be performed.

progress

What's the operation's progress. (Read Only)

Events
completed

Event that is invoked upon operation completion. An event handler that is registered in
the same frame as the call that creates it will be invoked next frame, even if the operation
is able to complete synchronously. If a handler is registered after the operation has
completed and has already invoked the complete event, the handler will be called
synchronously.

Leave feedback

Description
RemoteNoti cation is only available on iPhone/iPad/iPod Touch.
Remote noti cations are sent by an application's remote server (its provider) to Apple Push Noti cation service
which pushes the noti cation to devices on which the application is installed.
Remote noti cations are registered for and handled using Noti cationServices class.

Properties
alertBody

The message displayed in the noti cation alert. (Read Only)

alertTitle

A short description of the reason for the alert. (Read Only)

applicationIconBadgeNumber

The number to display as the application's icon badge. (Read Only)

hasAction

A boolean value that controls whether the alert action is visible or not. (Read
Only)

soundName

The name of the sound le to play when an alert is displayed. (Read Only)

userInfo

A dictionary for passing custom information to the noti ed application. (Read
Only)

Leave feedback

Description
ActivityIndicator Style (iOS Speci c).

Properties
DontShow

Do not show ActivityIndicator.

WhiteLarge

The large white style of indicator (UIActivityIndicatorViewStyleWhiteLarge).

White

The standard white style of indicator (UIActivityIndicatorViewStyleWhite).

Gray

The standard gray style of indicator (UIActivityIndicatorViewStyleGray).

Leave feedback

Description
Specify calendar types.

Properties
GregorianCalendar

Identi es the Gregorian calendar.

BuddhistCalendar

Identi es the Buddhist calendar.

ChineseCalendar

Identi es the Chinese calendar.

HebrewCalendar

Identi es the Hebrew calendar.

IslamicCalendar

Identi es the Islamic calendar.

IslamicCivilCalendar

Identi es the Islamic civil calendar.

JapaneseCalendar

Identi es the Japanese calendar.

RepublicOfChinaCalendar

Identi es the Republic of China (Taiwan) calendar.

PersianCalendar

Identi es the Persian calendar.

IndianCalendar

Identi es the Indian calendar.

ISO8601Calendar

Identi es the ISO8601.

Leave feedback

Description
Specify calendrical units.

Properties
Era

Speci es the era unit.

Year

Speci es the year unit.

Month

Speci es the month unit.

Day

Speci es the day unit.

Hour

Speci es the hour unit.

Minute

Speci es the minute unit.

Second

Speci es the second unit.

Week

Speci es the week unit.

Weekday

Speci es the weekday unit.

WeekdayOrdinal

Speci es the ordinal weekday unit.

Quarter

Speci es the quarter of the calendar.

Leave feedback

Description
iOS device generation.

Properties
iPhone

iPhone, rst generation.

iPhone3G

iPhone, second generation.

iPhone3GS

iPhone, third generation.

iPodTouch1Gen

iPod Touch, rst generation.

iPodTouch2Gen

iPod Touch, second generation.

iPodTouch3Gen

iPod Touch, third generation.

iPad1Gen

iPad, rst generation.

iPhone4

iPhone, fourth generation.

iPodTouch4Gen

iPod Touch, fourth generation.

iPad2Gen

iPad, second generation.

iPhone4S

iPhone, fth generation.

iPad3Gen

iPad, third generation.

iPhone5

iPhone5.

iPodTouch5Gen

iPod Touch, fth generation.

iPadMini1Gen

iPadMini, rst generation.

iPad4Gen

iPad, fourth generation.

iPhone5C

iPhone 5C.

iPhone5S

iPhone 5S.

iPadAir1

iPad Air.

iPadMini2Gen

iPadMini Retina, second generation.

iPhone6

iPhone 6.

iPhone6Plus

iPhone 6 plus.

iPadMini3Gen

iPad Mini 3.

iPadAir2

iPad Air 2.

iPhone6S

iPhone 6S.

iPhone6SPlus

iPhone 6S Plus.

iPadPro1Gen

iPad Pro 12.9", rst generation.

iPadMini4Gen

iPad Mini, fourth generation.

iPhoneSE1Gen

iPhone SE, rst generation.

iPadPro10Inch1Gen

iPad Pro 9.7", rst generation.

iPhone7

iPhone 7.

iPhone7Plus

iPhone 7 Plus.

iPodTouch6Gen

iPod Touch, sixth generation.

iPad5Gen

iPad Air, fth generation.

iPadPro2Gen

iPad Pro 12.9", second generation.

iPadPro10Inch2Gen

iPad Pro 10.5", second generation 10" iPad.

iPhone8

iPhone 8.

iPhone8Plus

iPhone 8 Plus.

iPhoneX

iPhone X.

iPhoneXS

iPhone XS.

iPhoneXSMax

iPhone XSMax.

iPhoneXR

iPhone XR.

iPhoneUnknown

Yet unknown iPhone.

iPadUnknown

Yet unknown iPad.

iPodTouchUnknown

Yet unknown iPod Touch.

Leave feedback

Description
Speci es local and remote noti cation types.

Properties
None

No noti cation types speci ed.

Badge

Noti cation is a badge shown above the application's icon.

Sound

Noti cation is an alert sound.

Alert

Noti cation is an alert message.

Leave feedback

Description
Bit-mask used to control the deferring of system gestures on iOS.
On iPhone X the home button is implemented as a system gesture (swipe up from the lower edge of the screen).
Other gestures are implemented as swipes from other screen edges. Note, this may interfere with games that use
swipes as an interaction method. This bit-mask speci es which screen edge gestures the system defers to the
second swipe. If deferring is enabled on a speci c screen edge, the rst swipe is ignored and provides a way to
reduce unwanted interactions with the App. Note that iOS Human interface guidelines do not recommend
enabling this behavior as it may confuse users.

Properties
None

Disables gesture deferring on all edges.

TopEdge

Identi es top screen edge.

LeftEdge

Identi es left screen edge.

BottomEdge

Identi es bottom screen edge.

RightEdge

Identi es right screen edge.

All

Identi es all screen edges.

Leave feedback

Description
Extension methods for IJobParallelForTransform.

Static Methods
Schedule

Schedule.

Leave feedback

Description
Position, rotation and scale of an object.

Properties
localPosition

The position of the transform relative to the parent.

localRotation

The rotation of the transform relative to the parent transform's rotation.

localScale

The scale of the transform relative to the parent.

position

The position of the transform in world space.

rotation

The rotation of the transform in world space stored as a Quaternion.

Leave feedback

Description
TransformAccessArray.

Properties
capacity

Returns array capacity.

isCreated

isCreated.

length

Length.

this[int]

Array indexer.

Constructors
TransformAccessArray

Constructor.

Public Methods
Add

Add.

Dispose

Dispose.

RemoveAtSwapBack

Remove item at index.

SetTransforms

Set transforms.

Static Methods
Allocate

Allocate.

Leave feedback

Description
IJobParallelForTransform.

Public Methods
Execute

Execute.

Leave feedback
Obsolete

Description
Details about a UNET MatchMaker match.
This is a data object that represents the data returned from NetworkMatch.CreateMatch and
NetworkMatch.JoinMatch.

Leave feedback
Obsolete

Description
A class describing the match information as a snapshot at the time the request was processed on the
MatchMaker.
The information in this class is part of the data list returned when listing open matches through MatchMaker. It
describes the instantaneous state at the time the request was handled.

Leave feedback
Obsolete

Description
A class describing one member of a match and what direct connect information other clients have supplied.
A "MatchInfoDirectConnectSnapshot" instance contains mostly optional data which a connection can supply when
it creates or joins a match. That info is then returned in these results so that other clients can directly connect to
that client instead of going through the internet via a relay server.

Leave feedback
Obsolete

Description
A component for communicating with the Unity Multiplayer Matchmaking service.
This class aggregates all the supported JSON calls into functions that are callable for games that wish to interact
with the MatchMaker service.
The example code below shows how to use NetworkMatch API.

using
using
using
using

UnityEngine;
UnityEngine.Networking;
UnityEngine.Networking.Match;
System.Collections.Generic;

public class SimpleMatchMaker : MonoBehaviour
{
void Start()
{
NetworkManager.singleton.StartMatchMaker();
}

//call this method to request a match to be created on the server
public void CreateInternetMatch(string matchName)
{
NetworkManager.singleton.matchMaker.CreateMatch(matchName, 4, true, "",
}

//this method is called when your request for creating a match is returned
private void OnInternetMatchCreate(bool success, string extendedInfo, MatchI
{
if (success)
{
//Debug.Log("Create match succeeded");

MatchInfo hostInfo = matchInfo;
NetworkServer.Listen(hostInfo, 9000);

NetworkManager.singleton.StartHost(hostInfo);
}
else
{
Debug.LogError("Create match failed");
}
}

//call this method to find a match through the matchmaker
public void FindInternetMatch(string matchName)
{
NetworkManager.singleton.matchMaker.ListMatches(0, 10, matchName, true,
}

//this method is called when a list of matches is returned
private void OnInternetMatchList(bool success, string extendedInfo, List
{
}

public SyncListPOW m_pows = new SyncListPOW();
}

Make sure your struct members are non-static public members.
We allow the following types to be used in your struct;
• Basic type (byte, int, oat, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Arrays of basic types
• Other structs containing allowable types
• NetworkIdentity
• NetworkInstanceId
• NetworkHash128
• GameObject with a NetworkIdentity component attached.
Serialization methods will be auto-generated for this new class.

Inherited Members
Public Methods
HandleMsg

Internal function used for remote list operations.

Leave feedback
Obsolete

Description
A list of unsigned integers that will be synchronized from server to clients.

Inherited Members
Public Methods
HandleMsg

Internal function used for remote list operations.

Leave feedback

Description
The UnityWebRequest object is used to communicate with web servers.
UnityWebRequests handle the ow of HTTP communication with web servers. Other objects - speci cally
DownloadHandler and UploadHandler - govern downloading and uploading data, respectively.
A set of static functions are provided for convenience; these return UnityWebRequest objects properly con gured
for many common use cases. See: Get, Post, Put, GetTexture.
Note: Most properties on the UnityWebRequest object cannot be altered once the UnityWebRequest has begun
communicating with a remote server by calling the Send method.

Static Properties
kHttpVerbCREATE

The string "CREATE", commonly used as the verb for an HTTP CREATE request.

kHttpVerbDELETE

The string "DELETE", commonly used as the verb for an HTTP DELETE request.

kHttpVerbGET

The string "GET", commonly used as the verb for an HTTP GET request.

kHttpVerbHEAD

The string "HEAD", commonly used as the verb for an HTTP HEAD request.

kHttpVerbPOST

The string "POST", commonly used as the verb for an HTTP POST request.

kHttpVerbPUT

The string "PUT", commonly used as the verb for an HTTP PUT request.

Properties
certi cateHandler

Holds a reference to a Certi cateHandler object, which manages
certi cate validation for this UnityWebRequest.

chunkedTransfer

Indicates whether the UnityWebRequest system should employ the
HTTP/1.1 chunked-transfer encoding method.

disposeCerti cateHandlerOnDispose

If true, any Certi cateHandler attached to this UnityWebRequest will
have Certi cateHandler.Dispose called automatically when
UnityWebRequest.Dispose is called.

disposeDownloadHandlerOnDispose

If true, any DownloadHandler attached to this UnityWebRequest will
have DownloadHandler.Dispose called automatically when
UnityWebRequest.Dispose is called.

disposeUploadHandlerOnDispose

If true, any UploadHandler attached to this UnityWebRequest will have
UploadHandler.Dispose called automatically when
UnityWebRequest.Dispose is called.

downloadedBytes

Returns the number of bytes of body data the system has downloaded
from the remote server. (Read Only)

downloadHandler

Holds a reference to a DownloadHandler object, which manages body
data received from the remote server by this UnityWebRequest.

downloadProgress

Returns a oating-point value between 0.0 and 1.0, indicating the
progress of downloading body data from the server. (Read Only)

error

A human-readable string describing any system errors encountered by
this UnityWebRequest object while handling HTTP requests or
responses. (Read Only)

isDone

Returns true after the UnityWebRequest has nished communicating
with the remote server. (Read Only)

isHttpError

Returns true after this UnityWebRequest receives an HTTP response
code indicating an error. (Read Only)

isModi able

Returns true while a UnityWebRequest’s con guration properties can
be altered. (Read Only)

isNetworkError

Returns true after this UnityWebRequest encounters a system error.
(Read Only)

method

De nes the HTTP verb used by this UnityWebRequest, such as GET or
POST.

redirectLimit

Indicates the number of redirects which this UnityWebRequest will
follow before halting with a “Redirect Limit Exceeded” system error.

responseCode

The numeric HTTP response code returned by the server, such as 200,
404 or 500. (Read Only)

timeout

Sets UnityWebRequest to attempt to abort after the number of
seconds in timeout have passed.

uploadedBytes

Returns the number of bytes of body data the system has uploaded to
the remote server. (Read Only)

uploadHandler

Holds a reference to the UploadHandler object which manages body
data to be uploaded to the remote server.

uploadProgress

Returns a oating-point value between 0.0 and 1.0, indicating the
progress of uploading body data to the server.

uri

De nes the target URI for the UnityWebRequest to communicate with.

url

De nes the target URL for the UnityWebRequest to communicate with.

useHttpContinue

Determines whether this UnityWebRequest will include Expect: 100Continue in its outgoing request headers. (Default: true).

Constructors
UnityWebRequest

Creates a UnityWebRequest with the default options and no attached DownloadHandler
or UploadHandler. Default method is GET.

Public Methods
Abort

If in progress, halts the UnityWebRequest as soon as possible.

Dispose

Signals that this UnityWebRequest is no longer being used, and should clean up any
resources it is using.

GetRequestHeader

Retrieves the value of a custom request header.

GetResponseHeader

Retrieves the value of a response header from the latest HTTP response received.

GetResponseHeaders

Retrieves a dictionary containing all the response headers received by this
UnityWebRequest in the latest HTTP response.

SendWebRequest

Begin communicating with the remote server.

SetRequestHeader

Set a HTTP request header to a custom value.

Static Methods
ClearCookieCache

Clears stored cookies from the cache.

Delete

Creates a UnityWebRequest con gured for HTTP DELETE.

EscapeURL

Escapes characters in a string to ensure they are URL-friendly.

GenerateBoundary

Generate a random 40-byte array for use as a multipart form boundary.

Get

Creates a UnityWebRequest con gured for HTTP GET.

Head

Creates a UnityWebRequest con gured to send a HTTP HEAD request.

Post

Creates a UnityWebRequest con gured to send form data to a server via HTTP POST.

Put

Creates a UnityWebRequest con gured to upload raw data to a remote server via
HTTP PUT.

SerializeFormSections

Converts a List of IMultipartFormSection objects into a byte array containing raw
multipart form data.

SerializeSimpleForm

Serialize a dictionary of strings into a byte array containing URL-encoded UTF8
characters.

UnEscapeURL

Converts URL-friendly escape sequences back to normal text.

Leave feedback

Description
Helpers for downloading asset bundles using UnityWebRequest.

Static Methods
GetAssetBundle

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP
GET.

Leave feedback

Description
Asynchronous operation object returned from UnityWebRequest.SendWebRequest().
You can yield until it continues, register an event handler with AsyncOperation.completed, or manually check
whether it's done (AsyncOperation.isDone) or progress (AsyncOperation.progress).

Properties
webRequest

Returns the associated UnityWebRequest that created the operation.

Inherited Members
Properties
allowSceneActivation

Allow Scenes to be activated as soon as it is ready.

isDone

Has the operation nished? (Read Only)

priority

Priority lets you tweak in which order async operation calls will be performed.

progress

What's the operation's progress. (Read Only)

Events
completed

Event that is invoked upon operation completion. An event handler that is registered in
the same frame as the call that creates it will be invoked next frame, even if the operation
is able to complete synchronously. If a handler is registered after the operation has
completed and has already invoked the complete event, the handler will be called
synchronously.

Leave feedback

Description
Helpers for downloading multimedia les using UnityWebRequest.

Static Methods
GetAudioClip

Create a UnityWebRequest to download an audio clip via HTTP GET and create an
AudioClip based on the retrieved data.

Leave feedback

Description
Helpers for downloading image les into Textures using UnityWebRequest.

Static Methods
GetTexture

Create a UnityWebRequest intended to download an image via HTTP GET and create a
Texture based on the retrieved data.

Leave feedback

Description
Helper object for UnityWebRequests. Manages the bu ering and transmission of body data during HTTP
requests.
When attached to a UnityWebRequest, an UploadHandler object handles all information regarding the bu ering
and transmission of body data during an HTTP request. By placing data in an UploadHandler and attaching it to a
UnityWebRequest, the UnityWebRequest is implicitly instructed to transmit the UploadHandler's data to the
remote server. The data will always be delivered as HTTP request body data.
UploadHandler is a base class and cannot be directly instantiated. Currently, only one type of UploadHandler is
available: UploadHandlerRaw.
See Also: UnityWebRequest, UploadHandlerRaw.

Properties
contentType

Determines the default Content-Type header which will be transmitted with the outbound
HTTP request.

data

The raw data which will be transmitted to the remote server as body data. (Read Only)

progress

Returns the proportion of data uploaded to the remote server compared to the total
amount of data to upload. (Read Only)

Public Methods
Dispose

Signals that this UploadHandler is no longer being used, and should clean up any
resources it is using.

Leave feedback

Description
A specialized UploadHandler that reads data from a given le and sends raw bytes to the server as the request
body.
You can use it to send a large amount of data to the server with a low memory footprint.

using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class UHFileSample : MonoBehaviour
{
void Start()
{
StartCoroutine(UploadFileData());
}

IEnumerator UploadFileData()
{
using (var uwr = new UnityWebRequest("http://yourwebsite.com/upload", Un
{
uwr.uploadHandler = new UploadHandlerFile("/path/to/file");
yield return uwr.SendWebRequest();
if (uwr.isNetworkError || uwr.isHttpError)
Debug.LogError(uwr.error);
else
{
// file data successfully sent
}
}
}
}

Constructors
UploadHandlerFile

Create a new upload handler to send data from the given le to the server.

Inherited Members

Properties
contentType

Determines the default Content-Type header which will be transmitted with the outbound
HTTP request.

data

The raw data which will be transmitted to the remote server as body data. (Read Only)

progress

Returns the proportion of data uploaded to the remote server compared to the total
amount of data to upload. (Read Only)

Public Methods
Dispose

Signals that this UploadHandler is no longer being used, and should clean up any
resources it is using.

Leave feedback

Description
A general-purpose UploadHandler subclass, using a native-code memory bu er.
This subclass copies input data into a native-code memory bu er at construction time, and transmits that data
verbatim as HTTP request body data.

Constructors
UploadHandlerRaw

General constructor. Contents of the input argument are copied into a native bu er.

Inherited Members
Properties
contentType

Determines the default Content-Type header which will be transmitted with the outbound
HTTP request.

data

The raw data which will be transmitted to the remote server as body data. (Read Only)

progress

Returns the proportion of data uploaded to the remote server compared to the total
amount of data to upload. (Read Only)

Public Methods
Dispose

Signals that this UploadHandler is no longer being used, and should clean up any
resources it is using.

Leave feedback

Description
Networking Utility.

Static Methods
GetAccessTokenForNetwork

Utility function to get this client's access token for a particular network, if it has
been set.

GetSourceID

Utility function to get the client's SourceID for unique identi cation.

SetAccessTokenForNetwork

Utility function that accepts the access token for a network after it's received
from the server.

Leave feedback

Description
An interface for composition of data into multipart forms.
In order to provide a ner level of control for those wishing to generate multipart form data, but without forcing
most users to refer to RFC 2388, Unity provides this simple interface which the UnityWebRequest API can use to
serialize complex data into properly-formatted bytes.
For convenience, the two general types of form sections have been encapsulated into two stock implementations
of IMultipartFormSection. Both stock implementations are simply controlled via their constructors.
IMultipartFormSection implementors are converted into bytes via [UnityWebRequest.SerializeFormSections].
See Also: [MultipartFormDataSection], [MultipartFormFileSection].

Properties
contentType
leName

Returns the value to use in the Content-Type header for this form section.
Returns a string denoting the desired lename of this section on the destination server.

sectionData

Returns the raw binary data contained in this section. Must not return null or a zerolength array.

sectionName

Returns the name of this section, if any.

Leave feedback

Description
An enumeration of the options that can be set on a network channel.

Properties
MaxPendingBu ers

The option to set the number of pending bu ers for a channel.

AllowFragmentation

The option to allow packet fragmentation for a channel.

MaxPacketSize

The option to set the maximum packet size allowed for a channel.

Leave feedback

Description
De nes size of the bu er holding reliable messages, before they will be acknowledged.

Properties
Acks32

Ack bu er can hold 32 messages.

Acks64

Ack bu er can hold 64 messages.

Acks96

Ack bu er can hold 96 messages.

Acks128

Ack bu er can hold 128 messages.

Leave feedback

Description
Possible Networking.NetworkTransport errors.
A group of possible NetworkTransport errors. If an error is returned from a NetworkTransport function, you can
use NetworkError to nd out what type of error occured. Make sure to use NetworkTransport.Receive or similar
to listen for these type of events.

//Create a Button (Create
Create>UI
UI>Button
Button) for the host.

//Attach this Button in the Inspector of your GameObject.

//In Play Mode, click the Button to connect. If the connection works, the detail

using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

public class Example : MonoBehaviour
{
int m_ServerSocket;

HostTopology m_HostTopology;

//These are the Buttons that start the client and server, and the Button for
//Assure that you assign these in the Inspector before testing
public Button m_ServerButton;

void Start()
{
//Set up the Connection Configuration which holds channel information
ConnectionConfig config = new ConnectionConfig();

//Create a new Host information based on the configuration created, and
m_HostTopology = new HostTopology(config, 20);

//Initialise the NetworkTransport
NetworkTransport.Init();

//Call the ServerButton function when you click the server Button
m_ServerButton.onClick.AddListener(ServerButton);
}

void Update()
{
//These are the variables that are replaced by the incoming message
int outHostId;
int outConnectionId;
int outChannelId;
byte[] buffer = new byte[1024];
int receivedSize;
byte error;

//Set up the Network Transport to receive the incoming message, and deci
NetworkEventType eventType = NetworkTransport.Receive(out outHostId, out

switch (eventType)
{
//Use this case when there is a connection detected
case NetworkEventType.ConnectEvent:
{
//Call the function to deal with the received information
OnConnect(outHostId, outConnectionId, (NetworkError)error);
break;
}

case NetworkEventType.Nothing:
break;

default:
//Output the error
Debug.LogError("Unknown network message type received: " + event
break;
}
}

//This function is called when a connection is detected
void OnConnect(int hostID, int connectionID, NetworkError error)
{
//Output the given information to the console
Debug.Log("OnConnect(hostId = " + hostID + ", connectionId = "
+ connectionID + ", error = " + error.ToString() + ")");
}

void ServerButton()
{
byte error;
//Open the sockets for sending and receiving the messages on port 54321
m_ServerSocket = NetworkTransport.AddHost(m_HostTopology, 54321);
//Connect the "server"
NetworkTransport.Connect(m_ServerSocket, "127.0.0.1", 54321, 0, out erro
//Check for if there is an error
if ((NetworkError)error != NetworkError.Ok)
{
//Output this message in the console with the Network Error
Debug.Log("There was this error : " + (NetworkError)error);
}
//Otherwise if no errors occur, output this message to the console
else Debug.Log("Connected : " + (NetworkError)error);
}
}

Properties
Ok

The operation completed successfully.

WrongHost

The speci ed host not available.

WrongConnection

The speci ed connectionId doesn't exist.

WrongChannel

The speci ed channel doesn't exist.

NoResources

Not enough resources are available to process this request.

BadMessage

Not a data message.

Timeout

Connection timed out.

MessageToLong

The message is too long to t the bu er.

WrongOperation

Operation is not supported.

VersionMismatch

The protocol versions are not compatible. Check your library versions.

CRCMismatch

The Networking.ConnectionCon g does not match the other endpoint.

DNSFailure

The address supplied to connect to was invalid or could not be resolved.

UsageError

This error will occur if any function is called with inappropriate parameter values.

Leave feedback

Description
Event that is returned when calling the Networking.NetworkTransport.Receive and
Networking.NetworkTransport.ReceiveFromHost functions.

Properties
DataEvent

Data event received. Indicating that data was received.

ConnectEvent

Connection event received. Indicating that a new connection was established.

DisconnectEvent

Disconnection event received.

Nothing

No new event was received.

BroadcastEvent

Broadcast discovery event received. To obtain sender connection info and possible
complimentary message from them, call
Networking.NetworkTransport.GetBroadcastConnectionInfo() and
Networking.NetworkTransport.GetBroadcastConnectionMessage() functions.

Leave feedback

Description
Enumeration of methods of where to spawn player objects in multiplayer games.

using UnityEngine;
using UnityEngine.Networking;

public class PlayerSpawnMethodExample : MonoBehaviour
{
void Update()
{
//Press the space key to switch to spawning on a random spawn point
if (Input.GetKeyDown(KeyCode.Space))
{
//Check that the PlayerSpawnMethod is currently RoundRobin
if (NetworkManager.singleton.playerSpawnMethod == PlayerSpawnMethod.
//Switch it to Random spawning if it is
NetworkManager.singleton.playerSpawnMethod = PlayerSpawnMethod.R
//Otherwise switch it to RoundRobin
else NetworkManager.singleton.playerSpawnMethod = PlayerSpawnMethod.
}
}
}

Properties
Random

Spawn players at a randomly chosen starting position.

RoundRobin

Spawn players at the next start position.

Leave feedback

Description
Enumeration of all supported quality of service channel modes.

Properties
Unreliable

There is no guarantee of delivery or ordering.

UnreliableFragmented

There is no guarantee of delivery or ordering, but allowing fragmented
messages with up to 32 fragments per message.

UnreliableSequenced

There is no guarantee of delivery and all unordered messages will be
dropped. Example: VoIP.

Reliable

Each message is guaranteed to be delivered but not guaranteed to be in
order.

ReliableFragmented

Each message is guaranteed to be delivered, also allowing fragmented
messages with up to 32 fragments per message.

ReliableSequenced

Each message is guaranteed to be delivered and in order.

StateUpdate

An unreliable message. Only the last message in the send bu er is sent.
Only the most recent message in the receive bu er will be delivered.

ReliableStateUpdate

A reliable message. Note: Only the last message in the send bu er is sent.
Only the most recent message in the receive bu er will be delivered.

AllCostDelivery

A reliable message that will be re-sent with a high frequency until it is
acknowledged.

UnreliableFragmentedSequenced

There is garantee of ordering, no guarantee of delivery, but allowing
fragmented messages with up to 32 fragments per message.

ReliableFragmentedSequenced

Each message is guaranteed to be delivered in order, also allowing
fragmented messages with up to 32 fragments per message.

Leave feedback

Description
De ne how unet will handle network io operation.

Properties
SelectReactor

Network thread will sleep up to threadawake timeout, or up to receive event on socket
will happened. Awaked thread will try to read up to maxpoolsize packets from socket and
will try update connections ready to send (with xing awaketimeout rate).

FixRateReactor

Network thread will sleep up to threadawake timeout, after that it will try receive up to
maxpoolsize amount of messages and then will try perform send operation for
connection whihc ready to send.

Leave feedback

Description
Enumeration of Networking versions.

Properties
Current

The current UNET version.

Leave feedback
Obsolete

Description
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run
on clients.
A [Client] method returns immediately if NetworkClient.active is not true, and generates a warning on the
console. This attribute can be put on member functions that are meant to be only called on clients. This would
redundant for [ClientRPC] functions, as being client-only is already enforced for them.

using UnityEngine;
using UnityEngine.Networking;

public class Example : MonoBehaviour
{
[Client]
public void OnClientDisconnected(NetworkConnection conn, NetworkReader reade
{
Debug.Log("Client Disconnected");
//ShutdownGame();
Application.LoadLevel("title");
}
}

Leave feedback
Obsolete

Description
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run
on clients, but not generate warnings.
This custom attribute is the same as the Client custom attribute, except that it does not generate a warning in the
console if called on a server. This is useful to avoid spamming the console for functions that will be invoked by the
engine, such as Update() or physics callbacks.

using UnityEngine;
using UnityEngine.Networking;

public class Example : MonoBehaviour
{
[ClientCallback]
void OnTriggerEnter2D(Collider2D collider)
{
// make explosion
}
}

This will make the explosion code only run when the trigger is hit on the client.

Leave feedback
Obsolete

Description
This is an attribute that can be put on methods of NetworkBehaviour classes to allow them to be invoked on
clients from a server.
[ClientRPC] functions are called by code on Unity Multiplayer servers, and then invoked on corresponding
GameObjects on clients connected to the server. The arguments to the RPC call are serialized across the network,
so that the client function is invoked with the same values as the function on the server. These functions must
begin with the pre x "Rpc" and cannot be static.

using UnityEngine;
using UnityEngine.Networking;

public class Example : NetworkBehaviour
{
int counter;
[ClientRpc]
public void RpcDoMagic(int extra)
{
Debug.Log("Magic = " + (123 + extra));
}

void Update()
{
counter += 1;

if (counter % 100 == 0 && NetworkServer.active)
{
RpcDoMagic(counter);
}
}
}

The allowed argument types are;
• Basic type (byte, int, oat, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Arrays of basic types

• Structs containing allowable types
• NetworkIdentity
• NetworkInstanceId
• NetworkHash128
• GameObject with a NetworkIdentity component attached.

Leave feedback
Obsolete

Description
This is an attribute that can be put on methods of NetworkBehaviour classes to allow them to be invoked on the
server by sending a command from a client.
[Command] functions are invoked on the player GameObject associated with a connection. This is set up in
response to the "ready" message, by passing the player GameObject to the NetworkServer.PlayerIsReady()
function. The arguments to the command call are serialized across the network, so that the server function is
invoked with the same values as the function on the client. These functions must begin with the pre x "Cmd" and
cannot be static.

using UnityEngine;
using UnityEngine.Networking;

public class Player : NetworkBehaviour
{
int moveX = 0;
int moveY = 0;
float moveSpeed = 0.2f;
bool isDirty = false;

void Update()
{
if (!isLocalPlayer)
{
return;
}

// input handling for local player only
int oldMoveX = moveX;
int oldMoveY = moveY;

moveX = 0;
moveY = 0;

if (Input.GetKey(KeyCode.LeftArrow))

{
moveX -= 1;
}
if (Input.GetKey(KeyCode.RightArrow))
{
moveX += 1;
}
if (Input.GetKey(KeyCode.UpArrow))
{
moveY += 1;
}
if (Input.GetKey(KeyCode.DownArrow))
{
moveY -= 1;
}
if (moveX != oldMoveX || moveY != oldMoveY)
{
CmdMove(moveX, moveY);
}
}

[Command]
public void
{
moveX =
moveY =
isDirty
}

CmdMove(int x, int y)
x;
y;
= true;

public void FixedUpdate()
{
if (NetworkServer.active)
{
transform.Translate(moveX * moveSpeed, moveY * moveSpeed, 0);
}
}
}

The allowed argument types are;
• Basic type (byte, int, oat, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Arrays of basic types

• Structs containing allowable types
• NetworkIdentity
• NetworkInstanceId
• NetworkHash128
• GameObject with a NetworkIdentity component attached.

Leave feedback
Obsolete

Description
This attribute is used to con gure the network settings of scripts that are derived from the NetworkBehaviour
base class.

using UnityEngine.Networking;

[NetworkSettings(channel = 1, sendInterval = 0.2f)]
class MyScript : NetworkBehaviour
{
[SyncVar]
int value;
}

Leave feedback
Obsolete

Description
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run
on servers.
A [Server] method returns immediately if NetworkServer.active is not true, and generates a warning on the
console. This attribute can be put on member functions that are meant to be only called on server. This would be
redundant for Command functions, as being server-only is already enforced for them.

using UnityEngine;
using UnityEngine.Networking;

public class Example : NetworkBehaviour
{
[Server]
public void Explode()
{
NetworkServer.Destroy(gameObject);
}
}

Leave feedback
Obsolete

Description
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run
on servers, but not generate warnings.
This custom attribute is the same as the [Server] custom attribute, except that it does not generate a warning in
the console if called on a client. This is useful to avoid spamming the console for functions that will be invoked by
the engine, such as Update() or physics callbacks.

using UnityEngine;
using UnityEngine.Networking;

public class Example : MonoBehaviour
{
float regenTimer = 0;
int heat = 100;

[ServerCallback]
void Update()
{
// heat dissipates over time
if (Time.time > regenTimer)
{
if (heat > 1)
heat -= 2;

regenTimer = Time.time + 1.0f;
}
}
}

Leave feedback
Obsolete

Description
This is an attribute that can be put on events in NetworkBehaviour classes to allow them to be invoked on client
when the event is called on the server.
[SyncEvent] events are called by user code on UNET servers, and then invoked on corresponding client objects on
clients connected to the server. The arguments to the Event call are serialized across the network, so that the
client event is invoked with the same values as the function on the server. These events must begin with the
pre x "Event".

using UnityEngine;
using UnityEngine.Networking;

public class DamageClass : NetworkBehaviour
{
public delegate void TakeDamageDelegate(int amount, float dir);

[SyncEvent]
public event TakeDamageDelegate EventTakeDamage;

[Command]
public void CmdDoMe(int val)
{
EventTakeDamage(val, 1.0f);
}
}

public class Other : NetworkBehaviour
{
public DamageClass damager;
int health = 100;

void Start()
{
if (NetworkClient.active)
damager.EventTakeDamage += TakeDamage;
}

public void TakeDamage(int amount, float dir)
{
health -= amount;
}
}

SyncEvents allow networked actions to be propagated to other scripts attached to the object. In the example
above, the Other class registers for the TakeDamage event on the DamageClass. When the event happens on the
DamageClass on the server, the TakeDamage() method will be invoked on the Other class on the client object.
This allows modular network aware systems to be created, that can be extended by new scripts that respond to
the events generated by them.

Leave feedback
Obsolete

Description
[SyncVar] is an attribute that can be put on member variables of NetworkBehaviour classes. These variables will
have their values sychronized from the server to clients in the game that are in the ready state.
Setting the value of a [SyncVar] marks it as dirty, so it will be sent to clients at the end of the current frame. Only
simple values can be marked as [SyncVars]. The type of the SyncVar variable cannot be from an external DLL or
assembly.

using UnityEngine;
using UnityEngine.Networking;

public class Ship : NetworkBehaviour
{
[SyncVar]
public int health = 100;

[SyncVar]
public float energy = 100;
}

The allowed SyncVar types are;
• Basic type (byte, int, oat, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Structs containing allowable types .

Leave feedback
Obsolete

Description
This is an attribute that can be put on methods of NetworkBehaviour classes to allow them to be invoked on
clients from a server. Unlike the ClientRpc attribute, these functions are invoked on one individual target client,
not all of the ready clients.
[TargetRpc] functions are called by user code on the server, and then invoked on the corresponding client object
on the client of the speci ed NetworkConnection. The arguments to the RPC call are serialized across the
network, so that the client function is invoked with the same values as the function on the server. These functions
must begin with the pre x "Target" and cannot be static.
The rst argument to an TargetRpc function must be a NetworkConnection object.

using UnityEngine;
using UnityEngine.Networking;

public class Example : NetworkBehaviour
{
[TargetRpc]
public void TargetDoMagic(NetworkConnection target, int extra)
{
Debug.Log("Magic = " + (123 + extra));
}

[Command]
void CmdTest()
{
TargetDoMagic(connectionToClient, 55);
}
}

The allowed argument types are;
• Basic type (byte, int, oat, string, UInt64, etc)
• Built-in Unity math type (Vector3, Quaternion, etc),
• Arrays of basic types
• Structs containing allowable types
• NetworkIdentity
• NetworkInstanceId

• NetworkHash128
• GameObject with a NetworkIdentity component attached.

Leave feedback

Description
Implements high-level utility methods to simplify use of the Playable API with Animations.

Static Methods
Play

Plays the Playable on the given Animator.

PlayAnimatorController

Creates a PlayableGraph to be played on the given Animator. An
AnimatorControllerPlayable is also created for the given
RuntimeAnimatorController.

PlayClip

Creates a PlayableGraph to be played on the given Animator. An
AnimationClipPlayable is also created for the given AnimationClip.

PlayLayerMixer

Creates a PlayableGraph to be played on the given Animator. An
AnimationLayerMixerPlayable is also created.

PlayMixer

Creates a PlayableGraph to be played on the given Animator. An
AnimationMixerPlayable is also created.

Leave feedback

Description
This structure contains the frame information a Playable receives in Playable.PrepareFrame.

Properties
deltaTime

Time di erence between this frame and the preceding frame.

e ectiveParentDelay

The accumulated delay of the parent Playable during the PlayableGraph traversal.

e ectiveParentSpeed

The accumulated speed of the parent Playable during the PlayableGraph traversal.

e ectiveSpeed

The accumulated speed of the Playable during the PlayableGraph traversal.

e ectiveWeight

The accumulated weight of the Playable during the PlayableGraph traversal.

evaluationType

Indicates the type of evaluation that caused PlayableGraph.PrepareFrame to be
called.

frameId

The current frame identi er.

output

The PlayableOutput that initiated this graph traversal.

seekOccurred

Indicates that the local time was explicitly set.

timeHeld

Indicates the local time did not advance because it has reached the duration and the
extrapolation mode is set to Hold.

timeLooped

Indicates the local time wrapped because it has reached the duration and the
extrapolation mode is set to Loop.

weight

The weight of the current Playable.

Leave feedback

Description
Describes the cause for the evaluation of a PlayableGraph.

Properties
Evaluate

Indicates the graph was updated due to a call to PlayableGraph.Evaluate.

Playback

Indicates the graph was called by the runtime during normal playback due to
PlayableGraph.Play being called.

Leave feedback
Implements interfaces:IPlayable

Description
Playables are customizable runtime objects that can be connected together and are contained in a PlayableGraph
to create complex behaviours.
Playables can be used to create complex and exible data evaluation trees. Playables are nodes that can be
connected together, after which each Playable can set the "weight" or "in uence" of each of its children.
The playables of the same graph are contained in a PlayableGraph. A PlayableGraph can have several outputs,
also called "players", which implement IPlayableOutput. The PlayableOutput takes the result of their source
playable and apply it to an object in the Scene. For instance, the AnimationPlayableOutput is linked to a playable
node in the graph (the "source playable") and to an Animator in the Scene. When the graph is played, the
animation pose resulting of the graph evaluation is applied by the Animator. There are as many PlayableOutputs
as there are di erent playable types: AnimationPlayableOutput, AudioPlayableOutput, TexturePlayableOutput,
ScriptPlayableOutput, etc...
The ScriptPlayable is a special kind of playable. It's main role is to be a "custom" playable. It is a templated
struct where T must derived from PlayableBehaviour. These custom PlayableBehaviours allow to write behaviours
at speci c moments in the graph evaluation (see PlayableBehaviour.PrepareFrame and
PlayableBehaviour.ProcessFrame). A good example of a ScriptPlayable is the TimelinePlayable which is controlling
the Timeline graph. It creates and links together the playables in charge of the tracks and the clips.
When a PlayableGraph is played, each PlayableOutput will be traversed. During this traversal, it will call the
PrepareFrame method on each Playable. This allows the Playable to "prepare itself for the next evaluation". It is
during the PrepareFrame stage that each Playable can modify its children (either by adding new inputs or by
removing some of them). This enables Playable to "spawn" new children branches in the Playable tree at runtime.
This means that Playable trees are not static structures. They can adapt and change over time.
Once the preparation is done, the PlayableOutputs are in charge of processing the result, that's why they are also
called "players". In the case of an AnimationPlayableOutput, the Animator is in charge of processing the graph.
And in the case of a ScriptPlayableOutput, PlayableBehaviour.ProcessFrame will be called on each ScriptPlayable.
Note: You can use the PlayableExtensions methods on any struct implementing IPlayable.
Note: The Manual has detailed documentation about the Playables API.

Static Properties
Null

Returns an invalid Playable.

Leave feedback
Implements interfaces:IPlayableAsset

Description
A base class for assets that can be used to instantiate a Playable at runtime.

Properties
duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods
CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback
Implements interfaces:IPlayableBehaviour

Description
PlayableBehaviour is the base class from which every custom playable script derives.
A PlayableBehaviour can be used to add user-de ned behaviour to a PlayableGraph.
A PlayableBehaviour must be part of a branch of a PlayableGraph that is connected to an output to be active.
In the following example, two AnimationClip are controlled by two AnimationClipPlayable, which are blended by a
AnimationMixerPlayable. A custom BlenderPlayableBehaviour is modifying the inputs weigth of the
AnimationMixerPlayable every frame.

using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;

public class BlenderPlayableBehaviour : PlayableBehaviour
{
public AnimationMixerPlayable mixerPlayable;

public override void PrepareFrame(Playable playable, FrameData info)
{
float blend = Mathf.PingPong((float)playable.GetTime(), 1.0f);

mixerPlayable.SetInputWeight(0, blend);
mixerPlayable.SetInputWeight(1, 1.0f - blend);

base.PrepareFrame(playable, info);
}
}

public class PlayableBehaviourSample : MonoBehaviour
{
PlayableGraph m_Graph;
public AnimationClip clipA;
public AnimationClip clipB;

// Use this for initialization
void Start()
{
// Create the PlayableGraph.
m_Graph = PlayableGraph.Create();

// Add an AnimationPlayableOutput to the graph.
var animOutput = AnimationPlayableOutput.Create(m_Graph, "AnimationOutpu

// Add an AnimationMixerPlayable to the graph.
var mixerPlayable = AnimationMixerPlayable.Create(m_Graph, 2, false);

// Add two AnimationClipPlayable to the graph.
var clipPlayableA = AnimationClipPlayable.Create(m_Graph, clipA);
var clipPlayableB = AnimationClipPlayable.Create(m_Graph, clipB);

// Add a custom PlayableBehaviour to the graph.
// This behavior will change the weights of the mixer dynamically.
var blenderPlayable = ScriptPlayable.Create(m_
blenderPlayable.GetBehaviour().mixerPlayable = mixerPlayable;

// Create the topology, connect the AnimationClipPlayable to the
// AnimationMixerPlayable. Also add the BlenderPlayableBehaviour.
m_Graph.Connect(clipPlayableA, 0, mixerPlayable, 0);
m_Graph.Connect(clipPlayableB, 0, mixerPlayable, 1);
m_Graph.Connect(mixerPlayable, 0, blenderPlayable, 0);

// Use the ScriptPlayable as the source for the AnimationPlayableOutput.
// Since it's a ScriptPlayable, also set the source input port to make t
// passthrough to the AnimationMixerPlayable.
animOutput.SetSourcePlayable(blenderPlayable);
animOutput.SetSourceInputPort(0);

// Play the graph.
m_Graph.Play();
}

private void OnDestroy()
{
// Destroy the graph once done with it.
m_Graph.Destroy();
}
}

Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback

Description
Struct that holds information regarding an output of a PlayableAsset.
PlayableAssets specify the type of outputs it supports using PlayableBindings.
Do not create PlayableBinding objects directly. Use the provided built-in methods to create the corresponding
PlayableOutput. For example, to create a PlayableBinding for an AnimationPlayableOutput, use
AnimationPlayableBinding.Create. To create a PlayableBinding for a ScriptPlayableOutput, use
ScriptPlayableBinding.Create.

Static Properties
DefaultDuration

The default duration used when a PlayableOutput has no xed duration.

None

A constant to represent a PlayableAsset has no bindings.

Properties
outputTargetType

The type of target required by the PlayableOutput for this PlayableBinding.

sourceObject

A reference to a UnityEngine.Object that acts a key for this binding.

streamName

The name of the output or input stream.

Leave feedback
Implements interfaces:IExposedPropertyTable

Description
Instantiates a PlayableAsset and controls playback of Playable objects.

Properties
duration

The duration of the Playable in seconds.

extrapolationMode

Controls how the time is incremented when it goes beyond the duration of the playable.

initialTime

The time at which the Playable should start when rst played.

playableAsset

The PlayableAsset that is used to instantiate a playable for playback.

playableGraph

The PlayableGraph created by the PlayableDirector.

playOnAwake

Whether the playable asset will start playing back as soon as the component awakes.

state

The current playing state of the component. (Read Only)

time

The component's current time. This value is incremented according to the
PlayableDirector.timeUpdateMode when it is playing. You can also change this value
manually.

timeUpdateMode

Controls how time is incremented when playing back.

Public Methods
ClearGenericBinding

Clears the binding of a reference object.

ClearReferenceValue

Clears an exposed reference value.

DeferredEvaluate

Tells the PlayableDirector to evaluate it's PlayableGraph on the next update.

Evaluate

Evaluates the currently playing Playable at the current time.

GetGenericBinding

Returns a binding to a reference object.

GetReferenceValue

Retreives an ExposedReference binding.

Pause

Pauses playback of the currently running playable.

Play

Instatiates a Playable using the provided PlayableAsset and starts playback.

RebindPlayableGraphOutputs

Rebinds each PlayableOutput of the PlayableGraph.

RebuildGraph

Discards the existing PlayableGraph and creates a new instance.

Resume

Resume playing a paused playable.

SetGenericBinding

Sets the binding of a reference object from a PlayableBinding.

SetReferenceValue

Sets an ExposedReference value.

Stop

Stops playback of the current Playable and destroys the corresponding graph.

Events
paused

Event that is raised when a PlayableDirector component has paused.

played

Event that is raised when a PlayableDirector component has begun playing.

stopped

Event that is raised when a PlayableDirector component has stopped.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Extensions for all the types that implements IPlayable.
Extension methods are static methods that can be called as if they were instance methods on the extended type.

using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;

public class ExamplePlayableBehaviour : PlayableBehaviour
{
void Start()
{
PlayableGraph graph = PlayableGraph.Create();
AnimationMixerPlayable mixer = AnimationMixerPlayable.Create(graph, 1);

// Calling method PlayableExtensions.SetDuration on AnimationMixerPlayab
mixer.SetDuration(10);

// The line above is the same as calling directly PlayableExtensions.Set
PlayableExtensions.SetDuration(mixer, 10);
}
}

Static Methods
AddInput

Create a new input port and connect it to the output port of the given Playable.

ConnectInput

Connect the output port of a Playable to one of the input ports.

Destroy

Destroys the current Playable.

DisconnectInput

Disconnect the input port of a Playable.

GetDelay

Returns the delay of the playable.

GetDuration

Returns the duration of the Playable.

GetGraph

Returns the PlayableGraph that owns this Playable. A Playable can only be used in the

graph that was used to create it.
GetInput

Returns the Playable connected at the given input port index.

GetInputCount

Returns the number of inputs supported by the Playable.

GetInputWeight

Returns the weight of the Playable connected at the given input port index.

GetLeadTime

Returns the Playable lead time in seconds.

GetOutput

Returns the Playable connected at the given output port index.

GetOutputCount

Returns the number of outputs supported by the Playable.

GetPlayState

Returns the current PlayState of the Playable.

GetPreviousTime

Returns the previous local time of the Playable.

GetPropagateSetTime

Returns the time propagation behavior of this Playable.

GetSpeed

Returns the speed multiplier that is applied to the the current Playable.

GetTime

Returns the current local time of the Playable.

GetTraversalMode

Returns the propagation mode for the multi-output playable.

IsDelayed

Returns whether or not the Playable has a delay.

IsDone

Returns a ag indicating that a playable has completed its operation.

IsNull

Returns true if the Playable is null, false otherwise.

IsValid

Returns the vality of the current Playable.

Pause

Tells to pause the Playable.

Play

Starts to play the Playable.

SetDelay

Set a delay until the playable starts.

SetDone

Changes a ag indicating that a playable has completed its operation.

SetDuration

Changes the duration of the Playable.

SetInputCount

Changes the number of inputs supported by the Playable.

SetInputWeight

Changes the weight of the Playable connected to the current Playable.

SetLeadTime

Sets the Playable lead time in seconds.

SetOutputCount

Changes the number of outputs supported by the Playable.

SetPropagateSetTime

Changes the time propagation behavior of this Playable.

SetSpeed

Changes the speed multiplier that is applied to the the current Playable.

SetTime

Changes the current local time of the Playable.

SetTraversalMode

Sets the propagation mode of PrepareFrame and ProcessFrame for the multi-output
playable.

Leave feedback

Description
Use the PlayableGraph to manage Playable creations and destructions.
The PlayableGraph is also the link to di erent systems, through structs that implement IPlayableOutput. For
example, AnimationPlayableOutput or AudioPlayableOutput.

Public Methods
Connect

Connects two Playable instances.

Destroy

Destroys the graph.

DestroyOutput

Destroys the PlayableOutput.

DestroyPlayable

Destroys the Playable.

DestroySubgraph

Destroys the Playable and all its inputs, recursively.

Disconnect

Disconnects the Playable. The connections determine the topology of the
PlayableGraph and how it is evaluated.

Evaluate

Evaluates all the PlayableOutputs in the graph, and updates all the connected
Playables in the graph.

GetEditorName

Returns the name of the PlayableGraph.

GetOutput

Get PlayableOutput at the given index in the graph.

GetOutputByType

Get PlayableOutput of the requested type at the given index in the graph.

GetOutputCount

Returns the number of PlayableOutput in the graph.

GetOutputCountByType

Get the number of PlayableOutput of the requested type in the graph.

GetPlayableCount

Returns the number of Playable owned by the Graph.

GetResolver

Returns the table used by the graph to resolve ExposedReferences.

GetRootPlayable

Returns the Playable with no output connections at the given index.

GetRootPlayableCount

Returns the number of Playable owned by the Graph that have no connected
outputs.

GetTimeUpdateMode

Returns how time is incremented when playing back.

IsDone

Indicates that a graph has completed its operations.

IsPlaying

Indicates that a graph is presently running.

IsValid

Returns true if the PlayableGraph has been properly constructed using
PlayableGraph.CreateGraph and is not deleted.

Play

Plays the graph.

SetResolver

Changes the table used by the graph to resolve ExposedReferences.

SetTimeUpdateMode

Changes how time is incremented when playing back.

Stop

Stops the graph, if it is playing.

Static Methods
Create

Creates a PlayableGraph.

Leave feedback
Implements interfaces:IPlayableOutput

Description
See: IPlayableOutput.

Static Properties
Null

Returns an invalid PlayableOutput.

Leave feedback

Description
Extensions for all the types that implements IPlayableOutput.
Extension methods are static methods that can be called as if they were instance methods on the extended type.

using UnityEngine;
using UnityEngine.Playables;

public class ExamplePlayableBehaviour : PlayableBehaviour
{
void Start()
{
PlayableGraph graph = PlayableGraph.Create();
ScriptPlayableOutput scriptOutput = ScriptPlayableOutput.Create(graph, "

// Calling method PlayableExtensions.SetWeight on ScriptPlayableOutput a
scriptOutput.SetWeight(10);

// The line above is the same as calling directly PlayableExtensions.Set
PlayableOutputExtensions.SetWeight(scriptOutput, 10);
}
}

Static Methods
AddNoti cationReceiver

Registers a new receiver that listens for noti cations.

GetNoti cationReceivers

Retrieves the list of noti cation receivers currently registered on the output.

GetSourceOutputPort

Returns the source playable's output connection index.

GetSourcePlayable

Returns the source playable.

GetUserData

Returns the opaque user data. This is the same value as the last last argument
of ProcessFrame.

GetWeight

Returns the weight of the connection from the PlayableOutput to the source
playable.

IsOutputNull

Returns true if the PlayableOutput is null, false otherwise.

IsOutputValid
PushNoti cation

Queues a noti cation to be sent through the Playable system.

RemoveNoti cationReceiver

Unregisters a receiver on the output.

SetReferenceObject

Sets the bound object to a new value. Used to associate an output to an object
(Track asset in case of Timeline).

SetSourceOutputPort

Sets the source playable's output connection index. For playables with multiple
outputs, this determines which sub-branch of the source playable generates
this output.

SetSourcePlayable

Sets which playable that computes the output and which sub-tree index.

SetUserData

Sets the opaque user data. This same data is passed as the last argument to
ProcessFrame.

SetWeight

Sets the weight of the connection from the PlayableOutput to the source
playable.

Leave feedback
Implements interfaces:IPlayable

Description
A IPlayable implementation that contains a PlayableBehaviour for the PlayableGraph. PlayableBehaviour can be
used to write custom Playable that implement their own PrepareFrame callback.
A branch of a PlayableGraph must be connected to an output to be evaluated.
NOTE: You can use PlayableExtensions methods with ScriptPlayable objects.

Leave feedback

Description
A PlayableBinding that contains information representing a ScriptingPlayableOutput.

Static Methods
Create

Creates a PlayableBinding that contains information representing a ScriptPlayableOutput.

Leave feedback
Implements interfaces:IPlayableOutput

Description
A IPlayableOutput implementation that contains a script output for the a PlayableGraph.
A branch of a PlayableGraph must be connected to an output to be evaluated.
NOTE: You can use PlayableOutputExtensions methods with ScriptPlayableOutput objects.

Static Properties
Null

Returns an invalid ScriptPlayableOutput.

Static Methods
Create

Creates a new ScriptPlayableOutput in the associated PlayableGraph.

Leave feedback

Description
Interface implemented by all C# Playable implementations.
NOTE: You can use PlayableExtensions methods with all objects that implement IPlayable.

Leave feedback

Description
Interface that permits a class to inject playables into a graph.

Properties
duration

Duration in seconds.

outputs

A description of the PlayableOutputs generated by this asset.

Public Methods
CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Leave feedback

Description
Interface implemented by all C# Playable Behaviour implementations.

Leave feedback

Description
Interface implemented by all C# Playable output implementations.
NOTE: You can use PlayableOutputExtensions methods with all objects that implement IPlayableOutput.

Leave feedback
Obsolete

Description
Describes the type of information that ows in and out of a Playable. This also speci es that this Playable is
connectable to others of the same type.

Leave feedback

Description
De nes what time source is used to update a Director graph.

Properties
DSPClock

Update is based on DSP (Digital Sound Processing) clock. Use this for graphs that need
to be synchronized with Audio.

GameTime

Update is based on Time.time. Use this for graphs that need to be synchronized on
gameplay, and that need to be paused when the game is paused.

UnscaledGameTime

Update is based on Time.unscaledTime. Use this for graphs that need to be updated
even when gameplay is paused. Example: Menus transitions need to be updated even
when the game is paused.

Manual

Update mode is manual. You need to manually call PlayableGraph.Evaluate with your
own deltaTime. This can be useful for graphs that are completely disconnected from
the rest of the game. For example, localized bullet time.

Leave feedback

Description
Wrap mode for Playables.

Properties
Hold

Hold the last frame when the playable time reaches it's duration.

Loop

Loop back to zero time and continue playing.

None

Do not keep playing when the time reaches the duration.

Leave feedback

Description
Traversal mode for Playables.

Properties
Mix

Causes the Playable to prepare and process it's inputs when demanded by an output.

Passthrough

Causes the Playable to act as a passthrough for PrepareFrame and ProcessFrame. If the
PlayableOutput being processed is connected to the n-th input port of the Playable, the
Playable only propagates the n-th output port. Use this enum value in conjunction with
PlayableOutput SetSourceOutputPort.

Leave feedback

Description
Status of a Playable.

Properties
Paused

The Playable has been paused. Its local time will not advance.

Playing

The Playable is currently Playing.

Delayed

The Playable has been delayed, using PlayableExtensions.SetDelay. It will not start until
the delay is entirely consumed.

Leave feedback

Description
Custom CPU Pro ler label used for pro ling arbitrary code blocks.
Use CustomSampler to measure execution time of script code blocks. Produced information is displayed in the
CPU Pro ler and can be captured with Recorder.
Using CustomSampler is more e cient than using Pro ler.BeginSample to pro le your code. This is because
CustomSamplers that have been created in advance have very low Begin call overhead compared to
Pro ler.BeginSample.

using UnityEngine;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour
{
CustomSampler sampler;
void Start()
{
sampler = CustomSampler.Create("MyCustomSampler");
}

void Update()
{
sampler.Begin();
// do something that takes a lot of time
sampler.End();
}
}

CustomSampler.Begin is conditionally compiled away using ConditionalAttribute. Thus it will have zero overhead,
when it is deployed in non-Development Build.
See Also: Sampler, CustomSampler.Create, CustomSampler.Begin.

Public Methods
Begin

Begin pro ling a piece of code with a custom label de ned by this instance of
CustomSampler.

End

End pro ling a piece of code with a custom label.

Static Methods
Create

Creates a new CustomSampler for pro ling parts of your code.

Inherited Members
Properties
isValid

Returns true if Sampler is valid. (Read Only)

name

Sampler name. (Read Only)

Public Methods
GetRecorder

Returns Recorder associated with the Sampler.

Static Methods
Get

Returns Sampler object for the speci c CPU Pro ler label.

GetNames

Returns number and names of all registered Pro ler labels.

Leave feedback

Description
Controls the Pro ler from script.
You can add custom Pro ler sections in your scripts with Pro ler.BeginSample and Pro ler.EndSample.
On standalone platforms, you can save all pro ling information to a le, which allows you to inspect it later. To do
this, you must specify a Pro ler.logFile and set both Pro ler.enabled and Pro ler.enableBinaryLog to true.
Because use of the Pro ler negatively a ects the performance of your app, most of the Pro ler API functionality is
only available when "Development Build" is enabled. This means you must enable "Developer Build" if you want
to use pro ler API methods in your built app. Disabling "Development Build" makes your app run faster, but
prevents you from using most of the Pro ler API methods.
The exception to this are the Pro ler API methods relating to memory usage. Because Unity manages most of its
system memory at run-time, it can provide that information with no performance penalty, therefore those
methods are available even if "Development Build" is not enabled. This applies to all memory-related Pro ler API
methods except Pro ler.GetAllocatedMemoryForGraphicsDriver and Pro ler.GetRuntimeMemorySizeLong, since
they require extra pro ling data only available in development builds.

Static Properties
areaCount

The number of Pro ler Areas that you can pro le.

enableBinaryLog

Enables the logging of pro ling data to a le.

enabled

Enables the Pro ler.

logFile

Speci es the le to use when writing pro ling data.

maxUsedMemory

Sets the maximum amount of memory that Pro ler uses for bu ering data. This
property is expressed in bytes.

usedHeapSizeLong

Returns the number of bytes that Unity has allocated. This does not include bytes
allocated by external libraries or drivers.

Static Methods
AddFramesFromFile

Displays the recorded pro le data in the pro ler.

BeginSample

Begin pro ling a piece of code with a custom label.

BeginThreadPro ling

Enables pro ling on the thread from which you call this method.

EndSample

Ends the current pro ling sample.

EndThreadPro ling

Frees the internal resources used by the Pro ler for the thread.

GetAllocatedMemoryForGraphicsDriver

Returns the amount of allocated memory for the graphics driver, in
bytes.Only available in development players and editor.

GetAreaEnabled

Returns whether or not a given Pro lerArea is currently enabled.

GetMonoHeapSizeLong

Returns the size of the reserved space for managed-memory.

GetMonoUsedSizeLong

The allocated managed-memory for live objects and non-collected
objects.

GetRuntimeMemorySizeLong

Gathers the native-memory used by a Unity object.

GetTempAllocatorSize

Returns the size of the temp allocator.

GetTotalAllocatedMemoryLong

The total memory allocated by the internal allocators in Unity. Unity
reserves large pools of memory from the system. This function
returns the amount of used memory in those pools.

GetTotalReservedMemoryLong

The total memory Unity has reserved.

GetTotalUnusedReservedMemoryLong

Unity allocates memory in pools for usage when unity needs to
allocate memory. This function returns the amount of unused
memory in these pools.

SetAreaEnabled

Enable or disable a given Pro lerArea.

SetTempAllocatorRequestedSize

Sets the size of the temp allocator.

Leave feedback

Description
Records pro ling data produced by a speci c Sampler.
Recorder accumulates elapsed time of every Begin/End pair during a frame. Once enabled it sums delta time
between Begin and End samples produced by a Sampler. Use elapsedNanoseconds to get the accumulated time
for the previous frame.

using UnityEngine;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour
{
Recorder behaviourUpdateRecorder;
void Start()
{
behaviourUpdateRecorder = Recorder.Get("BehaviourUpdate");
behaviourUpdateRecorder.enabled = true;
}

void Update()
{
if (behaviourUpdateRecorder.isValid)
Debug.Log("BehaviourUpdate time: " + behaviourUpdateRecorder.elapsed
}
}

Note: A Recorder collects data regardless of the Pro ler state. When a Recorder is enabled, data is accumulated
every time its Sampler is hit. This information is equivalent to the one you can see in Hierarchy view in the Pro ler
Window.
At the moment Samplers are available only in the Editor and Development Players. Use Recorder.isValid to verify
if Recorder can collect the data.
Recorder supports only internal static Pro ler labels and labels generated by CustomSampler. Dynamic internal
labels produced by scripting method calls and labels produced by Pro ler.BeginSample are not supported.
See Also: Sampler, Recorder.isValid, Recorder.elapsedNanoseconds.

Properties

elapsedNanoseconds

Accumulated time of Begin/End pairs for the previous frame in nanoseconds. (Read
Only)

enabled

Enables recording.

isValid

Returns true if Recorder is valid and can collect data. (Read Only)

sampleBlockCount

Number of time Begin/End pairs was called during the previous frame. (Read Only)

Public Methods
CollectFromAllThreads

Con gures the recorder to collect samples from all threads.

FilterToCurrentThread

Con gures the recorder to only collect data from the current thread.

Static Methods
Get

Use this function to get a Recorder for the speci c Pro ler label.

Leave feedback

Description
Provides control over a CPU Pro ler label.
Sampler is a counter which produces timings information you can see in CPU Pro ler. Use this class to get
information about built-in or custom Pro ler label.
See Also: Sampler.Get, CustomSampler, CPU Usage Pro ler.

Properties
isValid

Returns true if Sampler is valid. (Read Only)

name

Sampler name. (Read Only)

Public Methods
GetRecorder

Returns Recorder associated with the Sampler.

Static Methods
Get

Returns Sampler object for the speci c CPU Pro ler label.

GetNames

Returns number and names of all registered Pro ler labels.

Leave feedback
Implements interfaces:IPurchasingModule

Description
Helper base class for IAP Modules.
In addition to providing helper methods, use of an abstract class such as this allows addition of
IPurchasingModule methods without breaking compatibility with existing plugins.

Public Methods
Con gure

Called when your module is loaded by Unity.

Protected Methods
BindCon guration

Bind a store-speci c con guration type to a concrete instance.

BindExtension

Bind a store-speci c extension type to a concrete instance.

RegisterStore

Register a store implementation along with its name.

Leave feedback
Implements interfaces:IStore

Description
Extension point for purchasing plugins.
An abstract class is provided so that methods can be added to the IStore without breaking binary compatibility
with existing plugins.
See Also: IStore.

Public Methods
FinishTransaction

Called when Unity IAP has nished processing a purchase.

Initialize

Called when Unity IAP is initializing.

Purchase

Called when a user wants to buy the speci ed Product.

RetrieveProducts

Fetch product metadata and purchase state for the set of ProductDe nitions.

Leave feedback

Description
A common format which store subsystems use to describe available products.
Includes purchase state via receipt and transactionId.

Properties
metadata

Localized metadata retrieved from the Store.

receipt

A purchase receipt, if owned. Otherwise null.

storeSpeci cId

The store-speci c ID.

transactionId

The purchase transaction ID, if owned. Otherwise null.

type

The ProductType.

Constructors
ProductDescription

Create a ProductDescription.

Leave feedback

Description
Represents a failed purchase as described by a purchasing service.
Is sent by a store implementation to IAP which forwards this message on to the user.
See Also: IStoreCallback.OnPurchaseFailed.

Properties
message

More information about the purchase failure from Unity IAP or the platform store, if
available.

productId

The store-speci c product ID which failed to purchase.

reason

The reason for the purchase failure.

Constructors
PurchaseFailureDescription

Creates a PurchaseFailureDescription.

Leave feedback

Description
ICatalogProvider can replace or add products to the product con guration at runtime.
When Purchasing is initialized, if the Con gurationBuilder has the useCatalogProvider property set to true, the
ICatalogProvider's FetchProducts method will be called before the initialization is completed.

Public Methods
FetchProducts

ProductDe nitions fetched by this method will add to or replace the set of
ProductDe nitions supplied in the Con gurationBuilder.

Leave feedback

Description
Con gures Unity IAP with one or more store implementations.
Passed into IPurchasingModules during Unity IAP initialization.
See Also: IPurchasingModule.

Public Methods
RegisterCon guration

Informs Unity IAP that extended Con guration is available.

RegisterExtension

Informs Unity IAP that a store extension is available.

RegisterStore

Informs Unity IAP that a store implementation exists, specifying its name.

SetCatalogProvider

Sets the active ICatalogProvider. Calling this method after Purchasing is initialized has
no e ect.

Leave feedback

Description
A Unity IAP con guration of one or more stores.
Store implementations must provide an implementation of this interface. Use IPurchasingModule
implementations with the ConfigurationBuilder to extend Unity IAP's store functionality.

using UnityEngine;

class MyPurchasingModule : IPurchasingModule
{
public void Configure(IPurchasingBinder binder)
{
binder.RegisterStore("MyManufacturerAppStore", InstantiateMyManufacturer
// Our Purchasing service implementation provides the real implementatio
binder.RegisterExtension(new FakeManufacturerEx
}

IStore InstantiateMyManufacturerAppStore()
{
// Check for Manufacturer. "Android" used here for the sake of example.
// In your implementation, return platform-appropriate store instead of
if (Application.platform == RuntimePlatform.Android) { return null; }
else { return null; }
}

IStoreExtension IManufacturerExtensions() { return null; }
}

See Also: AbstractPurchasingModule, IStore, IStoreExtension, Con gurationBuilder.

Public Methods
Con gure

Called when Unity IAP is loading your module. Register stores and associated extensions
using the IPurchasingBinder.

Leave feedback

Description
The public interface of an underlying store system (e.g. Google Play or Apple App Store) typically exposed to Unity
IAP extending its in-app purchasing platform support.
Unity IAP is extensible, supporting registration of store systems through IPurchasingModule implementations
shared with Unity IAP via a ConfigurationBuilder during initialization.
A sample store class:

using
using
using
using
using

System;
System.Collections.ObjectModel;
System.Collections.Generic;
UnityEngine.Purchasing;
UnityEngine.Purchasing.Extension;

// Purchases always succeed at the sample store
internal class SampleStore : IStore
{
public const string Name = "samplestore";
private IStoreCallback m_Biller;
private List m_PurchasedProducts = new List();

public void Initialize(IStoreCallback biller)
{
m_Biller = biller;
}

public void RetrieveProducts(ReadOnlyCollection productDe
{
var products = new List();
foreach (var product in productDefinitions)
{
var metadata = new ProductMetadata("$123.45", "Fake title for " + pr
products.Add(new ProductDescription(product.storeSpecificId, metadat
}
m_Biller.OnProductsRetrieved(products);
}

public void Purchase(ProductDefinition product, string developerPayload)
{
// Keep track of non consumables.
if (product.type != ProductType.Consumable)
{
m_PurchasedProducts.Add(product.storeSpecificId);
}
m_Biller.OnPurchaseSucceeded(product.storeSpecificId, "{ \"this\" : \"is
}

public void FinishTransaction(ProductDefinition product, string transactionI
{
}
}

See Also: AbstractStore, UnityPurchasing.Initialize, IPurchasingModule, Con gurationBuilder.

Public Methods
FinishTransaction

Called by Unity IAP when a transaction has been recorded.

Initialize

Initialize the store.

Purchase

Handle a purchase request from a user.

RetrieveProducts

Fetch the latest product metadata, including purchase receipts, asynchronously with
results returned via IStoreCallback.

Leave feedback

Description
Callback used by store implementations to interact with Unity IAP.

Properties
products

Gets the item with local identi er.

useTransactionLog

Toggle use of Unity IAP's transaction log.

Public Methods
OnProductsRetrieved

Complete setup by providing a list of available products, complete with metadata
and any associated purchase receipts and transaction IDs.

OnPurchaseFailed

Call to indicate to Unity IAP that a purchase failed.

OnPurchaseSucceeded

Inform Unity IAP of a purchase.

OnSetupFailed

Indicate that IAP is unavailable for a speci c reason, such as IAP being disabled in
device settings.

Leave feedback

Description
Common interface for all extended con guration of stores.
Use during Unity IAP con guration by IPurchasingModule before initialization. Bound to store during
IPurchasingModule con guration via ConfigurationBuilder.
Sample store con guration interface (needing implementation), to be instantiated by the time the owning
purchasing module is requested to con gure its stores:

using UnityEngine.Purchasing.Extension;

// Sample store config. Implementation can be used by the user,
// and accessed by the owning purchasing module during store
// instantiation.
public interface ISampleConfiguration : IStoreConfiguration
{
// Request access to sample debugging backend
bool useSampleStoreDebuggingBackend { get; set; }
}

See Also: IPurchasingModule, Con gurationBuilder.

Leave feedback

Description
Builds con gurations for Unity IAP.
Collects products and store-speci c con guration details.
See Also: UnityPurchasing.Initialize.

Properties
products

The products built so far.

useCatalogProvider

If this property is set to true, Purchasing will use the supplied ICatalogProvider to
augment the supplied set of products during initialization.

Public Methods
AddProduct

Add a product with a Unity IAP ID, type and optional set of store-speci c IDs.

AddProducts

Add a collection of ProductDe nitions.

Con gure

Access store-speci c Con guration settings.

Static Methods
Instance

Get an instance of Con gurationBuilder.

Leave feedback

Description
Maps store-speci c product identi ers to one or more store names.
See Also: Con gurationBuilder.AddProduct.

Constructors
IDs

Create a new mapping of store identi ers to store names.

Public Methods
Add

Add a product ID which is supported by a list of store platform names.

GetEnumerator

Enumerator for IDs.

Leave feedback

Description
De nes a reward that is paid to the player when an in-app purchase product is purchased.

Static Properties
MaxDataLength

Represents the maximum allowed length for the data eld on a PayoutDe nition.

MaxSubtypeLength

Represents the maximum allowed length for the subtype eld on a PayoutDe nition.

Properties
data

A eld for user-speci ed data.

quantity

The quantity of this payout.

subtype

The subtype of this payout.

type

The type of this payout.

typeString

A string representation of the type of this payout.

Constructors
PayoutDe nition

Create a PayoutDe nition and de ne the values for the type, subtype, quantity, and data
elds.

Leave feedback

Description
Represents a product that may be purchased as an In-App Purchase.
Here is an example of a sample Store class working with a Product references.

using System;
using UnityEngine;
using UnityEngine.Purchasing;

public class MyStoreClass : MonoBehaviour, IStoreListener
{
static string kProductID100Currency = "virtualcurrency_100";
IStoreController m_StoreController;
void Awake()
{
ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPur
builder.AddProduct(kProductID100Currency, ProductType.Consumable);
UnityPurchasing.Initialize(this, builder);
}

public void PurchaseCurrency()
{
if (m_StoreController != null)
{
// Fetch the currency Product reference from Unity Purchasing
Product product = m_StoreController.products.WithID(kProductID100Cur
if (product != null && product.availableToPurchase)
{
m_StoreController.InitiatePurchase(product);
}
}
}

public void OnInitialized(IStoreController controller, IExtensionProvider ex
{
m_StoreController = controller;
}

public void OnInitializeFailed(InitializationFailureReason error) {}
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
{
if (String.Equals(e.purchasedProduct.definition.id, kProductID100Currenc
{
Debug.Log("Purchased 100 coins");
}
return PurchaseProcessingResult.Complete;
}

public void OnPurchaseFailed(Product item, PurchaseFailureReason r) {}
}

Properties
availableToPurchase

Determine if this product is available to purchase according to the store subsystem.

de nition

Fundamental immutable product properties.

hasReceipt

Owned Non Consumables and Subscriptions should always have receipts.

metadata

Localized metadata provided by the store system.

receipt

The purchase receipt for this product, if owned. Otherwise null.

transactionID

A unique identi er for this product's transaction, if available. Otherwise null.

Public Methods
Equals

Equality de ned for use in collections.

GetHashCode

GetHashCode de ned for use in collections.

Leave feedback

Description
Provides helper methods to retrieve products by ID.
Supports retrieving by both store-independent and store-speci c product ID. Retrieves products registered with
Unity IAP.

Properties
all

All products.

set

The set of products.

Public Methods
WithID

Get the product with store-independent Unity IAP ID.

WithStoreSpeci cID

Get the product with the store-speci c ID.

Leave feedback

Description
Minimal product de nition, used by apps declaring products for sale.

Properties
enabled

This ag indicates whether a product should be o ered for sale. It is controlled through
the cloud catalog dashboard.

id

Unity IAP product ID. Potentially independent of store IDs.

payout

Access the rst payout on this ProductDe nition. Returns null if there are no payouts
speci ed.

payouts

Access all payouts attached to this ProductDe nition.

storeSpeci cId

The ID this product has on a store.

type

The product type.

Constructors
ProductDe nition

Create a ProductDe nition with di erent Store-independent ID and Store-speci c ID. Use
this when you need to two IDs to be di erent.

Public Methods
Equals

Compares id properties. Requires obj be a ProductDe nition.

GetHashCode

Gets the application-domain-speci c hash code of id.

Leave feedback

Description
Localized information about a product, retrieved from a store.

Properties
isoCurrencyCode

Product currency in ISO 4217 format; e.g. GBP or USD.

localizedDescription

Localized product description as retrieved from the store subsystem; e.g. Apple or
Google.

localizedPrice

Decimal product price denominated in the currency indicated by isoCurrencySymbol.

localizedPriceString

Localized price string.

localizedTitle

Localized product title as retrieved from the store subsystem; e.g. Apple or Google.

Constructors
ProductMetadata

Create a ProductMetadata.

Leave feedback

Description
A purchase that succeeded, including the purchased product along with its purchase receipt.
See Also: IStoreListener.ProcessPurchase.

Properties
purchasedProduct

The Product that was purchased.

Leave feedback

Description
A purchase failed event containing diagnostic data.
Explains the purchase failure.

Properties
message

More information about the purchase failure, if available. Otherwise null.

purchasedProduct

The product that failed to purchase.

reason

The reason for the purchase failure.

Leave feedback

Description
Entry point for Applications using Unity IAP.
Class is available to compiler and runtime when Unity IAP is enabled in Editor's Services window.

Static Methods
ClearTransactionLog

Clears Unity IAP's internal transaction log.

Initialize

Initialize Unity IAP with the speci ed listener and con guration.

Leave feedback

Description
Provides access to store-speci c extended functionality.
Speci c extension's interface type can be associated with a speci c store type via instantiating
IPurchasingModule's IPurchasingBinder.
Sample extension:

using System;
using UnityEngine;
using UnityEngine.Purchasing;

// Extends an implementing store.
public interface ISampleExtension : IStoreExtension
{
// Implemented by associated store.
void RestoreTransactions(Action callback);
}

See Also: IStoreExtension, IPurchasingModule, IPurchasingBinder.

Public Methods
GetExtension

Get the store-speci c extension of speci ed type.

Leave feedback

Description
Used by Applications to control Unity IAP.
See Also: Product for an example usage.

Properties
products

Store products including metadata and purchase receipts.

Public Methods
Con rmPendingPurchase

Con rm a pending purchase.

FetchAdditionalProducts

This method may be used to fetch additional products for purchasing, or to
refresh metadata on existing products.

InitiatePurchase

Initiate a purchase for a speci c product.

Leave feedback

Description
Common interface for all purchasing extensions.

See Also: IExtensionProvider.

Leave feedback

Description
Noti es your Application of purchasing related events.
See Also: Product for an example implementation.

Public Methods
OnInitialized

Called when Unity IAP has retrieved all product metadata and is ready to make
purchases.

OnInitializeFailed

Note that Unity IAP will not call this method if the device is o ine, but continually
attempt initialization until online.

OnPurchaseFailed

Called when a purchase fails.

ProcessPurchase

Called when a purchase succeeds.

Leave feedback

Description
The various reasons Unity IAP initialization can fail.
See Also: IStoreListener.OnInitializeFailed.

Properties
PurchasingUnavailable

In-App Purchases disabled in device settings.

NoProductsAvailable

No products available for purchase.

AppNotKnown

The store reported the app as unknown.

Leave feedback

Description
Speci es the type of a PayoutDe nition.

Properties
Other

Use this for payouts that are not covered by the other values in the PayoutType enum.

Currency

Use this for payouts that grant currency to the player, such as gold or gems.

Resource

Use this for payouts that grant the player a resource like health or food.

Leave feedback

Description
Categories of purchasable product.
See Also: Con gurationBuilder.AddProduct, Con gurationBuilder.AddProducts, and ProductDe nition.type.

Properties
Consumable

Can be purchased repeatedly. Suitable for consumable products such as virtual
currencies.

NonConsumable

Can only be purchased once. Suitable for one-o purchases such as extra levels.

Subscription

Can be purchased repeatedly and restored. Durable but with a nite duration of validity.

Leave feedback

Description
The various reasons a purchase can fail.
See Also: IStoreListener.OnPurchaseFailed.

Properties
PurchasingUnavailable

The system purchasing feature is unavailable.

ExistingPurchasePending

A purchase was already in progress when a new purchase was requested.

ProductUnavailable

The product is not available to purchase on the store.

SignatureInvalid

Signature validation of the purchase's receipt failed.

UserCancelled

The user opted to cancel rather than proceed with the purchase.

PaymentDeclined

There was a problem with the payment.

DuplicateTransaction

A duplicate transaction error when the transaction has already been completed
successfully.

Unknown

A catch-all for unrecognized purchase problems.

Leave feedback

Description
Informs Unity IAP as to whether an Application has nished processing a purchase.
Use to complete or delay completion of acknowledging receipt of purchase.
See Also: IStoreListener.ProcessPurchase.

Properties
Complete

The application has nished processing the purchase.

Pending

The application has not nished processing the purchase, e.g. it is pushing it to a server
asynchronously.

Leave feedback

Description
Allows the asynchronous read back of GPU resources.
This class is used to copy resource data from the GPU to the CPU without any stall (GPU or CPU), but adds a few
frames of latency. See Also: AsyncGPUReadbackRequest.

Static Methods
Request

Triggers a request to asynchronously fetch the data from a GPU resource.

Leave feedback

Description
Represents an asynchronous request for a GPU resource.
Use AsyncGPUReadback.Request to retrieve an asynchronous request for a GPU resource. Pending requests are
automatically updated each frame. The result is accessible only for a single frame once is successfully ful lled and
this request is then disposed of in the following frame. Common uses for this are to query
AsyncGPUReadbackRequest.done each frame (or within a coroutine) and then call
AsyncGPUReadbackRequest.GetData if the AsyncGPUReadbackRequest.hasError is false. You don't have to
manage the request lifetime as this is managed internally. A request that has been disposed of will result in the
AsyncGPUReadbackRequest.hasError property being true. See Also:AsyncGPUReadback.

Properties
depth

When reading data from a ComputeBu er, depth is 1, otherwise, the property takes the
value of the requested depth from the texture.

done

Checks whether the request has been processed.

hasError

This property is true if the request has encountered an error.

height

When reading data from a ComputeBu er, height is 1, otherwise, the property takes the
value of the requested height from the texture.

layerCount

Number of layers in the current request.

layerDataSize

The size in bytes of one layer of the readback data.

width

The width of the requested GPU data.

Public Methods
GetData

Fetches the data of a successful request.

Update

Triggers an update of the request.

WaitForCompletion

Waits for completion of the request.

Leave feedback

Description
List of graphics commands to execute.
Command bu ers hold list of rendering commands ("set render target, draw mesh, ..."). They can be set to
execute at various points during camera rendering (see Camera.AddCommandBu er), light rendering (see
Light.AddCommandBu er) or be executed immediately (see Graphics.ExecuteCommandBu er).
Typically they would be used to extend Unity's rendering pipeline in some custom ways. For example, you could
render some additional objects into deferred rendering g-bu er after all regular objects are done, or do custom
processing of light shadow maps. See command bu ers overview page for more details.
Command bu ers can be created and then executed many times if needed.
See Also: Camera.AddCommandBu er, Light.AddCommandBu er, CameraEvent, LightEvent,
Graphics.ExecuteCommandBu er, command bu ers overview.

Properties
name

Name of this command bu er.

sizeInBytes

Size of this command bu er in bytes (Read Only).

Constructors
CommandBu er

Create a new empty command bu er.

Public Methods
BeginSample

Adds a command to begin pro le sampling.

Blit

Add a "blit into a render texture" command.

Clear

Clear all commands in the bu er.

ClearRandomWriteTargets

Clear random write targets for Shader Model 4.5 level pixel shaders.

ClearRenderTarget

Adds a "clear render target" command.

ConvertTexture

Converts and copies a source texture to a destination texture with a
di erent format or dimensions.

CopyCounterValue

Adds a command to copy ComputeBu er counter value.

CopyTexture

Adds a command to copy a texture into another texture.

CreateGPUFence

Creates a GPUFence which will be passed after the last Blit, Clear,
Draw, Dispatch or Texture Copy command prior to this call has been
completed on the GPU.

DisableScissorRect

Add a command to disable the hardware scissor rectangle.

DisableShaderKeyword

Adds a command to disable global shader keyword.

DispatchCompute

Add a command to execute a ComputeShader.

DrawMesh

Add a "draw mesh" command.

DrawMeshInstanced

Add a "draw mesh with instancing" command.The command will not
immediately fail and throw an exception if Material.enableInstancing is
false, but it will log an error and skips rendering each time the
command is being executed if such a condition is
detected.InvalidOperationException will be thrown if the current
platform doesn't support this API (i.e. if GPU instancing is not
available). See SystemInfo.supportsInstancing.

DrawMeshInstancedIndirect

Add a "draw mesh with indirect instancing" command.

DrawProcedural

Add a "draw procedural geometry" command.

DrawProceduralIndirect

Add a "draw procedural geometry" command.

DrawRenderer

Add a "draw renderer" command.

EnableScissorRect

Add a command to enable the hardware scissor rectangle.

EnableShaderKeyword

Adds a command to enable global shader keyword.

EndSample

Adds a command to begin pro le sampling.

GenerateMips

Generate mipmap levels of a render texture.

GetTemporaryRT

Add a "get a temporary render texture" command.

GetTemporaryRTArray

Add a "get a temporary render texture array" command.

IssuePluginCustomBlit

Send a user-de ned blit event to a native code plugin.

IssuePluginCustomTextureUpdateV2

Send a texture update event to a native code plugin.

IssuePluginEvent

Send a user-de ned event to a native code plugin.

IssuePluginEventAndData

Send a user-de ned event to a native code plugin with custom data.

ReleaseTemporaryRT

Add a "release a temporary render texture" command.

RequestAsyncReadback

Adds an asynchonous GPU readback request command to the
command bu er.

ResolveAntiAliasedSurface

Force an antialiased render texture to be resolved.

SetComputeBu erParam

Adds a command to set an input or output bu er parameter on a
ComputeShader.

SetComputeFloatParam

Adds a command to set a oat parameter on a ComputeShader.

SetComputeFloatParams

Adds a command to set multiple consecutive oat parameters on a
ComputeShader.

SetComputeIntParam

Adds a command to set an integer parameter on a ComputeShader.

SetComputeIntParams

Adds a command to set multiple consecutive integer parameters on a
ComputeShader.

SetComputeMatrixArrayParam

Adds a command to set a matrix array parameter on a
ComputeShader.

SetComputeMatrixParam

Adds a command to set a matrix parameter on a ComputeShader.

SetComputeTextureParam

Adds a command to set a texture parameter on a ComputeShader.

SetComputeVectorArrayParam

Adds a command to set a vector array parameter on a
ComputeShader.

SetComputeVectorParam

Adds a command to set a vector parameter on a ComputeShader.

SetGlobalBu er

Add a "set global shader bu er property" command.

SetGlobalColor

Add a "set global shader color property" command.

SetGlobalDepthBias

Add a command to set global depth bias.

SetGlobalFloat

Add a "set global shader oat property" command.

SetGlobalFloatArray

Add a "set global shader oat array property" command.

SetGlobalInt

Sets the given global integer property for all shaders.

SetGlobalMatrix

Add a "set global shader matrix property" command.

SetGlobalMatrixArray

Add a "set global shader matrix array property" command.

SetGlobalTexture

Add a "set global shader texture property" command, referencing a
RenderTexture.

SetGlobalVector

Add a "set global shader vector property" command.

SetGlobalVectorArray

Add a "set global shader vector array property" command.

SetInvertCulling

Add a "set invert culling" command to the bu er.

SetProjectionMatrix

Add a command to set the projection matrix.

SetRandomWriteTarget

Set random write target for Shader Model 4.5 level pixel shaders.

SetRenderTarget

Add a "set active render target" command.

SetShadowSamplingMode

Add a "set shadow sampling mode" command.

SetViewMatrix

Add a command to set the view matrix.

SetViewport

Add a command to set the rendering viewport.

SetViewProjectionMatrices

Add a command to set the view and projection matrices.

WaitOnGPUFence

Instructs the GPU to wait until the given GPUFence is passed.

Leave feedback

Description
Used to manage synchronisation between tasks on async compute queues and the graphics queue.
Not all platforms support GPU fences. See SystemInfo.supportsGPUFence.
A GPUFence represents a point during GPU processing after a speci c compute shader dispatch or draw call has
completed. It can be used to achieve synchronisation between tasks running on the async compute queues or the
graphics queue by having one or more queues wait until a given fence has passed. This is an important
consideration when working with async compute as which tasks are running at the same time on the graphics
queue and the async compute queues is key to improving GPU performance.
GPUFence's do not need to be used to synchronise where one GPU task is writing to a resource that will be read
as an input by another. These resource dependencies are automatically handled by Unity.
GPUFences should be created via Graphics.CreateGPUFence or CommandBu er.CreateGPUFence attempting to
use a GPUFence that has not been created via one of these functions will result in an exception.
It is possible to create circular dependencies using GPUFences that, if executed, would deadlock the GPU. Unity
will detect such circular dependencies in the Editor and raise exceptions if any exist after calls to
Graphics.CreateGPUFence, Graphics.WaitOnGPUFence, Graphics.ExecuteCommandBu er,
Graphics.ExecuteCommandBu erAsync, ScriptableRenderContext.ExecuteCommandBu er,
ScriptableRenderContext.ExecuteCommandBu erAsync.
See Also: SystemInfo.supportsGPUFence, Graphics.CreateGPUFence, Graphics.WaitOnGPUFence,
CommandBu er.CreateGPUFence, CommandBu er.WaitOnGPUFence, Graphics.ExecuteCommandBu er,
Graphics.ExecuteCommandBu erAsync, ScriptableRenderContext.ExecuteCommandBu er,
ScriptableRenderContext.ExecuteCommandBu erAsync.

Properties
passed

Has the GPUFence passed?Allows for CPU determination of whether the GPU has passed
the point in its processing represented by the GPUFence.

Leave feedback

Description
Script interface for Graphics Settings.

Static Properties
lightsUseColorTemperature

Whether to use a Light's color temperature when calculating the nal
color of that Light."

lightsUseLinearIntensity

If this is true, Light intensity is multiplied against linear color values. If
it is false, gamma color values are used.

renderPipelineAsset

The RenderPipelineAsset that describes how the Scene should be
rendered.

transparencySortAxis

An axis that describes the direction along which the distances of
objects are measured for the purpose of sorting.

transparencySortMode

Transparent object sorting mode.

useScriptableRenderPipelineBatching

Enable/Disable SRP batcher (experimental) at runtime.

Static Methods
GetCustomShader

Get custom shader used instead of a built-in shader.

GetShaderMode

Get built-in shader mode.

HasShaderDe ne

Returns true if shader de ne was set when compiling shaders for current GraphicsTier.

SetCustomShader

Set custom shader to use instead of a built-in shader.

SetShaderMode

Set built-in shader mode.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A collection of ShaderKeyword that represents a speci c platform variant.
See Also: ShaderKeyword, Rendering.ShaderKeywordSetUtility, Shader.EnableKeyword, Shader.EnableKeyword,
multiple variants.

Public Methods
Disable

Disable a speci c shader keyword.

Enable

Enable a speci c shader keyword.

IsEnabled

Check whether a speci c shader keyword is enabled.

Leave feedback

Description
Re ectionProbeBlendInfo contains information required for blending probes.
See Also: Renderer.re ectionProbeUsage.

Properties
probe

Re ection Probe used in blending.

weight

Speci es the weight used in the interpolation between two probes, value varies from 0.0
to 1.0.

Leave feedback

Description
Describes a render target with one or more color bu ers, a depth/stencil bu er and the associated load/storeactions that are applied when the render target is active.
This data structure is similiar to RenderTargetSetup, but relies on a RenderTargetIdenti er to ensure
compatability with CommandBu er.SetRenderTarget.
To render to a speci c mip-level, cubemap face or depth slice the RenderTargetIdenti er should be created
accordingly.
Note: the number of load- and store-actions speci ed for color bu ers must be equal to the number of color
bu ers.
See Also: CommandBu er.

Properties
colorLoadActions

Load actions for color bu ers.

colorRenderTargets

Color bu ers to use as render targets.

colorStoreActions

Store actions for color bu ers.

depthLoadAction

Load action for the depth/stencil bu er.

depthRenderTarget

Depth/stencil bu er to use as render target.

depthStoreAction

Store action for the depth/stencil bu er.

Constructors
RenderTargetBinding

Constructs RenderTargetBinding.

Leave feedback

Description
Identi es a RenderTexture for a CommandBu er.
Render textures can be identi ed in a number of ways, for example a RenderTexture object, or one of built-in
render textures (BuiltinRenderTextureType), or a temporary render texture with a name (that was created using
CommandBu er.GetTemporaryRT).
This struct serves as a way to identify them, and has implcit conversion operators so that in most cases you can
save some typing.
See Also: CommandBu er.

Constructors
RenderTargetIdenti er

Creates a render target identi er.

Leave feedback

Description
Identi er of a speci c code path in a shader.
See Also: ShaderKeywordSet, Rendering.ShaderKeywordSetUtility, Shader.EnableKeyword, multiple variants.

Constructors
ShaderKeyword

Initializes a new instance of the ShaderKeyword class from a shader keyword name.

Public Methods
GetKeywordName

Returns the string name of the keyword.

GetKeywordType

Returns the keyword kind: built-in or user de ned.

IsValid

Returns true if the keyword has been imported by Unity.

Leave feedback

Description
A collection of ShaderKeyword that represents a speci c shader variant.
See Also: ShaderKeyword, Rendering.ShaderKeywordSetUtility, Shader.EnableKeyword, Shader.EnableKeyword,
multiple variants.

Public Methods
Disable

Disable a speci c shader keyword.

Enable

Enable a speci c shader keyword.

GetShaderKeywords

Return an array with all the enabled keywords in the ShaderKeywordSet.

IsEnabled

Check whether a speci c shader keyword is enabled.

Leave feedback

Description
Adding a SortingGroup component to a GameObject will ensure that all Renderers within the GameObject's
descendants will be sorted and rendered together.
A common use case for having a SortingGroup is to create complex 2D characters that are made up of multiple
SpriteRenderers. When several clones of such a character overlap, their individual body parts might not be sorted
properly resulting in a visual glitch where the the body parts interleave. For example, the hands of two characters
might be sorted in front of their bodies, where you would expect one entire character to be drawn in front of the
other character. The SortingGroup component solves this by ensuring the entire branch of the character are
sorted and rendered together.
The descendants of the SortingGroup are sorted using the same SortingLayer and Renderer.sortingOrder.
However, they are only sorted against other descendants of the SortingGroup and not with any renderers outside
of it. This allows you to reuse the same SortingLayers (for example, "Hands", "Torso"...) to sort body parts while
ensuring they never interleave with other clones of the character.
The SortingGroups, together with other renderers, are sorted using the SortingLayer and Renderer.sortingOrder.
Additionally, they can be nested within other SortingGroups. This is useful if you have branches of descendants
that should not be mixed up i.e. the "Left Hand" vs the "Right Hand" hierarchy branches.

.

Properties
sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Spherical harmonics up to the second order (3 bands, 9 coe cients).
Spherical harmonics (SH) represent a function or signal over directions, and are commonly used in computer
graphics to e ciently evaluate smooth lighting. Unity uses them for LightProbes and environment lighting.
L2 spherical harmonics is composed of 9 coe cients for each color channel.
See Also: RenderSettings.ambientMode, RenderSettings.ambientProbe, LightProbes.

Properties
this[int,int]

Access individual SH coe cients.

Public Methods
AddAmbientLight

Add ambient lighting to probe data.

AddDirectionalLight

Add directional light to probe data.

Clear

Clears SH probe to zero.

Evaluate

Evaluates the Spherical Harmonics for each of the given directions. The result from the
rst direction is written into the rst element of results, the result from the second
direction is written into the second element of results, and so on. The array size of
directions and results must match and directions must be normalized.

Operators
operator !=

Returns true if SH probes are di erent.

operator *

Scales SH by a given factor.

operator +

Adds two SH probes.

operator ==

Returns true if SH probes are equal.

Leave feedback

Description
Provides an interface to the Unity splash screen.

Static Properties
isFinished

Returns true once the splash screen as nished. This is once all logos have been shown
for their speci ed duration.

Static Methods
Begin

Initializes the splash screen so it is ready to begin drawing. Call this before you start
calling SplashScreen.Draw. Internally this function resets the timer and prepares the logos
for drawing.

Draw

Immediately draws the splash screen. Ensure you have called SplashScreen.Begin before
you start calling this.

Leave feedback

Description
Ambient lighting mode.
Unity can provide ambient lighting in several modes, for example directional ambient with separate sky, equator
and ground colors, or at ambient with a single color.
See Also: RenderSettings.ambientMode, Lighting Window.

Properties
Skybox

Skybox-based or custom ambient lighting.

Trilight

Trilight ambient lighting.

Flat

Flat ambient lighting.

Custom

Ambient lighting is de ned by a custom cubemap.

Leave feedback

Description
Blend mode for controlling the blending.
The blend mode is set separately for source and destination, and it controls the blend factor of each component
going into the blend equation. It is also possible to set the blend mode for color and alpha components
separately. Note: the blend modes are ignored if logical blend operations or advanced OpenGL blend operations
are in use.

Properties
Zero

Blend factor is (0, 0, 0, 0).

One

Blend factor is (1, 1, 1, 1).

DstColor

Blend factor is (Rd, Gd, Bd, Ad).

SrcColor

Blend factor is (Rs, Gs, Bs, As).

OneMinusDstColor

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

SrcAlpha

Blend factor is (As, As, As, As).

OneMinusSrcColor

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

DstAlpha

Blend factor is (Ad, Ad, Ad, Ad).

OneMinusDstAlpha

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

SrcAlphaSaturate

Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad).

OneMinusSrcAlpha

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Leave feedback

Description
Blend operation.
The blend operation that is used to combine the pixel shader output with the render target. This can be passed
through Material.SetInt() to change the blend operation during runtime.
Note that the logical operations are only supported in Gamma (non-sRGB) colorspace, on DX11.1 hardware
running on DirectX 11.1 runtime.
Advanced OpenGL blend operations are supported only on hardware supporting either
GL_KHR_blend_equation_advanced or GL_NV_blend_equation_advanced and may require use of
GL.RenderTargetBarrier. In addition, the shaders that are used with the advanced blend operations must have a
UNITY_REQUIRE_ADVANDED_BLEND(mode) declaration in the shader code where mode is one of the blend
operations or "all_equations" for supporting all advanced blend operations (see the
KHR_blend_equation_advanced spec for other values).

Properties
Add

Add (s + d).

Subtract

Subtract.

ReverseSubtract

Reverse subtract.

Min

Min.

Max

Max.

LogicalClear

Logical Clear (0).

LogicalSet

Logical SET (1) (D3D11.1 only).

LogicalCopy

Logical Copy (s) (D3D11.1 only).

LogicalCopyInverted

Logical inverted Copy (!s) (D3D11.1 only).

LogicalNoop

Logical No-op (d) (D3D11.1 only).

LogicalInvert

Logical Inverse (!d) (D3D11.1 only).

LogicalAnd

Logical AND (s & d) (D3D11.1 only).

LogicalNand

Logical NAND !(s & d). D3D11.1 only.

LogicalOr

Logical OR (s | d) (D3D11.1 only).

LogicalNor

Logical NOR !(s | d) (D3D11.1 only).

LogicalXor

Logical XOR (s XOR d) (D3D11.1 only).

LogicalEquivalence

Logical Equivalence !(s XOR d) (D3D11.1 only).

LogicalAndReverse

Logical reverse AND (s & !d) (D3D11.1 only).

LogicalAndInverted

Logical inverted AND (!s & d) (D3D11.1 only).

LogicalOrReverse

Logical reverse OR (s | !d) (D3D11.1 only).

LogicalOrInverted

Logical inverted OR (!s | d) (D3D11.1 only).

Multiply

Multiply (Advanced OpenGL blending).

Screen

Screen (Advanced OpenGL blending).

Overlay

Overlay (Advanced OpenGL blending).

Darken

Darken (Advanced OpenGL blending).

Lighten

Lighten (Advanced OpenGL blending).

ColorDodge

Color dodge (Advanced OpenGL blending).

ColorBurn

Color burn (Advanced OpenGL blending).

HardLight

Hard light (Advanced OpenGL blending).

SoftLight

Soft light (Advanced OpenGL blending).

Di erence

Di erence (Advanced OpenGL blending).

Exclusion

Exclusion (Advanced OpenGL blending).

HSLHue

HSL Hue (Advanced OpenGL blending).

HSLSaturation

HSL saturation (Advanced OpenGL blending).

HSLColor

HSL color (Advanced OpenGL blending).

HSLLuminosity

HSL luminosity (Advanced OpenGL blending).

Leave feedback

Description
Built-in temporary render textures produced during camera's rendering.
When camera is rendering the Scene, in some cases it can produce temporary render textures in the process (e.g.
depth textures, deferred G-bu er etc.). This enum indicates these temporary render textures.
BuiltinRenderTextureType can be used as a RenderTargetIdenti er in some functions of CommandBu er.
See Also: CommandBu er, RenderTargetIdenti er.

Properties
PropertyName

A globally set property name.

Bu erPtr

The raw RenderBu er pointer to be used.

RenderTexture

The given RenderTexture.

CurrentActive

Currently active render target.

CameraTarget

Target texture of currently rendering camera.

Depth

Camera's depth texture.

DepthNormals

Camera's depth+normals texture.

ResolvedDepth

Resolved depth bu er from deferred.

PrepassNormalsSpec

Deferred lighting (normals+specular) G-bu er.

PrepassLight

Deferred lighting light bu er.

PrepassLightSpec

Deferred lighting HDR specular light bu er (Xbox 360 only).

GBu er0

Deferred shading G-bu er #0 (typically di use color).

GBu er1

Deferred shading G-bu er #1 (typically specular + roughness).

GBu er2

Deferred shading G-bu er #2 (typically normals).

GBu er3

Deferred shading G-bu er #3 (typically emission/lighting).

Re ections

Re ections gathered from default re ection and re ections probes.

MotionVectors

Motion Vectors generated when the camera has motion vectors enabled.

GBu er4

Deferred shading G-bu er #4 (typically occlusion mask for static lights if any).

GBu er5

G-bu er #5 Available.

GBu er6

G-bu er #6 Available.

GBu er7

G-bu er #7 Available.

Leave feedback

Description
De nes set by editor when compiling shaders, depending on target platform and tier.
See Also: GraphicsSettings.HasShaderDe ne.

Properties
UNITY_NO_DXT5nm

UNITY_NO_DXT5nm is set when compiling shader for
platform that do not support DXT5NM, meaning that
normal maps will be encoded in RGB instead.

UNITY_NO_RGBM

UNITY_NO_RGBM is set when compiling shader for platform
that do not support RGBM, so dLDR will be used instead.

UNITY_ENABLE_REFLECTION_BUFFERS

UNITY_ENABLE_REFLECTION_BUFFERS is set when deferred
shading renders re ection probes in deferred mode. With
this option set re ections are rendered into a per-pixel
bu er. This is similar to the way lights are rendered into a
per-pixel bu er. UNITY_ENABLE_REFLECTION_BUFFERS is
on by default when using deferred shading, but you can
turn it o by setting “No support” for the Deferred
Re ections shader option in Graphics Settings. When the
setting is o , re ection probes are rendered per-object,
similar to the way forward rendering works.

UNITY_FRAMEBUFFER_FETCH_AVAILABLE

UNITY_FRAMEBUFFER_FETCH_AVAILABLE is set when
compiling shaders for platforms where framebu er fetch is
potentially available.

UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS

UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS enables use of
built-in shadow comparison samplers on OpenGL ES 2.0.

UNITY_METAL_SHADOWS_USE_POINT_FILTERING

UNITY_METAL_SHADOWS_USE_POINT_FILTERING is set if
shadow sampler should use point ltering on iOS Metal.

UNITY_NO_SCREENSPACE_SHADOWS

UNITY_NO_SCREENSPACE_SHADOWS is set when
screenspace cascaded shadow maps are disabled.

UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS

UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
is set when Semitransparent Shadows are enabled.

UNITY_PBS_USE_BRDF1

UNITY_PBS_USE_BRDF1 is set if Standard Shader BRDF1
should be used.

UNITY_PBS_USE_BRDF2

UNITY_PBS_USE_BRDF2 is set if Standard Shader BRDF2
should be used.

UNITY_PBS_USE_BRDF3

UNITY_PBS_USE_BRDF3 is set if Standard Shader BRDF3
should be used.

UNITY_NO_FULL_STANDARD_SHADER

UNITY_NO_FULL_STANDARD_SHADER is set if Standard
shader BRDF3 with extra simpli cations should be used.

UNITY_SPECCUBE_BOX_PROJECTION

UNITY_SPECCUBE_BLENDING is set if Re ection Probes Box
Projection is enabled.

UNITY_SPECCUBE_BLENDING

UNITY_SPECCUBE_BLENDING is set if Re ection Probes
Blending is enabled.

UNITY_ENABLE_DETAIL_NORMALMAP

UNITY_ENABLE_DETAIL_NORMALMAP is set if Detail Normal
Map should be sampled if assigned.

SHADER_API_MOBILE

SHADER_API_MOBILE is set when compiling shader for
mobile platforms.

SHADER_API_DESKTOP

SHADER_API_DESKTOP is set when compiling shader for
"desktop" platforms.

UNITY_HARDWARE_TIER1

UNITY_HARDWARE_TIER1 is set when compiling shaders for
GraphicsTier.Tier1.

UNITY_HARDWARE_TIER2

UNITY_HARDWARE_TIER2 is set when compiling shaders for
GraphicsTier.Tier2.

UNITY_HARDWARE_TIER3

UNITY_HARDWARE_TIER3 is set when compiling shaders for
GraphicsTier.Tier3.

UNITY_COLORSPACE_GAMMA

UNITY_COLORSPACE_GAMMA is set when compiling
shaders for Gamma Color Space.

UNITY_LIGHT_PROBE_PROXY_VOLUME

UNITY_LIGHT_PROBE_PROXY_VOLUME is set when Light
Probe Proxy Volume feature is supported by the current
graphics API and is enabled in the current Tier
Settings(Graphics Settings).

UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS

UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS is
set automatically for platforms that don't require full
oating-point precision support in fragment shaders.

UNITY_LIGHTMAP_DLDR_ENCODING

UNITY_LIGHTMAP_DLDR_ENCODING is set when lightmap
textures are using double LDR encoding to store the values
in the texture.

UNITY_LIGHTMAP_RGBM_ENCODING

UNITY_LIGHTMAP_RGBM_ENCODING is set when lightmap
textures are using RGBM encoding to store the values in the
texture.

UNITY_LIGHTMAP_FULL_HDR

UNITY_LIGHTMAP_FULL_HDR is set when lightmap textures
are not using any encoding to store the values in the
texture.

Leave feedback

Description
Built-in shader modes used by GraphicsSettings.
See Also: GraphicsSettings.SetShaderMode, BuiltinShaderType, Graphics Settings.

Properties
Disabled

Don't use any shader, e ectively disabling the functionality.

UseBuiltin

Use built-in shader (default).

UseCustom

Use custom shader instead of built-in one.

Leave feedback

Description
Built-in shader types used by GraphicsSettings.
See Also: GraphicsSettings.SetShaderMode, BuiltinShaderMode, Graphics Settings.

Properties
DeferredShading

Shader used for deferred shading calculations.

DeferredRe ections

Shader used for deferred re ection probes.

LegacyDeferredLighting

Shader used for legacy deferred lighting calculations.

ScreenSpaceShadows

Shader used for screen-space cascaded shadows.

DepthNormals

Shader used for depth and normals texture when enabled on a Camera.

MotionVectors

Shader used for Motion Vectors when enabled on a Camera.

LightHalo

Default shader used for light halos.

LensFlare

Default shader used for lens ares.

Leave feedback

Description
De nes a place in camera's rendering to attach CommandBu er objects to.
Unity's rendering loop can be extended by adding so called "command bu ers" at various points in camera
rendering. For example, you could add some custom geometry to be drawn right after the skybox is drawn.
See Also: CommandBu er, LightEvent, command bu ers overview.

Properties
BeforeDepthTexture

Before camera's depth texture is generated.

AfterDepthTexture

After camera's depth texture is generated.

BeforeDepthNormalsTexture

Before camera's depth+normals texture is generated.

AfterDepthNormalsTexture

After camera's depth+normals texture is generated.

BeforeGBu er

Before deferred rendering G-bu er is rendered.

AfterGBu er

After deferred rendering G-bu er is rendered.

BeforeLighting

Before lighting pass in deferred rendering.

AfterLighting

After lighting pass in deferred rendering.

BeforeFinalPass

Before nal geometry pass in deferred lighting.

AfterFinalPass

After nal geometry pass in deferred lighting.

BeforeForwardOpaque

Before opaque objects in forward rendering.

AfterForwardOpaque

After opaque objects in forward rendering.

BeforeImageE ectsOpaque

Before image e ects that happen between opaque & transparent objects.

AfterImageE ectsOpaque

After image e ects that happen between opaque & transparent objects.

BeforeSkybox

Before skybox is drawn.

AfterSkybox

After skybox is drawn.

BeforeForwardAlpha

Before transparent objects in forward rendering.

AfterForwardAlpha

After transparent objects in forward rendering.

BeforeImageE ects

Before image e ects.

AfterImageE ects

After image e ects.

AfterEverything

After camera has done rendering everything.

BeforeRe ections

Before re ections pass in deferred rendering.

AfterRe ections

After re ections pass in deferred rendering.

BeforeHaloAndLensFlares

Before halo and lens ares.

AfterHaloAndLensFlares

After halo and lens ares.

Leave feedback

Description
The HDR mode to use for rendering.
When HDR is enabled for the current Graphics Tier this selects the format to use for the HDR bu er.
See Also: TierSettings.hdr, Camera.allowHDR.

Properties
FP16

Uses RenderTextureFormat.ARGBHalf.

R11G11B10

Uses RenderTextureFormat.RGB111110Float.

Leave feedback

Description
Speci es which color components will get written into the target framebu er.

Properties
Alpha

Write alpha component.

Blue

Write blue component.

Green

Write green component.

Red

Write red component.

All

Write all components (R, G, B and Alpha).

Leave feedback

Description
Depth or stencil comparison function.

Properties
Disabled

Depth or stencil test is disabled.

Never

Never pass depth or stencil test.

Less

Pass depth or stencil test when new value is less than old one.

Equal

Pass depth or stencil test when values are equal.

LessEqual

Pass depth or stencil test when new value is less or equal than old one.

Greater

Pass depth or stencil test when new value is greater than old one.

NotEqual

Pass depth or stencil test when values are di erent.

GreaterEqual

Pass depth or stencil test when new value is greater or equal than old one.

Always

Always pass depth or stencil test.

Leave feedback

Description
Describes the desired characteristics with respect to prioritisation and load balancing of the queue that a
command bu er being submitted via Graphics.ExecuteCommandBu erAsync or
[[ScriptableRenderContext.ExecuteCommandBu erAsync] should be sent to.

Properties
Default

This queue type would be the choice for compute tasks supporting or as optimisations to
graphics processing. CommandBu ers sent to this queue would be expected to complete
within the scope of a single frame and likely be synchronised with the graphics queue via
GPUFence’s. Dispatches on default queue types would execute at a lower priority than
graphics queue tasks.

Background

Background queue types would be the choice for tasks intended to run for an extended
period of time, e.g for most of a frame or for several frames. Dispatches on background
queues would execute at a lower priority than gfx queue tasks.

Urgent

This queue type would be the choice for compute tasks requiring processing as soon as
possible and would be prioritised over the graphics queue.

Leave feedback

Description
Support for various Graphics.CopyTexture cases.
Most modern platforms and graphics APIs support quite exible texture copy (e.g. copy from a RenderTexture
into a Cubemap face). However some older systems might not support certain parts of texture copy functionality.
This enum indicates support for this. Use SystemInfo.copyTextureSupport to check for support before calling
Graphics.CopyTexture.
Direct3D11, DirectD12 and PS4 platforms generally support exible texture copy (all CopyTextureSupport ags
are set).
OpenGL supports exible texture copy since OpenGL 4.3; OpenGL ES supports exible texture copy since OpenGL
ES 3.1 aep; on earlier versions there's no copy support right now (CopyTextureSupport.None).
Direct3D9 systems have somewhat limited texture copy support (can't copy 3D textures, and can't copy between
textures and render textures).
Metal and WebGL currently do not have texture copy support (CopyTextureSupport.None).
See Also: Graphics.CopyTexture, SystemInfo.copyTextureSupport.

Properties
None

No support for Graphics.CopyTexture.

Basic

Basic Graphics.CopyTexture support.

Copy3D

Support for Texture3D in Graphics.CopyTexture.

Di erentTypes

Support for Graphics.CopyTexture between di erent texture types.

TextureToRT

Support for Texture to RenderTexture copies in Graphics.CopyTexture.

RTToTexture

Support for RenderTexture to Texture copies in Graphics.CopyTexture.

Leave feedback

Description
Backface culling mode.

Properties
O

Disable culling.

Front

Cull front-facing geometry.

Back

Cull back-facing geometry.

Leave feedback

Description
Default re ection mode.
Unity can use a custom texture or generate a specular re ection texture from the skybox.
See Also: RenderSettings.defaultRe ectionMode, Lighting Window.

Properties
Skybox

Skybox-based default re ection.

Custom

Custom default re ection.

Leave feedback

Description
Graphics device API type.
Many di erent low-level graphics APIs can be used by Unity. If for some reason you need to know whether
Direct3D 9 or 11 is being used, or OpenGL ES 2 or 3, you can use SystemInfo.graphicsDeviceType to check for
that.
See Also: SystemInfo.graphicsDeviceType.

Properties
Direct3D11

Direct3D 11 graphics API.

Null

No graphics API.

OpenGLES2

OpenGL ES 2.0 graphics API.

OpenGLES3

OpenGL ES 3.0 graphics API.

PlayStation4

PlayStation 4 graphics API.

XboxOne

Xbox One graphics API using Direct3D 11.

Metal

iOS Metal graphics API.

OpenGLCore

OpenGL (Core pro le - GL3 or later) graphics API.

Direct3D12

Direct3D 12 graphics API.

Vulkan

Vulkan (EXPERIMENTAL).

Switch

Nintendo Switch graphics API.

XboxOneD3D12

Xbox One graphics API using Direct3D 12.

Leave feedback

Description
Graphics Tier. See Also: Graphics.activeTier.

Properties
Tier1

The rst graphics tier (Low) - corresponds to shader de ne UNITY_HARDWARE_TIER1.

Tier2

The second graphics tier (Medium) - corresponds to shader de ne
UNITY_HARDWARE_TIER2.

Tier3

The third graphics tier (High) - corresponds to shader de ne UNITY_HARDWARE_TIER3.

Leave feedback

Description
Format of the mesh index bu er data.
Index bu er can either be 16 bit (supports up to 65535 vertices in a mesh), or 32 bit (supports up to 4 billion
vertices). Default index format is 16 bit, since that takes less memory and bandwidth.
Note that GPU support for 32 bit indices is not guaranteed on all platforms; for example Android devices with
Mali-400 GPU do not support them. When using 32 bit indices on such a platform, a warning message will be
logged and mesh will not render.
See Also: Mesh.indexFormat, ModelImporter.indexFormat.

Properties
UInt16

16 bit mesh index bu er format.

UInt32

32 bit mesh index bu er format.

Leave feedback

Description
De nes a place in light's rendering to attach CommandBu er objects to.
Unity's rendering loop can be extended by adding so called "command bu ers" at various points in light
rendering; mostly related to shadows. For example, you could do custom processing of the shadow map after it is
rendered.
See Also: CommandBu er, CameraEvent, command bu ers overview.

Properties
BeforeShadowMap

Before shadowmap is rendered.

AfterShadowMap

After shadowmap is rendered.

BeforeScreenspaceMask

Before directional light screenspace shadow mask is computed.

AfterScreenspaceMask

After directional light screenspace shadow mask is computed.

BeforeShadowMapPass

Before shadowmap pass is rendered.

AfterShadowMapPass

After shadowmap pass is rendered.

Leave feedback

Description
Light probe interpolation type.
See Also: Light Probes, Light Probe Proxy Volume.

Properties
O

Light Probes are not used. The Scene's ambient probe is provided to the shader.

BlendProbes

Simple light probe interpolation is used.

UseProxyVolume

Uses a 3D grid of interpolated light probes.

CustomProvided

The light probe shader uniform values are extracted from the material property block set
on the renderer.

Leave feedback

Description
Shadow resolution options for a Light.
See Also: Light.shadowResolution, QualitySettings.shadowResolution, Shadow map size calculation.

Properties
FromQualitySettings

Use resolution from QualitySettings (default).

Low

Low shadow map resolution.

Medium

Medium shadow map resolution.

High

High shadow map resolution.

VeryHigh

Very high shadow map resolution.

Leave feedback

Description
Opaque object sorting mode of a Camera.
Opaque objects are sorted by various criteria (sorting layers, shader queues, materials, distance, lightmaps etc.)
to maximize both the CPU e ciency (reduce number of state changes and improve draw call batching), and to
maximize GPU e ciency (many GPUs prefer rough front-to-back rendering order for faster rejection of invisible
surfaces).
By default, opaque objects are grouped in rough front-to-back buckets, on the GPUs where doing that is
bene cial. There are GPUs where doing this distance based sorting is not really helpful (most notably,
PowerVR/Apple GPUs), and so on these GPUs the distance based sorting is not done by default.
The Camera.opaqueSortMode property lets you override this default behavior. For example, you might want to
never do distance-based sorting for opaque objects, if you know you need much more CPU performance than
GPU performance.
See Also: Camera.opaqueSortMode.

Properties
Default

Default opaque sorting mode.

FrontToBack

Do rough front-to-back sorting of opaque objects.

NoDistanceSort

Do not sort opaque objects by distance.

Leave feedback

Description
Shader pass type for Unity's lighting pipeline.
This corresponds to "LightMode" tag in the shader pass, see Pass tags.

Properties
Normal

Regular shader pass that does not interact with lighting.

Vertex

Legacy vertex-lit shader pass.

VertexLM

Legacy vertex-lit shader pass, with mobile lightmaps.

ForwardBase

Forward rendering base pass.

ForwardAdd

Forward rendering additive pixel light pass.

LightPrePassBase

Legacy deferred lighting (light pre-pass) base pass.

LightPrePassFinal

Legacy deferred lighting (light pre-pass) nal pass.

ShadowCaster

Shadow caster & depth texure shader pass.

Deferred

Deferred Shading shader pass.

Meta

Shader pass used to generate the albedo and emissive values used as
input to lightmapping.

MotionVectors

Motion vector render pass.

ScriptableRenderPipeline

Custom scriptable pipeline.

ScriptableRenderPipelineDefaultUnlit

Custom scriptable pipeline when lightmode is set to default unlit or no
light mode is set.

Leave feedback

Description
How much CPU usage to assign to the nal lighting calculations at runtime.
How many CPU worker threads to create for Realtime Global Illumination lighting calculations in the Player.
Increasing this makes the system react faster to changes in lighting at a cost of using more CPU time. The higher
the CPU Usage value, the more worker threads are created for solving Realtime GI.
Please note that some platforms will allow all CPUs to be occupied by worker threads whilst some have a max
limit:
Xbox One: 4 CPU cores.
PS4: 4 CPU cores.
Android: If the device is a bigLittle architecture, only the little CPUs will be used, otherwise it is CPUs - 1.

Properties
Low

25% of the allowed CPU threads are used as worker threads.

Medium

50% of the allowed CPU threads are used as worker threads.

High

75% of the allowed CPU threads are used as worker threads.

Unlimited

100% of the allowed CPU threads are used as worker threads.

Leave feedback

Description
Determines how Unity will compress baked re ection cubemap.

Properties
Uncompressed

Baked Re ection cubemap will be left uncompressed.

Compressed

Baked Re ection cubemap will be compressed.

Auto

Baked Re ection cubemap will be compressed if compression format is suitable.

Leave feedback

Description
Values for Re ectionProbe.clearFlags, determining what to clear when rendering a Re ectionProbe.
See Also: re ection probe component.

Properties
Skybox

Clear with the skybox.

SolidColor

Clear with a background color.

Leave feedback

Description
Re ection probe's update mode.

Properties
Baked

Re ection probe is baked in the Editor.

Realtime

Re ection probe is updating in realtime.

Custom

Re ection probe uses a custom texture speci ed by the user.

Leave feedback

Description
An enum describing the way a realtime re ection probe refreshes in the Player.

Properties
OnAwake

Causes the probe to update only on the rst frame it becomes visible. The probe will no
longer update automatically, however you may subsequently use RenderProbe to refresh
the probeSee Also: Re ectionProbe.RenderProbe.

EveryFrame

Causes Unity to update the probe's cubemap every frame. Note that updating a probe is
very costly. Setting this option on too many probes could have a signi cant negative e ect
on frame rate. Use time-slicing to help improve performance.See Also:
Re ectionProbeTimeSlicingMode.

ViaScripting

Sets the probe to never be automatically updated by Unity while your game is running.
Use this to completely control the probe refresh behavior by script.See Also:
Re ectionProbe.RenderProbe.

Leave feedback

Description
When a probe's Re ectionProbe.refreshMode is set to Re ectionProbeRefreshMode.EveryFrame, this enum
specify whether or not Unity should update the probe's cubemap over several frames or update the whole
cubemap in one frame. Updating a probe's cubemap is a costly operation. Unity needs to render the entire Scene
for each face of the cubemap, as well as perform special blurring in order to get glossy re ections. The impact on
frame rate can be signi cant. Time-slicing helps maintaning a more constant frame rate during these updates by
performing the rendering over several frames.

Properties
AllFacesAtOnce

Instructs Unity to use time-slicing by rst rendering all faces at once, then spreading the
remaining work over the next 8 frames. Using this option, updating the probe will take 9
frames.

IndividualFaces

Instructs Unity to spread the rendering of each face over several frames. Using this
option, updating the cubemap will take 14 frames. This option greatly reduces the impact
on frame rate, however it may produce incorrect results, especially in Scenes where
lighting conditions change over these 14 frames.

NoTimeSlicing

Unity will render the probe entirely in one frame.

Leave feedback

Description
Re ection Probe usage.

Properties
O

Re ection probes are disabled, skybox will be used for re ection.

BlendProbes

Re ection probes are enabled. Blending occurs only between probes, useful in
indoor environments. The renderer will use default re ection if there are no
re ection probes nearby, but no blending between default re ection and probe will
occur.

BlendProbesAndSkybox

Re ection probes are enabled. Blending occurs between probes or probes and
default re ection, useful for outdoor environments.

Simple

Re ection probes are enabled, but no blending will occur between probes when
there are two overlapping volumes.

Leave feedback

Description
This enum describes what should be done on the render target when it is activated (loaded).
When the GPU starts rendering into a render target, this setting speci es the action that should be performed on
the existing contents of the surface. Tile-based GPUs may get performance advantage if the load action is Clear or
DontCare. The user should avoid using RenderBu erLoadAction.Load whenever possible.
Please note that not all platforms have load/store actions, so this setting might be ignored at runtime. Generally
mobile-oriented graphics APIs (OpenGL ES, Metal) take advantage of these settings.

Properties
Load

When this RenderBu er is activated, preserve the existing contents of it. This setting is
expensive on tile-based GPUs and should be avoided whenever possible.

Clear

Upon activating the render bu er, clear its contents. Currently only works together with
the RenderPass API.

DontCare

When this RenderBu er is activated, the GPU is instructed not to care about the existing
contents of that RenderBu er. On tile-based GPUs this means that the RenderBu er
contents do not need to be loaded into the tile memory, providing a performance boost.

Leave feedback

Description
This enum describes what should be done on the render target when the GPU is done rendering into it.
When the GPU is done rendering into a render target, this setting speci es the action that should be performed
on the rendering results. Tile-based GPUs may get performance advantage if the store action is DontCare. For
example, this setting can be useful if the depth bu er contents are not needed after rendering the frame.
Please note that not all platforms have load/store actions, so this setting might be ignored at runtime. Generally
mobile-oriented graphics APIs (OpenGL ES, Metal) take advantage of these settings.

Properties
Store

The RenderBu er contents need to be stored to RAM. If the surface has MSAA enabled,
this stores the non-resolved surface.

Resolve

Resolve the (MSAA'd) surface. Currently only used with the RenderPass API.

StoreAndResolve

Resolve the (MSAA'd) surface, but also store the multisampled version. Currently only
used with the RenderPass API.

DontCare

The contents of the RenderBu er are not needed and can be discarded. Tile-based GPUs
will skip writing out the surface contents altogether, providing performance boost.

Leave feedback

Description
Determine in which order objects are renderered.
This way for example transparent objects are rendered after opaque objects, and so on.
See Also: Material.renderQueue, Shader.renderQueue, subshader tags.

Properties
Background

This render queue is rendered before any others.

Geometry

Opaque geometry uses this queue.

AlphaTest

Alpha tested geometry uses this queue.

GeometryLast

Last render queue that is considered "opaque".

Transparent

This render queue is rendered after Geometry and AlphaTest, in back-to-front order.

Overlay

This render queue is meant for overlay e ects.

Leave feedback

Description
How shadows are cast from this object.
See Also: Renderer.shadowCastingMode.

Properties
O

No shadows are cast from this object.

On

Shadows are cast from this object.

TwoSided

Shadows are cast from this object, treating it as two-sided.

ShadowsOnly

Object casts shadows, but is otherwise invisible in the Scene.

Leave feedback

Description
Allows precise control over which shadow map passes to execute CommandBu er objects attached using
Light.AddCommandBu er.
These ags only take e ect when used with Rendering.LightEvent/BeforeShadowMapPass or
Rendering.LightEvent/AfterShadowMapPass.

Properties
PointlightPositiveX

+X point light shadow cubemap face.

PointlightNegativeX

-X point light shadow cubemap face.

PointlightPositiveY

+Y point light shadow cubemap face.

PointlightNegativeY

-Y point light shadow cubemap face.

PointlightPositiveZ

+Z point light shadow cubemap face.

PointlightNegativeZ

-Z point light shadow cubemap face.

DirectionalCascade0

First directional shadow map cascade.

DirectionalCascade1

Second directional shadow map cascade.

DirectionalCascade2

Third directional shadow map cascade.

DirectionalCascade3

Fourth directional shadow map cascade.

Spotlight

Spotlight shadow pass.

Pointlight

All point light shadow passes.

Directional

All directional shadow map passes.

All

All shadow map passes.

Leave feedback

Description
Used by CommandBu er.SetShadowSamplingMode.

Properties
CompareDepths

Default shadow sampling mode: sampling with a comparison lter.

RawDepth

Shadow sampling mode for sampling the depth value.

None

In ShadowSamplingMode.None, depths are not compared. Use this value if a Texture is
not a shadowmap.

Leave feedback

Description
Speci es the operation that's performed on the stencil bu er when rendering.

Properties
Keep

Keeps the current stencil value.

Zero

Sets the stencil bu er value to zero.

Replace

Replace the stencil bu er value with reference value (speci ed in the shader).

IncrementSaturate

Increments the current stencil bu er value. Clamps to the maximum representable
unsigned value.

DecrementSaturate

Decrements the current stencil bu er value. Clamps to 0.

Invert

Bitwise inverts the current stencil bu er value.

IncrementWrap

Increments the current stencil bu er value. Wraps stencil bu er value to zero when
incrementing the maximum representable unsigned value.

DecrementWrap

Decrements the current stencil bu er value. Wraps stencil bu er value to the maximum
representable unsigned value when decrementing a stencil bu er value of zero.

Leave feedback

Description
Broadly describes the stages of processing a draw call on the GPU.
Used to insert a GPU Fence after or wait for a particular phase of the draw call processing to complete.

Properties
VertexProcessing

All aspects of vertex processing.

PixelProcessing

The process of creating and shading the fragments.

Leave feedback

Description
Texture "dimension" (type).
Indicates type of a texture (2D texture, cubemap, 3D volume texture etc.).
See Also: Texture.dimension, MaterialProperty.textureDimension.

Properties
Unknown

Texture type is not initialized or unknown.

None

No texture is assigned.

Any

Any texture type.

Tex2D

2D texture (Texture2D).

Tex3D

3D volume texture (Texture3D).

Cube

Cubemap texture.

Tex2DArray

2D array texture (Texture2DArray).

CubeArray

Cubemap array texture (CubemapArray).

Leave feedback

Description
A ag representing each UV channel.

Properties
UV0

First UV channel.

UV1

Second UV channel.

UV2

Third UV channel.

UV3

Fourth UV channel.

Leave feedback

Description
Run-time data structure for *.unity le.

Properties
buildIndex

Return the index of the Scene in the Build Settings.

isDirty

Returns true if the Scene is modifed.

isLoaded

Returns true if the Scene is loaded.

name

Returns the name of the Scene.

path

Returns the relative path of the Scene. Like: "Assets/MyScenes/MyScene.unity".

rootCount

The number of root transforms of this Scene.

Public Methods
GetRootGameObjects

Returns all the root game objects in the Scene.

IsValid

Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open
a Scene that does not exist. In this case, the Scene returned from
EditorSceneManager.OpenScene would return False for IsValid.

Operators
operator !=

Returns true if the Scenes are di erent.

operator ==

Returns true if the Scenes are equal.

Leave feedback

Description
Scene management at run-time.

Static Properties
sceneCount

The total number of currently loaded Scenes.

sceneCountInBuildSettings

Number of Scenes in Build Settings.

Static Methods
CreateScene

Create an empty new Scene at runtime with the given name.

GetActiveScene

Gets the currently active Scene.

GetSceneAt

Get the Scene at index in the SceneManager's list of loaded Scenes.

GetSceneByBuildIndex

Get a Scene struct from a build index.

GetSceneByName

Searches through the Scenes loaded for a Scene with the given name.

GetSceneByPath

Searches all Scenes loaded for a Scene that has the given asset path.

LoadScene

Loads the Scene by its name or index in Build Settings.

LoadSceneAsync

Loads the Scene asynchronously in the background.

MergeScenes

This will merge the source Scene into the destinationScene.

MoveGameObjectToScene

Move a GameObject from its current Scene to a new Scene.

SetActiveScene

Set the Scene to be active.

UnloadSceneAsync

Destroys all GameObjects associated with the given Scene and removes the
Scene from the SceneManager.

Events
activeSceneChanged

Subscribe to this event to get noti ed when the active Scene has changed.

sceneLoaded

Add a delegate to this to get noti cations when a Scene has loaded.

sceneUnloaded

Add a delegate to this to get noti cations when a Scene has unloaded.

Leave feedback

Description
Scene and Build Settings related utilities.

Static Methods
GetBuildIndexByScenePath

Get the build index from a Scene path.

GetScenePathByBuildIndex

Get the Scene path from a build index.

Leave feedback

Description
Used when loading a Scene in a player.
Use LoadSceneMode to choose what type of Scene loads when using SceneManager.LoadScene. The available
modes are Single and Additive.
Single mode loads a standard Unity Scene which then appears on its own in the Hierarchy window. Additive loads
a Scene which appears in the Hierarchy window while another is active.

using UnityEngine;
using UnityEngine.SceneManagement;

public class Example : MonoBehaviour
{
void OnGUI()
{
//This displays a Button on the screen at position (20,30), width 150 an
if (GUI.Button(new Rect(20, 30, 150, 30), "Other Scene Single"))
{
//The SceneManager loads your new Scene as a single Scene (not overl
SceneManager.LoadScene("YourScene", LoadSceneMode.Single);
}

//Whereas pressing this Button loads the Additive Scene.
if (GUI.Button(new Rect(20, 60, 150, 30), "Other Scene Additive"))
{
//SceneManager loads your new Scene as an extra Scene (overlapping t
SceneManager.LoadScene("YourScene", LoadSceneMode.Additive);
}
}
}

Properties
Single

Closes all current loaded Scenes and loads a Scene.

Additive

Adds the Scene to the current loaded Scenes.

Leave feedback

Description
PreserveAttribute prevents byte code stripping from removing a class, method, eld, or property.
When you create a build, Unity will try to strip unused code from your project. This is great to get small builds.
However, sometimes you want some code to not be stripped, even if it looks like it is not used. This can happen
for instance if you use re ection to call a method, or instantiate an object of a certain class. You can apply the
[Preserve] attribute to classes, methods, elds and properties. In addition to using PreserveAttribute, you can also
use the traditional method of a link.xml le to tell the linker to not remove things. PreserveAttribute and link.xml
work for both the Mono and IL2CPP scripting backends.

using
using
using
using

UnityEngine;
System.Collections;
System.Reflection;
UnityEngine.Scripting;

public class NewBehaviourScript : MonoBehaviour
{
void Start()
{
ReflectionExample.InvokeBoinkByReflection();
}
}

public class ReflectionExample
{
static public void InvokeBoinkByReflection()
{
typeof(ReflectionExample).GetMethod("Boink", BindingFlags.NonPublic | Bi
}

// No other code directly references the Boink method, so when when strippin
// it will be removed unless the [Preserve] attribute is applied.
[Preserve]
static void Boink()
{
Debug.Log("Boink");
}
}

For 3rd party libraries that do not want to take on a dependency on UnityEngine.dll, it is also possible to de ne
their own PreserveAttribute. The code stripper will respect that too, and it will consider any attribute with the
exact name "PreserveAtribute" as a reason not to strip the thing it is applied on, regardless of the namespace or
assembly of the attribute.

Leave feedback

Description
Use this attribute to rename a eld without losing its serialized value.
Suppose you have a class like this:

using UnityEngine;

public class MyClass : MonoBehaviour
{
public string myValue;
}

And you would like to create a property to encapsulate myValue without losing any data already assigned to
instances of MyClass. You can achieve that by using this attribute:

using UnityEngine;
using UnityEngine.Serialization;

public class MyClass : MonoBehaviour
{
[FormerlySerializedAs("myValue")]
string m_MyValue;
public string myValue
{
get { return m_MyValue; }
set { m_MyValue = value; }
}
}

Properties
oldName

The name of the eld before the rename.

Constructors

FormerlySerializedAsAttribute

Leave feedback
Implements interfaces:ISocialPlatform

Description
iOS GameCenter implementation for network services.
An application bundle ID must be registered on iTunes Connect before it can access GameCenter. This ID must be
properly set in the iOS player properties in Unity. When debugging you can use the GameCenter sandbox (a text
displaying this is shown when logging on). You must log on in the application to get into sandbox mode, logging
on in the GameCenter application will always use the production version.
When using the GameCenterPlatform class in C# you need to include the
UnityEngine.SocialPlatforms.GameCenter namespace.
Some things to be aware of when using the generic API:
Authenticate()
If the user is not logged in, a standard GameKit UI is shown where they can log on or create a new user. It is
recommended this is done as early as possible.
Achievement descriptions and Leaderboards
The achivements descriptions and leaderboard con gurations can be con gured in the iTunes Connect portal.
Achievements get unique identi ers and the leaderboards use category names as identi ers.
GameCenter Sandbox
Development applications use the GameCenter Sandbox. This is a seperate GameCenter than the live one,
nothing is shared between them. It is recommended that you create a seperate user for testing with the
GameCenter Sandbox, you should not use your real Apple ID for this. You can only log on to the sandbox through
a development application, make sure you are not logged into GameCenter using the GameCenter app before
testing begins. You should see *** Sandbox *** in the login dialog, if you don't see this then you are logging on to
the real one. Sometimes it happens that the OS forgets that the application is using the sandbox and you will be
logged on to the real one. If the application has not been submitted to Apple already then this will probably result
in an error. To x this all that needs to be done is to delete the app and redeploy with Xcode. To make another
Apple ID a friend of a sandbox user it needs to be a sandbox user as well.
If you start getting errors when accessing GameCenter stating that the application is not recognized you'll need to
delete the application completely and re-deploy. Make sure you are not logged on when starting the newly
installed application again.

Public Methods
ShowLeaderboardUI

Show the leaderboard UI with a speci c leaderboard shown initially with a speci c time
scope selected.

Static Methods
ResetAllAchievements

Reset all the achievements for the local user.

ShowDefaultAchievementCompletionBanner

Show the default iOS banner when achievements are
completed.

Leave feedback

Description
The score range a leaderboard query should include.

Properties
count

The total amount of scores retreived.

from

The rank of the rst score which is returned.

Constructors
Range

Constructor for a score range, the range starts from a speci c value and contains a
maxium score count.

Leave feedback

Description
Information for a user's achievement.
This de nes the relation between a particular achievement (described by IAchievementDescription) and the local
user, what progress they have, last date they reported progress and so on.
Use Social.CreateAchievement to create an instance of this object.

Properties
completed

Set to true when percentCompleted is 100.0.

hidden

This achievement is currently hidden from the user.

id

The unique identi er of this achievement.

lastReportedDate

Set by server when percentCompleted is updated.

percentCompleted

Progress for this achievement.

Public Methods
ReportProgress

Send noti cation about progress on this achievement.

Leave feedback

Description
Static data describing an achievement.
Retreive the achievement descriptions by using Social.LoadAchievementDescriptions. GameCenter: These are
stored server side and should be fetched when the user has authenticated. These are set in the iTunes Connect.

Properties
achievedDescription

Description when the achivement is completed.

hidden

Hidden achievement are not shown in the list until the percentCompleted has been
touched (even if it's 0.0).

id

Unique identi er for this achievement description.

image

Image representation of the achievement.

points

Point value of this achievement.

title

Human readable title.

unachievedDescription

Description when the achivement has not been completed.

Leave feedback

Description
The leaderboard contains the scores of all players for a particular game.
Each game can have multiple leaderboards with di erent scores. A leaderboard object can be customized to
perform a particular query. The leaderboard ID de nes which leaderboard is being queried and there are lters
to narrow down the results, UserScope, TimeScope, Range and SetUserFilter. Use Social.CreateLeaderboard to
create an instance of this object.

Properties
id

Unique identi er for this leaderboard.

loading

The leaderboad is in the process of loading scores.

localUserScore

The leaderboard score of the logged in user.

maxRange

The total amount of scores the leaderboard contains.

range

The rank range this leaderboard returns.

scores

The leaderboard scores returned by a query.

timeScope

The time period/scope searched by this leaderboard.

title

The human readable title of this leaderboard.

userScope

The users scope searched by this leaderboard.

Public Methods
LoadScores

Load scores according to the lters set on this leaderboard.

SetUserFilter

Only search for these user IDs.

Leave feedback
Implements interfaces:IUserPro le

Description
Represents the local or currently logged in user.

Properties
authenticated

Checks if the current user has been authenticated.

friends

The users friends list.

underage

Is the user underage?

Public Methods
Authenticate

Authenticate the local user to the current active Social API implementation and fetch his
pro le data.

LoadFriends

Fetches the friends list of the logged in user. The friends list on the Social.localUser
instance is populated if this call succeeds.

Leave feedback

Description
A game score.
It can be received from a ILeaderboard instance or using the Social.LoadScores call which uses the default
leaderboard lters.

Properties
date

The date the score was achieved.

formattedValue

The correctly formatted value of the score, like X points or X kills.

leaderboardID

The ID of the leaderboard this score belongs to.

rank

The rank or position of the score in the leaderboard.

userID

The user who owns this score.

value

The score value achieved.

Public Methods
ReportScore

Report this score instance.

Leave feedback

Description
The generic Social API interface which implementations must inherit.
See Social for details on usage.

Properties
localUser

See Social.localUser.

Public Methods
CreateAchievement

See Social.CreateAchievement.

CreateLeaderboard

See Social.CreateLeaderboard.

LoadAchievementDescriptions

See Social.LoadAchievementDescriptions.

LoadAchievements

See Social.LoadAchievements.

LoadScores

See Social.LoadScores.

LoadUsers

See Social.LoadUsers.

ReportProgress

See Social.ReportProgress.

ReportScore

See Social.ReportScore.

ShowAchievementsUI

See Social.ShowAchievementsUI.

ShowLeaderboardUI

See Social.ShowLeaderboardUI.

Leave feedback

Description
Represents generic user instances, like friends of the local user.

Properties
id

This users unique identi er.

image

Avatar image of the user.

isFriend

Is this user a friend of the current logged in user?

state

Presence state of the user.

userName

This user's username or alias.

Leave feedback

Description
The scope of time searched through when querying the leaderboard.

Leave feedback

Description
The scope of the users searched through when querying the leaderboard.

Leave feedback

Description
User presence state.

Properties
Online

The user is online.

OnlineAndAway

The user is online but away from their computer.

OnlineAndBusy

The user is online but set their status to busy.

O ine

The user is o ine.

Playing

The user is playing a game.

Leave feedback

Description
The PoseDataSource class acts as a container for the GetDatafromSource method call that should be used by
PoseProviders wanting to query data for a particular pose.

Static Methods
TryGetDataFromSource

The GetDatafromSource method is used to query data from the XRNode subsystem
based on the provided pose source.

Leave feedback

Description
The TrackedPoseDriver component applies the current Pose value of a tracked device to the transform of the
GameObject.
TrackedPoseDriver can track multiple types of devices including XR HMDs, controllers, and remotes.

Properties
deviceType

The device being tracked by the tracked pose driver

poseProviderComponent

Optional: This eld holds the reference to the PoseProvider instance that, if set,
will be used to override the behavior of the TrackedPoseDriver. When this eld is
empty, the TrackedPoseDriver will operate as per usual, with pose data being
retrieved from the device or pose settings of the TrackedPoseDriver. When this
eld is set, the pose data will be provided by the attached PoseProvider. The
device or pose elds will be hidden as they are no longer used to control the
parent GameObject Transform.

poseSource

The pose being tracked by the tracked pose driver

trackingType

The tracking type being used by the tracked pose driver

updateType

The update type being used by the tracked pose driver

UseRelativeTransform

This is used to indicate whether the TrackedPoseDriver will use the object's
original transform as its basis.

Public Methods
SetPoseSource

This method is used to set the device / pose pair for the
SpatialTracking.TrackedPoseDriver. setting an invalid combination of these values will
return false.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the

MasterServer.
OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render

image.
OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
This is used to indicate which pose the TrackedPoseDriver is currently tracking.

Properties
GenericXRDevice

An Generic XR Devices, use this value for HMD and AR Mobile device tracking

GenericXRController

An XR Controller, use this value for controllers

GenericXRRemote

An XR Remote, use this value for mobile remotes

Leave feedback

Description
This is used to indicate which pose the Tracked Pose Driver is currently tracking

Properties
LeftEye

The left eye of a HMD style device

RightEye

The right eye of a HMD style device

Center

The center eye of a HMD style device, this is usually the default for most HMDs

Head

The head eye of a HMD style device

LeftPose

The left hand controller pose

RightPose

The right hand contoller pose

ColorCamera

The color camera of a mobile device

Leave feedback

Description
This enum is used to indiciate which parts of the pose will be applied to the parent transform

Properties
RotationAndPosition

With this setting, both the pose's rotation and position will be applied to the parent
transform

RotationOnly

With this setting, only the pose's rotation will be applied to the parent transform

PositionOnly

With this setting, only the pose's position will be applied to the parent transform

Leave feedback

Description
This is used to indicate what points in the frame the tracked pose driver will sample input

Properties
UpdateAndBeforeRender

Sample input at both update, and directly before rendering. For smooth head
pose tracking, we recommend using this value as it will provide the lowest input
latency for the device. This is the default value for the UpdateType option

Update

Only sample input during the update phase of the frame.

BeforeRender

Only sample input directly before rendering

Leave feedback

Description
Helper utilities for accessing Sprite data.

Static Methods
GetInnerUV

Inner UV's of the Sprite.

GetMinSize

Minimum width and height of the Sprite.

GetOuterUV

Outer UV's of the Sprite.

GetPadding

Return the padding on the sprite.

Leave feedback

Description
Compares two Color objects for equality within the given tolerance.
Use this class to compare two Color objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. Use the ColorEqualityComparer.Instance
comparer to use the default error 0.01f. For any other error, use the one argument constructor to create a
comparer.
It uses Utils.AreFloatsEqualAbsoluteError to compare the r, g, b, a attributes of Color.

Static Properties
Instance

A comparer instance with default error 0.01f.

Constructors
ColorEqualityComparer

Creates an instance with a custom error value.

Public Methods
Equals

Compares the actual and expected Color objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Color objects.

Leave feedback

Description
Float value comparer to work with NUnit constraints.
Use this class to compare two oat values for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer< oat> interface. Use FloatEqualityComparer.Instance comparer to
use default error 0.0001f. For any other error, use the one argument constructor to create a comparer.
It uses Utils.AreFloatsEqual to compare the oat values, which is a relative epsilon comparison.

Static Properties
Instance

A comparer instance with default error 0.0001f.

Constructors
FloatEqualityComparer

Create an instance with a custom error value.

Public Methods
Equals

Compare the actual and expected oat values for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal oat values.

Leave feedback

Description
Utility to compare two Quaternion objects for equality with NUnit assertion constraints.
It implements the System.Collections.Generic.IEqualityComparer interface. Use the static instance
QuaternionEqualityComparer.Instance to compare with default error 0.00001f. For any custom error value, use
the one argument constructor.

Static Properties
Instance

A comparer instance with default error 0.00001f.

Constructors
QuaternionEqualityComparer

Creates an instance with a custom error value.

Public Methods
Equals

Compares the actual and expected Quaternion objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Quaternion
objects.

Leave feedback

Description
Contains utility functions like comparing oat values.

Static Methods
AreFloatsEqual

Relative epsilon comparison of two oat values for equality.

AreFloatsEqualAbsoluteError

Compares two oat values for equality.

CreatePrimitive

Creates a GameObject with a primitive mesh renderer.

Leave feedback

Description
Compares two Vector2 objects for equality using overloaded == operator.
Use this class to compare two Vector2 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. It uses the overloaded operator== of Vector2 to
compare two Vector2 objects.

Static Properties
Instance

A comparer instance to be used with NUnit constrants.

Public Methods
Equals

Compares the actual and expected Vector2 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector2 objects.

Leave feedback

Description
Compares two Vector2 objects for equality within given tolerance.
Use this class to compare two Vector2 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. Use Vector2EqualityComparer.Instance
comparer to use default error 0.0001f. For any other error, use the one argument constructor to create a
comparer.
It uses Utils.AreFloatsEqual to compare the x and y attributes of Vector2.

Static Properties
Instance

A comparer instance with default error 0.0001f.

Constructors
Vector2EqualityComparer

Creates an instance with a custom error value.

Public Methods
Equals

Compares the actual and expected Vector2 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector2 objects.

Leave feedback

Description
Compare two Vector3 objects for equality using overloaded == operator.
Use this class to compare two Vector3 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. It uses the overloaded operator== of Vector3 to
compare two Vector3 objects.

Static Properties
Instance

A comparer instance to be used with NUnit constrants.

Public Methods
Equals

Compare the actual and expected Vector3 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector3 objects.

Leave feedback

Description
Compares two Vector3 objects for equality within given tolerance.
Use this class to compare two Vector3 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. Use Vector3EqualityComparer.Instance
comparer to use default error 0.0001f. For any other error, use the one argument constructor to create a
comparer.
It uses Utils.AreFloatsEqual to compare the x, y and z attributes of Vector3.

Static Properties
Instance

A comparer instance with default error 0.0001f.

Constructors
Vector3EqualityComparer

Creates an instance with a custom error value.

Public Methods
Equals

Compares the actual and expected Vector3 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector3 objects.

Leave feedback

Description
Compares two Vector4 objects for equality using overloaded == operator.
Use this class to compare two Vector4 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. It uses the overloaded operator== of Vector4 to
compare two Vector4 objects.

Static Properties
Instance

A comparer instance to be used with NUnit constrants.

Public Methods
Equals

Compares the actual and expected Vector4 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector4 objects.

Leave feedback

Description
Compares two Vector4 objects for equality within given tolerance.
Use this class to compare two Vector4 objects for equality, with NUnit constraints. It implements the
System.Collections.Generic.IEqualityComparer interface. Use Vector4EqualityComparer.Instance
comparer to use default error 0.0001f. For any other error, use the one argument constructor to create a
comparer.
It uses Utils.AreFloatsEqual to compare the x, y, z and w attributes of Vector4.

Static Properties
Instance

A comparer instance with default error 0.0001f.

Constructors
Vector4EqualityComparer

Creates an instance with a custom error value.

Public Methods
Equals

Compares the actual and expected Vector4 objects for equality.

GetHashCode

Hash code implementation which returns same hash code for all equal Vector4 objects.

Leave feedback

Description
LogAssert allows you to expect Unity log messages that would normally cause the test to fail.

Static Properties
ignoreFailingMessages

Set this property to true to prevent unexpected error log messages from triggering
an assertion. This property is set to false by default.

Static Methods
Expect

Expect a log message of a spec c type. If an error, assertion or exception log is
expected, the test will not fail. The test will fail if a log message is expected but does
not appear.

NoUnexpectedReceived

Triggers an assert if any logs have been received that were not expected. Returns
without asserting if all logs received so far have been registered as expected.

Leave feedback

Description
Wrapper for running tests that are imlpemented as MonoBehaviours.

Properties
component

The test component attached this object.

gameObject

The GameObject that hold test component.

Inherited Members
Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
A MonoBehaviour test needs to implement this interface.

Properties
IsTestFinished

Indicates when the test is considered nished.

Leave feedback

Description
Interface for the method that implements the postbuild step.

Public Methods
Cleanup

Cleanup method that is automatically called after all the test have run.

Leave feedback

Description
Interface for the method that implements the prebuild step.

Public Methods
Setup

Setup method that is automatically called before the test run.

Leave feedback

Description
Platforms the tests can run on.

Leave feedback

Description
Allows you to de ne a cleanup method for the test that is invoked after all tests are run.

Constructors
PostBuildCleanupAttribute

Points to a class that implements TestTools.IPostbuildCleanup. The method from
TestTools.IPostbuildCleanup is executed after all tests are run.

Leave feedback

Description
Allows to de ne a setup method for the test that will be invoked before the test run is started.

Constructors
PrebuildSetupAttribute

Points to a class that implements IPrebuildSetup. The method from IPrebuildSetup
is executed before the test run is initiated.

Leave feedback

Description
For specifying platforms to run on.
Implement this class to specify which platforms should be tested. Use the RuntimePlatform enumeration to
specify the platforms, along with the include or exclude properties of lists to set whether a test should apply to
the platforms. You can also specify which platforms should be tested by passing one or more RuntimePlatform
values as parameters to the PlatformAttribute constructor. All platforms are tested if nothing is speci ed using
RuntimePlatform, include or exclude. No tests are excluded if the include property is not null. See Also:
RuntimePlatform , include , exclude .

using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;

[TestFixture]
public class TestClass
{
[Test]
[UnityPlatform(RuntimePlatform.WindowsPlayer)]
public void TestMethod()
{
Assert.AreEqual(Application.platform, RuntimePlatform.WindowsPlayer);
}
}

Properties
exclude

Excluded platforms.

include

Included platforms.

Leave feedback

Description
Special type of a SetUp that allows to yield before the test is running.

Leave feedback

Description
Special type of a TearDown that allows to yield after the test is running.

Leave feedback

Description
Special type of a unit test that allows to yield from test in order to skip frames when the test is running.

Leave feedback

Description
Class passed onto tiles when information is queried from the tiles.
This handles editor preview tiles when painting on a Tilemap in Editor mode.

Properties
cellBounds

Returns the boundaries of the Tilemap in cell size.

localBounds

Returns the boundaries of the Tilemap in local space size.

origin

The origin of the Tilemap in cell position.

size

The size of the Tilemap in cells.

Public Methods
GetColor

Gets the color of a tile given the XYZ coordinates of a cell in the tile map.

GetComponent

Returns the component of type T if the GameObject of the tile map has one attached,
null if it doesn't.

GetSprite

Gets the Sprite used in a tile given the XYZ coordinates of a cell in the tile map.

GetTile

Gets the tile at the given XYZ coordinates of a cell in the tile map.

GetTileFlags

Gets the TileFlags of the Tile at the given position.

GetTransformMatrix

Gets the transform matrix of a tile given the XYZ coordinates of a cell in the tile map.

RefreshTile

Refreshes a tile at the given XYZ coordinates of a cell in the tile map.

Leave feedback

Description
Class for a default tile in the Tilemap.
This inherits from TileBase and represents a default tile to be placed in a Tilemap. It implements
TileBase.GetTileData for simple rendering of a Sprite in the tile map.

Properties
color
ags

Color of the Tile.
TileFlags of the Tile.

gameObject

GameObject of the Tile.

sprite

Sprite to be rendered at the Tile.

transform

Transform matrix of the Tile.

Public Methods
GetTileData

Retrieves the tile rendering data for the Tile.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetTileAnimationData

Retrieves any tile animation data from the scripted tile.

RefreshTile

This method is called when the tile is refreshed.

StartUp

StartUp is called on the rst frame of the running Scene.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Enum for determining what collider shape is generated for this Tile by the TilemapCollider2D.

Properties
None

No collider shape is generated for the Tile by the TilemapCollider2D.

Sprite

The Sprite outline is used as the collider shape for the Tile by the TilemapCollider2D.

Grid

The grid layout boundary outline is used as the collider shape for the Tile by the
TilemapCollider2D.

Leave feedback

Description
A Struct for the required data for animating a Tile.

Properties
animatedSprites

The array of sprites that are ordered by appearance in the animation.

animationSpeed

The animation speed.

animationStartTime

The start time of the animation. The animation will begin at this time o set.

Leave feedback

Description
Base class for a tile in the Tilemap.
Inherit from this to implement your custom tile to be placed in a Tilemap component.

Public Methods
GetTileAnimationData

Retrieves any tile animation data from the scripted tile.

GetTileData

Retrieves any tile rendering data from the scripted tile.

RefreshTile

This method is called when the tile is refreshed.

StartUp

StartUp is called on the rst frame of the running Scene.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
A Struct for the required data for rendering a Tile.

Properties
color
ags

Color of the Tile.
TileFlags of the Tile.

gameObject

GameObject of the Tile.

sprite

Sprite to be rendered at the Tile.

transform

Transform matrix of the Tile.

Leave feedback

Description
The tile map stores sprites in a layout marked by a Grid component.

Properties
animationFrameRate

The frame rate for all tile animations in the tile map.

cellBounds

Returns the boundaries of the Tilemap in cell size.

color

The color of the tile map layer.

editorPreviewOrigin

The origin of the Tilemap in cell position inclusive of editor preview tiles.

editorPreviewSize

The size of the Tilemap in cells inclusive of editor preview tiles.

layoutGrid

Gets the Grid associated with this tile map.

localBounds

Returns the boundaries of the Tilemap in local space size.

orientation

Orientation of the tiles in the Tilemap.

orientationMatrix

Orientation Matrix of the orientation of the tiles in the Tilemap.

origin

The origin of the Tilemap in cell position.

size

The size of the Tilemap in cells.

tileAnchor

Gets the anchor point of tiles in the Tilemap.

Public Methods
AddTileFlags

Adds the TileFlags onto the Tile at the given position.

BoxFill

Does a box ll with the given tile on the tile map. Starts from given
coordinates and lls the limits from start to end (inclusive).

ClearAllEditorPreviewTiles

Clears all editor preview tiles that are placed in the Tilemap.

ClearAllTiles

Clears all tiles that are placed in the Tilemap.

CompressBounds

Compresses the origin and size of the Tilemap to bounds where tiles
exist.

ContainsTile

Returns true if the Tilemap contains the given tile. Returns false if not.

EditorPreviewBoxFill

Does an editor preview of a box ll with the given tile on the tile map.
Starts from given coordinates and lls the limits from start to end

(inclusive).
EditorPreviewFloodFill

Does an editor preview of a ood ll with the given tile to place. on the
tile map starting from the given coordinates.

FloodFill

Does a ood ll with the given tile to place. on the tile map starting from
the given coordinates.

GetCellCenterLocal

Get the logical center coordinate of a grid cell in local space.

GetCellCenterWorld

Get the logical center coordinate of a grid cell in world space.

GetColliderType

Gets the collider type of a tile given the XYZ coordinates of a cell in the
tile map.

GetColor

Gets the color of a tile given the XYZ coordinates of a cell in the tile map.

GetEditorPreviewColor

Gets the Color of an editor preview tile given the XYZ coordinates of a cell
in the tile map.

GetEditorPreviewSprite

Gets the Sprite used in an editor preview tile given the XYZ coordinates of
a cell in the tile map.

GetEditorPreviewTile

Gets the editor preview tile at the given XYZ coordinates of a cell in the
tile map.

GetEditorPreviewTileFlags

Gets the TileFlags of the editor preview Tile at the given position.

GetEditorPreviewTransformMatrix

Gets the transform matrix of an editor preview tile given the XYZ
coordinates of a cell in the tile map.

GetInstantiatedObject

Gets the GameObject instantiated by a tile given the XYZ coordinates of a
cell in the tile map.

GetSprite

Gets the Sprite used in a tile given the XYZ coordinates of a cell in the tile
map.

GetTile

Gets the tile at the given XYZ coordinates of a cell in the tile map.

GetTileFlags

Gets the TileFlags of the Tile at the given position.

GetTilesBlock

Retrieves an array of tiles with the given bounds.

GetTransformMatrix

Gets the transform matrix of a tile given the XYZ coordinates of a cell in
the tile map.

GetUsedTilesCount

Get the total number of di erent tiles used in the Tilemap.

GetUsedTilesNonAlloc

Fills the given array with the total number of di erent tiles used in the
Tilemap and returns the number of tiles lled.

HasEditorPreviewTile

Returns whether there is an editor preview tile at the position.

HasTile

Returns whether there is a tile at the position.

RefreshAllTiles

Refreshes all tiles in the tile map. The tile map will retrieve the rendering
data, animation data and other data for all tiles and update all relevant
components.

RefreshTile

Refreshes a tile at the given coordinates of a cell in the tile map.

RemoveTileFlags

Removes the TileFlags onto the Tile at the given position.

ResizeBounds

Resizes tiles in the Tilemap to bounds de ned by origin and size.

SetColliderType

Sets the collider type of a tile given the XYZ coordinates of a cell in the tile
map.

SetColor

Sets the color of a tile given the XYZ coordinates of a cell in the tile map.

SetEditorPreviewColor

Sets the color of an editor preview tile given the XYZ coordinates of a cell
in the tile map.

SetEditorPreviewTile

Sets an editor preview tile given the XYZ coordinates of a cell in the tile
map.

SetEditorPreviewTransformMatrix

Sets the transform matrix of an editor preview tile given the XYZ
coordinates of a cell in the tile map.

SetTile

Sets a tile at the given XYZ coordinates of a cell in the tile map.

SetTileFlags

Sets the TileFlags onto the Tile at the given position.

SetTiles

Sets an array of tiles at the given XYZ coordinates of the corresponding
cells in the tile map.

SetTilesBlock

Fills bounds with array of tiles.

SetTransformMatrix

Sets the transform matrix of a tile given the XYZ coordinates of a cell in
the tile map.

SwapTile

Swaps all existing tiles of changeTile to newTile and refreshes all the
swapped tiles.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

cellGap

The size of the gap between each cell in the layout.

cellLayout

The layout of the cells.

cellSize

The size of each cell in the layout.

cellSwizzle

The cell swizzle for the layout.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CellToLocal

Converts a cell position to local position space.

CellToLocalInterpolated

Converts an interpolated cell position in oats to local position space.

CellToWorld

Converts a cell position to world position space.

GetBoundsLocal

Returns the local bounds for a cell at the location.

GetLayoutCellCenter

Get the default center coordinate of a cell for the set layout of the Grid.

LocalToCell

Converts a local position to cell position.

LocalToCellInterpolated

Converts a local position to cell position.

LocalToWorld

Converts a local position to world position.

WorldToCell

Converts a world position to cell position.

WorldToLocal

Converts a world position to local position.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Determines the orientation of tiles in the Tilemap.

Properties
XY

Orients tiles in the XY plane.

XZ

Orients tiles in the XZ plane.

YX

Orients tiles in the YX plane.

YZ

Orients tiles in the YZ plane.

ZX

Orients tiles in the ZX plane.

ZY

Orients tiles in the ZY plane.

Custom

Use a custom orientation to all tiles in the tile map.

Leave feedback

Description
Collider for 2D physics representing shapes de ned by the corresponding Tilemap.
See Also: BoxCollider2D, CircleCollider2D, EdgeCollider2D, PolygonCollider2D.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback

Description
The tile map renderer is used to render the tile map marked out by a tile map component and a grid component.
This class is a script interface for a tile map renderer component.

Properties
chunkCullingBounds

Bounds used for culling of Tilemap chunks.

chunkSize

Size in number of tiles of each chunk created by the TilemapRenderer.

detectChunkCullingBounds

Returns whether the TilemapRenderer automatically detects the bounds to
extend chunk culling by.

maskInteraction

Speci es how the Tilemap interacts with the masks.

maxChunkCount

Maximum number of chunks the TilemapRenderer caches in memory.

maxFrameAge

Maximum number of frames the TilemapRenderer keeps unused chunks in
memory.

mode

The mode in which the TileMapRenderer batches the tiles for rendering.

sortOrder

Active sort order for the TilemapRenderer.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback

Description
Returns whether the TilemapRenderer automatically detects the bounds to extend chunk culling by.

Properties
Auto

The TilemapRenderer will automatically detect the bounds of extension by inspecting the
Sprite/s used in the Tilemap.

Manual

The user adds in the values used for extend the bounds for culling of Tilemap chunks.

Leave feedback

Description
Sort order for all tiles rendered by the TilemapRenderer.

Properties
BottomLeft

Sorts tiles for rendering starting from the tile with the lowest X and the lowest Y cell
positions.

BottomRight

Sorts tiles for rendering starting from the tile with the highest X and the lowest Y cell
positions.

TopLeft

Sorts tiles for rendering starting from the tile with the lowest X and the highest Y cell
positions.

TopRight

Sorts tiles for rendering starting from the tile with the highest X and the lowest Y cell
positions.

Leave feedback

Description
Flags controlling behavior for the TileBase.

Properties
None

No TileFlags are set.

LockColor

TileBase locks any color set by brushes or the user.

LockTransform

TileBase locks any transform matrix set by brushes or the user.

InstantiateGameObjectRuntimeOnly

TileBase does not instantiate its associated GameObject in editor mode
and instantiates it only during play mode.

LockAll

All lock ags.

Leave feedback

Description
Playable that controls the active state of a GameObject.

Properties
gameObject

GameObject to control it active state.

postPlayback

The active state to set on the GameObject after the graph has been stopped

Inherited Members
Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback

Description
The state of a GameObject's activeness when a PlayableGraph stops.

Properties
Active

Set the GameObject to active when the PlayableGraph stops.

Inactive

Set the GameObject to inactive when the PlayableGraph stops.

Revert

Revert the GameObject to the active state it was before the PlayableGraph started.

Leave feedback

Description
An activation track is a track that can be used to control the active state of a GameObject.

Properties
postPlaybackState

Speci es what state to leave the GameObject in after the Timeline has nished playing.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Specify what state the GameObject is set to after the Timeline has nished playing.

Properties
Active

Set the GameObject to active.

Inactive

Set the GameObject to Inactive.

Revert

Revert the GameObject to the state in was in before the Timeline was playing.

LeaveAsIs

Leave the GameObject in the state it was when the Timeline was stopped.

Leave feedback
Implements interfaces:IPropertyPreview, ISerializationCallbackReceiver, ITimelineClipAsset

Description
A playable asset wrapper that represents a single AnimationClip clip in Timeline.

Properties
clip

The animation clip.

eulerAngles

The euler angle representation of the root motion rotation o set of the clip.

matchTargetFields

Speci es which elds should be matched when aligning o sets.

position

The root motion position o set of the clip.

removeStartO set

Whether to make the animation clip play relative to its rst keyframe.

rotation

The root motion rotation o set of the clip.

useTrackMatchFields

Speci es that matching options are de ned by the track.

Public Methods
ResetO sets

Resets the root motion o sets to default values.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
A Timeline track used for playing back animations on an Animator.

Properties
applyAvatarMask

Speci es whether to apply the AvatarMask to the track.

avatarMask

Speci es an AvatarMask to be applied.

eulerAngles

The euler angle representation of the root motion rotation o set of the entire
track.

inClipMode

Speci es whether the Animation Track has clips, or is in in nite mode.

matchTargetFields

Speci es which elds to match when aligning root motion o sets of clips.

openClipO setEulerAngles

The euler angle representation of the root motion rotation o set of the track
when in in nite mode.

openClipO setPosition

This represents the root motion position o set of a track in in nite mode.

openClipO setRotation

This represents the root motion rotation o set of a track in in nite mode.

position

The root motion position o set of the entire track.

rotation

The root motion rotation o set of the entire track.

trackO set

Speci es what is used to set the starting position and orientation of an
Animation Track.

Public Methods
CreateClip

Creates a TimelineClip using an AnimationClip.

CreateRecordableClip

Creates a TimelineClip, AnimationPlayableAsset and an AnimationClip. Use this clip to
record in a timeline.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback
Implements interfaces:ITimelineClipAsset

Description
PlayableAsset wrapper for an AudioClip in Timeline.

Properties
clip

The audio clip this asset will generate a player for.

loop

Whether the audio clip loops.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
A Timeline track that can play AudioClips.

Public Methods
CreateClip

Create an TimelineClip for playing an AudioClip on this track.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback
Implements interfaces:IPropertyPreview, ITimelineClipAsset

Description
Asset that generates playables for controlling time-related elements on a GameObject.
This playable optionally controls ParticleSystem, PlayableDirectors and Activation from a GameObject. Users can
also specify a Prefab that will be instantiated, and parented to the the sourceObject if speci ed.

Properties
active

Indicate if the playable will use Activation.

particleRandomSeed

Let the particle systems behave the same way on each execution.

postPlayback

Indicates the active state of the gameObject when the Timeline is stopped.

prefabGameObject

Prefab object that will be instantiated.

searchHierarchy

Indicate whether to search the entire hierachy for controlable components.

sourceGameObject

GameObject in the Scene to control, or the parent of the instantiated Prefab.

updateDirector

Indicate if user wants to control PlayableDirectors.

updateITimeControl

Indicates that whether Monobehaviours implementing ITimeControl on the
gameObject will be controlled.

updateParticle

Indicates if user wants to control ParticleSystems.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
A Track whose clips control time-related elements on a GameObject.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Playable used to control other PlayableDirectors.
This playable is used to control other PlayableDirector components from a Timeline sequence.

Properties
director

The PlayableDirector to control.

Inherited Members
Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback

Description
A group track is a container that allows tracks to be arranged in a hierarchical manner.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Playable that synchronizes a particle system simulation.

Properties
particleSystem

Which particle system to control.

Inherited Members
Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback

Description
A PlayableTrack is a track whose clips are custom playables.
This is a track that can contain PlayableAssets that are found in the project and do not have their own speci ed
track type.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Playable that controls and instantiates a Prefab.

Properties
prefabInstance

The instance of the Prefab that has been generated for this playable.

Inherited Members
Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback
Implements interfaces:IPropertyPreview, ISerializationCallbackReceiver, ITimelineClipAsset

Description
A PlayableAsset that represents a timeline.

Properties
duration

The length in seconds of the timeline.

durationMode

How the duration of a timeline is calculated.

xedDuration

The length of the timeline when the durationMode is set to xed length.

outputTrackCount

Returns the the number of output tracks in the Timeline.

rootTrackCount

Returns the number of tracks at the root level of the timeline.

Public Methods
CreateTrack

Allows you to create a track and add it to the Timeline.

DeleteClip

Delete a clip from this timeline.

DeleteTrack

Deletes a track from a timeline, including all clips and subtracks.

GetOutputTrack

Retrives the output track from the given index.

GetOutputTracks

Gets a list of all output tracks in the Timeline.

GetRootTrack

Retrieves at root track at the speci ed index.

GetRootTracks

Get an enumerable list of all root tracks.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
How the duration of the timeline is determined.

Properties
BasedOnClips

The duration of the timeline is determined based on the clips present.

FixedLength

The duration of the timeline is a xed length.

Leave feedback
Implements interfaces:ISerializationCallbackReceiver

Description
Represents a clip on the timeline.

Properties
animationClip

An AnimationClip containing animated parameters.

asset

Reference to a serializable IPlayableAsset representing the specialization of the clip.

clipCaps

Feature capabilities supported by this clip.

clipIn

Time to start playing the clip at.

duration

The length in seconds of the clip.

end

The end time of the clip.

extrapolatedDuration

The length of the clip including extrapolation.

extrapolatedStart

The start time of the clip when extrapolation is considered.

hasBlendIn

Does the clip have blend in?

hasBlendOut

Does the clip have a non-zero blend out?

hasPostExtrapolation

Is the clip being extrapolated past it's end time?

hasPreExtrapolation

Is the clip being extrapolated before it's start time?

parentTrack

Returns the parent track where this clip is attached.

postExtrapolationMode

The extrapolation mode for time beyond the end of the clip.

preExtrapolationMode

The extrapolation mode for the time before the start of the clip.

start

The start time of the clip.

timeScale

The time scale of the clip.

Public Methods
ToLocalTime

Converts from global time to a clips local time.

ToLocalTimeUnbound

Converts from global time to a clips local time, ignoring extrapolation.

Leave feedback

Description
How the clip handles time outside it's start and end range.

Properties
None

No extrapolation is applied.

Hold

Hold the time at the end value of the clip.

Loop

Loop time values outside the start/end range.

Continue

Lets the underlying asset handle extrapolated time values.

Leave feedback

Description
Playable generated by a Timeline.

Inherited Members
Public Methods
OnBehaviourDelay

This function is called when the Playable play state is changed to PlayState.Delayed.

OnBehaviourPause

This function is called when the Playable play state is changed to PlayState.Paused.

OnBehaviourPlay

This function is called when the Playable play state is changed to PlayState.Playing.

OnGraphStart

This function is called when the PlayableGraph that owns this PlayableBehaviour starts.

OnGraphStop

This function is called when the PlayableGraph that owns this PlayableBehaviour stops.

OnPlayableCreate

This function is called when the Playable that owns the PlayableBehaviour is created.

OnPlayableDestroy

This function is called when the Playable that owns the PlayableBehaviour is destroyed.

PrepareData

This function is called during the PrepareData phase of the PlayableGraph.

PrepareFrame

This function is called during the PrepareFrame phase of the PlayableGraph.

ProcessFrame

This function is called during the ProcessFrame phase of the PlayableGraph.

Leave feedback
Implements interfaces:IPropertyPreview, ISerializationCallbackReceiver

Description
A PlayableAsset Representing a track inside a timeline.

Properties
isEmpty

Does this track have any clips?

isSubTrack

Is this track a subtrack?

locked

The local locked state of the track.

lockedInHierarchy

The locked state of a track. (Read Only)

muted

Mutes the track, excluding it from the generated PlayableGraph.

outputs

A description of the outputs of the instantiated Playable.

parent

The owner of this track.

timelineAsset

The TimelineAsset this track belongs to.

Public Methods
CreateClip

Creates a clip on the track with a custom playable asset attached, whose type is speci ed
by T. Throws an InvalidOperationException if the speci ed type is not supported by the
track.

CreateDefaultClip

Creates a default clip for this track, where the clip's asset type is based on any
TrackClipTypeAttributes marking the track.

CreateTrackMixer

Creates a mixer used to blend playables generated by clips on the track.

GetChildTracks

The list of subtracks or child tracks attached to this track.

GetClips

Returns an enumerable list of clips owned by the track.

Protected Methods
OnAfterTrackDeserialize

Override this method to receive a callback after Unity deserializes your track.

OnBeforeTrackSerialize

Override this method to receive a callback before Unity serializes your track.

OnCreateClip

Called when a clip is created on a track. Use this method to set default values on a
timeline clip, or on it's PlayableAsset.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

duration

The playback duration in seconds of the instantiated Playable.

outputs

A description of the outputs of the instantiated Playable.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

CreatePlayable

Implement this method to have your asset inject playables into the given graph.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Extension methods for Track Assets.

Static Methods
GetGroup

Gets the GroupTrack this track belongs to.

SetGroup

Assigns the track to the speci ed group track.

Leave feedback

Description
Interface used to inform the Timeline Editor about potential property modi cations that may occur while
previewing.

Public Methods
AddFromClip

Add property modi cations modi ed by an animation clip.

AddFromClips

Add property modi cations speci ed by a list of animation clips.

AddFromName

Add property modi cations using the serialized property name.

AddObjectProperties

Add property modi cations for a ScriptableObject.

PopActiveGameObject

Removes the active GameObject from the modi cation stack, restoring the previous
value.

PushActiveGameObject

Sets the active game object for subsequent property modi cations.

Leave feedback

Description
Implement this interface in a PlayableAsset to specify which properties will be modi ed when Timeline is in
preview mode.

Public Methods
GatherProperties

Called by the Timeline Editor to gather properties requiring preview.

Leave feedback

Description
Interface that can be implemented by MonoBehaviours indicating that they receive time-related control calls from
a PlayableGraph.
Implementing this interface on MonoBehaviours attached to GameObjects under control by control-tracks will
cause them to be noti ed when associated Timeline clips are active.

Public Methods
OnControlTimeStart

Called when the associated Timeline clip becomes active.

OnControlTimeStop

Called when the associated Timeline clip becomes deactivated.

SetTime

Called each frame the Timeline clip is active.

Leave feedback

Description
Implement this interface to support advanced features of timeline clips.

Properties
clipCaps

Returns a description of the features supported by clips representing playables
implementing this interface.

Leave feedback

Description
Describes the timeline features supported by clips representing this playable.

Properties
None

No features are supported.

Looping

The clip representing this playable supports loops.

Extrapolation

The clip representing this playable supports clip extrapolation.

ClipIn

The clip representing the playable supports initial local times greater than zero.

SpeedMultiplier

The clip representing this playable supports time scaling.

Blending

The clip representing the playable supports blending between clips.

All

All features are supported.

Leave feedback

Description
Specify these options when using a binding type for a custom TrackAsset.

Properties
None

Speci es no options.

AllowCreateComponent

Speci es the automatic creation of component types, when required.

All

Speci es all options. This is the default.

Leave feedback

Description
Attribute to apply to a ScriptPlayable class or property to indicate that it is not animatable.

Leave feedback

Description
Speci es the type of object that should be bound to a TrackAsset.
Use this attribute when creating Custom Tracks to specify the type of object the track requires a binding to.

using UnityEngine;
using UnityEngine.Timeline;

[TrackBindingType(typeof(Light), TrackBindingFlags.AllowCreateComponent)]
public class LightTrack : TrackAsset
{
}

Properties
ags
type

Options related to the track binding.
The type of object that the track requires a binding to.

Leave feedback

Description
Speci es the type of PlayableAsset that this track can create clips representing.
This is required for custom track assets to specify the type of clips to create.

Constructors
TrackClipTypeAttribute

Speci es the type of PlayableAsset that this track can create clips representing.

Leave feedback

Description
Attribute used to specify the color of the track and its clips inside the Timeline Editor.

Constructors
TrackColorAttribute

Specify the track color using [0-1] R,G,B values.

Leave feedback

Description
Interface into tvOS speci c functionality.

Static Properties
advertisingIdenti er

Advertising ID.

advertisingTrackingEnabled

Is advertising tracking enabled.

generation

The generation of the device. (Read Only)

systemVersion

iOS version.

vendorIdenti er

Vendor ID.

Static Methods
ResetNoBackupFlag

Reset "no backup" le ag: le will be synced with iCloud/iTunes backup and can be
deleted by OS in low storage situations.

SetNoBackupFlag

Set le ag to be excluded from iCloud/iTunes backup.

Leave feedback

Description
A class for Apple TV remote input con guration.

Static Properties
allowExitToHome

Con gures how "Menu" button behaves on Apple TV Remote. If this property is
set to true hitting "Menu" on Remote will exit to system home screen. When this
property is false current application is responsible for handling "Menu" button.
It is recommended to set this property to true on top level menus of your
application.

allowRemoteRotation

Con gures if Apple TV Remote should autorotate all the inputs when Remote is
being held in horizontal orientation. Default is false.

reportAbsoluteDpadValues

Con gures how touches are mapped to analog joystick axes in relative or
absolute values. If set to true it will return +1 on Horizontal axis when very far
right is being touched on Remote touch aread (and -1 when very left area is
touched correspondingly). The same applies for Vertical axis too. When this
property is set to false player should swipe instead of touching speci c area of
remote to generate Horizontal or Vertical input.

touchesEnabled

Disables Apple TV Remote touch propagation to Unity Input.touches API. Useful
for 3rd party frameworks, which do not respect Touch.type == Indirect. Default
is false.

Leave feedback

Description
iOS device generation.

Properties
AppleTV1Gen

First generation Apple TV.

AppleTV2Gen

Second generation (4K) Apple TV.

Leave feedback

Description
Sprite Atlas is an asset created within Unity. It is part of the built-in sprite packing solution.
A Sprite Atlas stores a list of packable assets. A packable asset is either a Sprite, Texture2D of
TextureImporterType.Sprite or Folder. Before the packing process begins, these packable assets will be grouped
and traversed to gather all the sprites from them. These will be used in the packing process. At runtime, these
sprites can be enumerated via the Sprite Atlas (See Also: SpriteAtlas.GetSprites).
It also provides dedicated texture settings in the inspector for the packed texture. The original texture settings of
the sprite will have no e ect on the packed texture.
By default, Sprite Atlas will be referenced by the sprite and be available at runtime. This means that the sprite will
be able to acquire the packed texture from the Sprite Atlas when loaded. A Sprite can be loaded without
referencing any Sprite Atlas. A Sprite loaded this way will render as invisible since there is no texture. A reference
to a Sprite Atlas can be added later. See Also: SpriteAtlasManager.
Sprite Atlas variants can be created by assigning another Sprite Atlas object as the master. Variants will not repack
a new texture from the packable list. Instead of this, variants will duplicate the master's packed texture and
downscale it according to a user-de ned ratio and save this scaled texture.

Properties
isVariant

Return true if this SpriteAtlas is a variant.

spriteCount

Get the total number of Sprite packed into this atlas.

tag

Get the tag of this SpriteAtlas.

Public Methods
CanBindTo

Return true if Sprite is packed into this SpriteAtlas.

GetSprite

Clone the rst Sprite in this atlas that matches the name packed in this atlas and return it.

GetSprites

Clone all the Sprite in this atlas and ll them into the supplied array.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Manages SpriteAtlas during runtime.
A Sprite can be loaded without referencing any Sprite Atlas, thus having no texture. It will be invisible until the
user registers an atlas to the Sprite by listening to the SpriteAtlasManager.atlasRequested callback. When
triggered, it will pass in the atlas tag and a System.Action which will take in an atlas object.

Events
atlasRegistered

Trigger when a SpriteAtlas is registered via invoking the callback in
SpriteAtlasManager.atlasRequested.

atlasRequested

Trigger when any Sprite was bound to SpriteAtlas but couldn't locate the atlas asset
during runtime.

Leave feedback

Description
Structure to store the state of an animation transition on a Selectable.

Properties
disabledTrigger

Trigger to send to animator when entering disabled state.

highlightedTrigger

Trigger to send to animator when entering highlighted state.

normalTrigger

Trigger to send to animator when entering normal state.

pressedTrigger

Trigger to send to animator when entering pressed state.

Leave feedback
Implements interfaces:ILayoutController, ILayoutSelfController

Description
Resizes a RectTransform to t a speci ed aspect ratio.

Properties
aspectMode

The mode to use to enforce the aspect ratio.

aspectRatio

The aspect ratio to enforce. This means width divided by height.

Public Methods
SetLayoutHorizontal

Method called by the layout system.

SetLayoutVertical

Method called by the layout system.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

SetDirty

Mark the AspectRatioFitter as dirty.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene

receiving OnDestroy.
OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be

created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Speci es a mode to use to enforce an aspect ratio.

Properties
None

The aspect ratio is not enforced.

WidthControlsHeight

Changes the height of the rectangle to match the aspect ratio.

HeightControlsWidth

Changes the width of the rectangle to match the aspect ratio.

FitInParent

Sizes the rectangle such that it's fully contained within the parent rectangle.

EnvelopeParent

Sizes the rectangle such that the parent rectangle is fully contained within.

Leave feedback
Implements interfaces:IMeshModi er

Description
Base class for e ects that modify the generated Mesh.

using UnityEngine;
using UnityEngine.UI;

public class PositionAsUV1 : BaseMeshEffect
{
protected PositionAsUV1()
{}

public override void ModifyMesh(Mesh mesh)
{
if (!IsActive())
return;

var verts = mesh.vertices.ToList();
var uvs = ListPool.Get();

for (int i = 0; i < verts.Count; i++)
{
var vert = verts[i];
uvs.Add(new Vector2(verts[i].x, verts[i].y));
verts[i] = vert;
}
mesh.SetUVs(1, uvs);
ListPool.Release(uvs);
}
}

Public Methods
ModifyMesh

See:IMeshModi er.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Obsolete

Description
Base class for e ects that modify the the generated Vertex Bu ers.

Leave feedback
Implements interfaces:IEventSystemHandler, IPointerClickHandler, ISubmitHandler

Description
A standard button that can be clicked in order to trigger an event.
See Selectable for selection states.

Properties
onClick

UnityEvent that is triggered when the Button is pressed.

Public Methods
OnPointerClick

Registered IPointerClickHandler callback.

OnSubmit

Registered ISubmitHandler callback.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

FindSelectableOnDown

Find the selectable object below this one.

FindSelectableOnLeft

Find the selectable object to the left of this one.

FindSelectableOnRight

Find the selectable object to the right of this one.

FindSelectableOnUp

Find the selectable object above this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnMove

Determine in which of the 4 move directions the next selectable object should
be found.

OnPointerDown

Evaluate current state and transition to pressed state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

OnDisable

See MonoBehaviour.OnDisable.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Function de nition for a button click event.

Inherited Members
Public Methods
AddListener

Add a non persistent listener to the UnityEvent.

Invoke

Invoke all registered callbacks (runtime and persistent).

RemoveListener

Remove a non persistent listener from the UnityEvent.

GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
The Canvas Scaler component is used for controlling the overall scale and pixel density of UI elements in the
Canvas. This scaling a ects everything under the Canvas, including font sizes and image borders.
For a Canvas set to 'Screen Space - Overlay' or 'Screen Space - Camera', the Canvas Scaler UI Scale Mode can be
set to Constant Pixel Size, Scale With Screen Size, or Constant Physical Size.
Using the Constant Pixel Size mode, positions and sizes of UI elements are speci ed in pixels on the screen. This is
also the default functionality of the Canvas when no Canvas Scaler is attached. However, With the Scale Factor
setting in the Canvas Scaler, a constant scaling can be applied to all UI elements in the Canvas.
Using the Scale With Screen Size mode, positions and sizes can be speci ed according to the pixels of a speci ed
reference resolution. If the current screen resolution is larger than the reference resolution, the Canvas will keep
having only the resolution of the reference resolution, but will scale up in order to t the screen. If the current
screen resolution is smaller than the reference resolution, the Canvas will similarly be scaled down to t. If the
current screen resolution has a di erent aspect ratio than the reference resolution, scaling each axis individually
to t the screen would result in non-uniform scaling, which is generally undesirable. Instead of this, the
ReferenceResolution component will make the Canvas resolution deviate from the reference resolution in order
to respect the aspect ratio of the screen. It is possible to control how this deviation should behave using the
screenMatchMode setting.
Using the Constant Physical Size mode, positions and sizes of UI elements are speci ed in physical units, such as
millimeters, points, or picas. This mode relies on the device reporting its screen DPI correctly. You can specify a
fallback DPI to use for devices that do not report a DPI.
For a Canvas set to 'World Space' the Canvas Scaler can be used to control the pixel density of UI elements in the
Canvas.
See Also: Canvas.

Properties
defaultSpriteDPI

The pixels per inch to use for sprites that have a 'Pixels Per Unit' setting that
matches the 'Reference Pixels Per Unit' setting.

dynamicPixelsPerUnit

The amount of pixels per unit to use for dynamically created bitmaps in the UI, such
as Text.

fallbackScreenDPI

The DPI to assume if the screen DPI is not known.

matchWidthOrHeight

Setting to scale the Canvas to match the width or height of the reference resolution,
or a combination.

physicalUnit

The physical unit to specify positions and sizes in.

referencePixelsPerUnit

If a sprite has this 'Pixels Per Unit' setting, then one pixel in the sprite will cover one
unit in the UI.

referenceResolution

The resolution the UI layout is designed for.

scaleFactor

Scales all UI elements in the Canvas by this factor.

screenMatchMode

A mode used to scale the canvas area if the aspect ratio of the current resolution
doesn't t the reference resolution.

uiScaleMode

Determines how UI elements in the Canvas are scaled.

Protected Methods
Handle

Method that handles calculations of canvas scaling.

HandleConstantPhysicalSize

Handles canvas scaling for a constant physical size.

HandleConstantPixelSize

Handles canvas scaling for a constant pixel size.

HandleScaleWithScreenSize

Handles canvas scaling that scales with the screen size.

HandleWorldCanvas

Handles canvas scaling for world canvas.

OnDisable

See MonoBehaviour.OnDisable.

SetReferencePixelsPerUnit

Sets the referencePixelsPerUnit on the Canvas.

SetScaleFactor

Sets the scale factor on the canvas.

Update

Handles per-frame checking if the canvas scaling needs to be updated.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Leave feedback

Description
Determines how UI elements in the Canvas are scaled.

Properties
ConstantPixelSize

Using the Constant Pixel Size mode, positions and sizes of UI elements are speci ed in
pixels on the screen.

ScaleWithScreenSize

Using the Scale With Screen Size mode, positions and sizes can be speci ed according
to the pixels of a speci ed reference resolution. If the current screen resolution is
larger than the reference resolution, the Canvas will keep having only the resolution of
the reference resolution, but will scale up in order to t the screen. If the current
screen resolution is smaller than the reference resolution, the Canvas will similarly be
scaled down to t.

ConstantPhysicalSize

Using the Constant Physical Size mode, positions and sizes of UI elements are
speci ed in physical units, such as millimeters, points, or picas.

Leave feedback

Description
Scale the canvas area with the width as reference, the height as reference, or something in between.

Properties
MatchWidthOrHeight

Scale the canvas area with the width as reference, the height as reference, or
something in between.

Expand

Expand the canvas area either horizontally or vertically, so the size of the canvas will
never be smaller than the reference.

Shrink

Crop the canvas area either horizontally or vertically, so the size of the canvas will
never be larger than the reference.

Leave feedback

Description
Settings used to specify a physical unit.

Properties
Centimeters

Use centimeters. A centimeter is 1/100 of a meter.

Millimeters

Use millimeters. A millimeter is 1/10 of a centimeter, and 1/1000 of a meter.

Inches

Use inches.

Points

Use points. One point is 1/12 of a pica, and 1/72 of an inch.

Picas

Use picas. One pica is 1/6 of an inch.

Leave feedback

Description
A place where CanvasElements can register themselves for rebuilding.

Static Properties
instance

Get the singleton registry.

Static Methods
IsRebuildingGraphics

Are graphics being rebuild.

IsRebuildingLayout

Is layout being rebuilt?

RegisterCanvasElementForGraphicRebuild

Rebuild the graphics of the given element.

RegisterCanvasElementForLayoutRebuild

Rebuild the layout of the given element.

TryRegisterCanvasElementForGraphicRebuild

Rebuild the layout of the given element.

TryRegisterCanvasElementForLayoutRebuild

Was the element scheduled.

UnRegisterCanvasElementForRebuild

Remove the given element from rebuild.

Leave feedback

Description
Registry class to keep track of all IClippers that exist in the Scene.
This is used during the CanvasUpdate loop to cull clippable elements. The clipping is called after layout, but
before Graphic update.

Static Properties
instance

Singleton instance.

Public Methods
Cull

Perform the clipping on all registered IClipper.

Static Methods
Register

Register an IClipper.

Unregister

Unregister an IClipper.

Leave feedback

Description
Utility class to help when clipping using IClipper.

Static Methods
FindCullAndClipWorldRect

Find the Rect to use for clipping.

Leave feedback

Description
Structure to store the state of a color transition on a Selectable.

Static Properties
defaultColorBlock

Simple getter for the default ColorBlock.

Properties
colorMultiplier

Multiplier applied to colors (allows brightening greater then base color).

disabledColor

Disabled Color.

fadeDuration

How long a color transition should take.

highlightedColor

Highlighted Color.

normalColor

Normal Color.

pressedColor

Pressed Color.

Leave feedback
Implements interfaces:ILayoutController, ILayoutSelfController

Description
Resizes a RectTransform to t the size of its content.
The ContentSizeFitter can be used on GameObjects that have one or more ILayoutElement components, such as
Text, Image, HorizontalLayoutGroup, VerticalLayoutGroup, and GridLayoutGroup.
See Also: Auto Layout.

Properties
horizontalFit

The t mode to use to determine the width.

verticalFit

The t mode to use to determine the height.

Public Methods
SetLayoutHorizontal

Method called by the layout system.

SetLayoutVertical

Method called by the layout system.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

SetDirty

Mark the ContentSizeFitter as dirty.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the

editor).
useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

p
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this

object's collider (2D physics only).
OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
The size t mode to use.

Properties
Unconstrained

Don't perform any resizing.

MinSize

Resize to the minimum size of the content.

PreferredSize

Resize to the preferred size of the content.

Leave feedback

Description
Utility class for creating default implementations of builtin UI controls.
The recommended work ow for using UI controls with the UI system is to create a Prefab for each type of control
and instantiate those when needed. This way changes can be made to the Prefabs which immediately have e ect
on all used instances.
However, in certain cases there can be reasons to create UI controls entirely from code. The DefaultControls class
provide methods to create each of the builtin UI controls. The resulting objects are the same as are obtained from
using the corresponding UI menu entries in the GameObject menu in the Editor.
An example use of this is creating menu items for custom new UI controls that mimics the ones that are builtin in
Unity. Some such UI controls may contain other UI controls. For example, a scroll view contains scrollbars. By
using the DefaultControls methods to create those parts, it is ensured that they are identical in look and setup to
the ones provided in the menu items builtin with Unity.
Note that the details of the setup of the UI controls created by the methods in this class may change with later
revisions of the UI system. As such, they are not guaranteed to be 100% backwards compatible. It is
recommended not to rely on the speci c hierarchies of the GameObjects created by these methods, and limit
your code to only interface with the root GameObject created by each method.

Static Methods
CreateButton

Create a button.

CreateDropdown

Create a dropdown.

CreateImage

Create an image.

CreateInputField

Create an input eld.

CreatePanel

Create a panel.

CreateRawImage

Create a raw image.

CreateScrollbar

Create a scrollbar.

CreateScrollView

Create a scroll view.

CreateSlider

Create a slider.

CreateText

Create a text object.

CreateToggle

Create a toggle.

Leave feedback

Description
Object used to pass resources to use for the default controls.

Properties
background

Sprite used for background elements.

checkmark

Sprite used for representation of an "on" state when present, such as a checkmark.

dropdown

Sprite used to indicate that a button will open a dropdown when clicked.

inputField

Sprite used as background for input elds.

knob

Sprite used for knobs that can be dragged, such as on a slider.

mask

Sprite used for masking purposes, for example to be used for the viewport of a scroll
view.

standard

The primary sprite to be used for graphical UI elements, used by the button, toggle, and
dropdown controls, among others.

Leave feedback
Implements interfaces:ICancelHandler, IEventSystemHandler, IPointerClickHandler, ISubmitHandler

Description
A standard dropdown that presents a list of options when clicked, of which one can be chosen.
The dropdown component is a Selectable. When an option is chosen, the label and/or image of the control
changes to show the chosen option.
When a dropdown event occurs a callback is sent to any registered listeners of onValueChanged.

Properties
captionImage

The Image component to hold the image of the currently selected option.

captionText

The Text component to hold the text of the currently selected option.

itemImage

The Image component to hold the image of the item.

itemText

The Text component to hold the text of the item.

onValueChanged

A UnityEvent that is invoked when when a user has clicked one of the options in the
dropdown list.

options

The list of possible options. A text string and an image can be speci ed for each option.

template

The Rect Transform of the template for the dropdown list.

value

The Value is the index number of the current selection in the Dropdown. 0 is the rst
option in the Dropdown, 1 is the second, and so on.

Public Methods
AddOptions

Add multiple options to the options of the Dropdown based on a list of OptionData
objects.

ClearOptions

Clear the list of options in the Dropdown.

Hide

Hide the dropdown list.

OnCancel

Called by a BaseInputModule when a Cancel event occurs.

OnPointerClick

Handling for when the dropdown is 'clicked'.

OnSubmit

What to do when the event system sends a submit Event.

RefreshShownValue

Refreshes the text and image (if available) of the currently selected option.If you have
modi ed the list of options, you should call this method afterwards to ensure that the

visual state of the dropdown corresponds to the updated options.
Show

Show the dropdown list.

Protected Methods
CreateBlocker

Override this method to implement a di erent way to obtain a blocker GameObject.

CreateDropdownList

Override this method to implement a di erent way to obtain a dropdown list
GameObject.

CreateItem

Override this method to implement a di erent way to obtain an option item.

DestroyBlocker

Override this method to implement a di erent way to dispose of a blocker
GameObject that blocks clicks to other controls while the dropdown list is open.

DestroyDropdownList

Override this method to implement a di erent way to dispose of a dropdown list
GameObject.

DestroyItem

Override this method to implement a di erent way to dispose of an option item.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

FindSelectableOnDown

Find the selectable object below this one.

FindSelectableOnLeft

Find the selectable object to the left of this one.

FindSelectableOnRight

Find the selectable object to the right of this one.

FindSelectableOnUp

Find the selectable object above this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnMove

Determine in which of the 4 move directions the next selectable object should
be found.

OnPointerDown

Evaluate current state and transition to pressed state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

OnDisable

See MonoBehaviour.OnDisable.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
UnityEvent callback for when a dropdown current option is changed.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Class to store the text and/or image of a single option in the dropdown list.

Properties
image

The image associated with the option.

text

The text associated with the option.

Constructors
Dropdown.OptionData

Create an object representing a single option for the dropdown list.

Leave feedback

Description
Class used internally to store the list of options for the dropdown list.
The usage of this class is not exposed in the runtime API. It's only relevant for the PropertyDrawer drawing the list
of options.

Properties
options

The list of options for the dropdown list.

Leave feedback
Implements interfaces:ISerializationCallbackReceiver

Description
Struct for storing Text generation settings.

Static Properties
defaultFontData

Maintain a list of all the FontData features.

Properties
alignByGeometry

Use the extents of glyph geometry to perform horizontal alignment rather than glyph
metrics.

alignment

How is the text aligned.

bestFit

Is best t used.

font

Font to use.

fontSize

Font size.

fontStyle

Font Style.

horizontalOver ow

Horizontal over ow mode.

lineSpacing

Line spacing.

maxSize

Maximum text size.

minSize

Minimum text size.

richText

Should RichText be used?

verticalOver ow

Vertical over ow mode.

Leave feedback

Description
Utility class that is used to help with Text update.
When Unity rebuilds a font atlas a callback is sent to the font. Using this class you can register your text as
needing to be rebuilt if the font atlas is updated.

Static Methods
TrackText

Register a Text element for receiving texture atlas rebuild calls.

UntrackText

Deregister a Text element from receiving texture atlas rebuild calls.

Leave feedback
Implements interfaces:ICanvasElement

Description
Base class for all visual UI Component.
When creating visual UI components you should inherit from this class. Below is a simple example that draws a
colored quad inside the Rect Transform area.

using UnityEngine;
using UnityEngine.UI;

[ExecuteInEditMode]
public class SimpleImage : Graphic
{
protected override void OnPopulateMesh(VertexHelper vh)
{
Vector2 corner1 = Vector2.zero;
Vector2 corner2 = Vector2.zero;

corner1.x
corner1.y
corner2.x
corner2.y

=
=
=
=

0f;
0f;
1f;
1f;

corner1.x
corner1.y
corner2.x
corner2.y

-=
-=
-=
-=

rectTransform.pivot.x;
rectTransform.pivot.y;
rectTransform.pivot.x;
rectTransform.pivot.y;

corner1.x
corner1.y
corner2.x
corner2.y

*=
*=
*=
*=

rectTransform.rect.width;
rectTransform.rect.height;
rectTransform.rect.width;
rectTransform.rect.height;

vh.Clear();

UIVertex vert = UIVertex.simpleVert;

vert.position = new Vector2(corner1.x, corner1.y);
vert.color = color;
vh.AddVert(vert);

vert.position = new Vector2(corner1.x, corner2.y);
vert.color = color;
vh.AddVert(vert);

vert.position = new Vector2(corner2.x, corner2.y);
vert.color = color;
vh.AddVert(vert);

vert.position = new Vector2(corner2.x, corner1.y);
vert.color = color;
vh.AddVert(vert);

vh.AddTriangle(0, 1, 2);
vh.AddTriangle(2, 3, 0);
}
}

Static Properties
defaultGraphicMaterial

Default material used to draw UI elements if no explicit material was speci ed.

Properties
canvas

A reference to the Canvas this Graphic is rendering to.

canvasRenderer

The CanvasRenderer used by this Graphic.

color

Base color of the Graphic.

defaultMaterial

Returns the default material for the graphic.

depth

Absolute depth of the graphic in the hierarchy, used by rendering and events.

mainTexture

The graphic's texture. (Read Only).

material

The Material set by the user.

materialForRendering

The material that will be sent for Rendering (Read only).

raycastTarget

Should this graphic be considered a target for raycasting?

rectTransform

The RectTransform component used by the Graphic.

Public Methods
CrossFadeAlpha

Tweens the alpha of the CanvasRenderer color associated with this
Graphic.

CrossFadeColor

Tweens the CanvasRenderer color associated with this Graphic.

GetPixelAdjustedRect

Returns a pixel perfect Rect closest to the Graphic RectTransform.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnCullingChanged

Callback function to call when the culling has changed.

OnRebuildRequested

Editor-only callback that is issued by Unity if a rebuild of the Graphic is
required.

PixelAdjustPoint

Adjusts the given pixel to be pixel perfect.

Raycast

When a GraphicRaycaster is raycasting into the Scene it does two things.
First it lters the elements using their RectTransform rect. Then it uses this
Raycast function to determine the elements hit by the raycast.

Rebuild

Rebuilds the graphic geometry and its material on the PreRender cycle.

RegisterDirtyLayoutCallback

Add a listener to receive noti cation when the graphics layout is dirtied.

RegisterDirtyMaterialCallback

Add a listener to receive noti cation when the graphics material is dirtied.

RegisterDirtyVerticesCallback

Add a listener to receive noti cation when the graphics vertices are dirtied.

SetAllDirty

Mark the Graphic as dirty.

SetLayoutDirty

Mark the layout as dirty.

SetMaterialDirty

Mark the Material as dirty.

SetNativeSize

Adjusts the graphic size to make it pixel-perfect.

SetVerticesDirty

Mark the vertices as dirty.

UnregisterDirtyLayoutCallback

Remove a listener from receiving noti cations when the graphics layout is
dirtied.

UnregisterDirtyMaterialCallback

Remove a listener from receiving noti cations when the graphics material

is dirtied.
UnregisterDirtyVerticesCallback

Remove a listener from receiving noti cations when the graphics vertices
are dirtied.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

OnPopulateMesh

Callback function when a UI element needs to generate vertices.

UpdateGeometry

Call to update the geometry of the Graphic onto the CanvasRenderer.

UpdateMaterial

Call to update the Material of the graphic onto the CanvasRenderer.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
A BaseRaycaster to raycast against Graphic elements.

Properties
blockingObjects

Type of objects that will block graphic raycasts.

eventCamera

See: BaseRaycaster.

ignoreReversedGraphics

Should graphics facing away from the raycaster be considered?

Public Methods
Raycast

Determines if the cursor is over a Graphics element in the Scene. See: BaseRaycaster.

Inherited Members
Properties
eventCamera

The camera that will generate rays for this raycaster.

renderOrderPriority

Priority of the raycaster based upon render order.

sortOrderPriority

Priority of the raycaster based upon sort order.

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods

OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while

performing a Move.
OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
List of Raycasters to check for canvas blocking elements.

Properties
None

Not blocked.

TwoD

2D physics blocking.

ThreeD

3D physics blocking.

All

Blocked by 2D and 3D.

Leave feedback

Description
EditorOnly class for tracking all Graphics.
Used when a source asset is reimported into the editor to ensure that Graphics are updated as intended.

Static Methods
TrackGraphic

Track a Graphic.

UnTrackGraphic

Untrack a Graphic.

Leave feedback

Description
Registry which maps a Graphic to the canvas it belongs to.

Static Properties
instance

Singleton instance.

Static Methods
GetGraphicsForCanvas

Return a list of Graphics that are registered on the Canvas.

RegisterGraphicForCanvas

Store a link between the given canvas and graphic in the registry.

UnregisterGraphicForCanvas

Deregister the given Graphic from a Canvas.

Leave feedback

Description
Layout child layout elements in a grid.
The GridLayoutGroup component is used to layout child layout elements in a uniform grid where all cells have the
same size. The size and the spacing between cells is controlled by the GridLayoutGroup itself. The children have
no in uence on their sizes.
See Also: Auto Layout.

Properties
cellSize

The size to use for each cell in the grid.

constraint

Which constraint to use for the GridLayoutGroup.

constraintCount

How many cells there should be along the constrained axis.

spacing

The spacing to use between layout elements in the grid.

startAxis

Which axis should cells be placed along rst?

startCorner

Which corner should the rst cell be placed in?

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

childAlignment

The alignment to use for the child layout elements in the layout group.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

padding

The padding to add around the child layout elements.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
GetAlignmentOnAxis

Returns the alignment on the speci ed axis as a fraction where 0 is
left/top, 0.5 is middle, and 1 is right/bottom.

GetStartO set

Returns the calculated position of the rst child layout element along
the given axis.

GetTotalFlexibleSize

The exible size for the layout group on the given axis.

GetTotalMinSize

The min size for the layout group on the given axis.

GetTotalPreferredSize

The preferred size for the layout group on the given axis.

OnDidApplyAnimationProperties

Callback for when properties have been changed by animation.

OnDisable

See MonoBehaviour.OnDisable.

SetChildAlongAxis

Set the position and size of a child layout element along the given axis.

SetDirty

Mark the LayoutGroup as dirty.

SetLayoutInputForAxis

Used to set the calculated layout properties for the given axis.

SetProperty

Helper method used to set a given property if it has changed.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene

receiving OnDestroy.
OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have

died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
An axis that can be horizontal or vertical.

Properties
Horizontal

Horizontal.

Vertical

Vertical.

Leave feedback

Description
A constraint on either the number of columns or rows.

Properties
Flexible

Don't constrain the number of rows or columns.

FixedColumnCount

Constraint the number of columns to a speci ed number.

FixedRowCount

Constraint the number of rows to a speci ed number.

Leave feedback

Description
One of the four corners in a rectangle.

Properties
UpperLeft

Upper left.

UpperRight

Upper right.

LowerLeft

Lower left.

LowerRight

Lower right.

Leave feedback

Description
Layout child layout elements side by side.
The HorizontalLayoutGroup component is used to layout child layout elements side by side.
See Also: Auto Layout.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to
a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

childControlHeight

Returns true if the Layout Group controls the heights of its children. Returns false if
children control their own heights.

childControlWidth

Returns true if the Layout Group controls the widths of its children. Returns false if
children control their own widths.

childForceExpandHeight

Whether to force the children to expand to ll additional available vertical space.

childForceExpandWidth

Whether to force the children to expand to ll additional available horizontal space.

spacing

The spacing to use between layout elements in the layout group.

childAlignment

The alignment to use for the child layout elements in the layout group.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

padding

The padding to add around the child layout elements.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
CalcAlongAxis

Calculate the layout element properties for this layout element along
the given axis.

SetChildrenAlongAxis

Set the positions and sizes of the child layout elements for the given
axis.

GetAlignmentOnAxis

Returns the alignment on the speci ed axis as a fraction where 0 is
left/top, 0.5 is middle, and 1 is right/bottom.

GetStartO set

Returns the calculated position of the rst child layout element along
the given axis.

GetTotalFlexibleSize

The exible size for the layout group on the given axis.

GetTotalMinSize

The min size for the layout group on the given axis.

GetTotalPreferredSize

The preferred size for the layout group on the given axis.

OnDidApplyAnimationProperties

Callback for when properties have been changed by animation.

OnDisable

See MonoBehaviour.OnDisable.

SetChildAlongAxis

Set the position and size of a child layout element along the given axis.

SetDirty

Mark the LayoutGroup as dirty.

SetLayoutInputForAxis

Used to set the calculated layout properties for the given axis.

SetProperty

Helper method used to set a given property if it has changed.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene

receiving OnDestroy.
OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have

died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Abstract base class for HorizontalLayoutGroup and VerticalLayoutGroup.

Properties
childControlHeight

Returns true if the Layout Group controls the heights of its children. Returns false if
children control their own heights.

childControlWidth

Returns true if the Layout Group controls the widths of its children. Returns false if
children control their own widths.

childForceExpandHeight

Whether to force the children to expand to ll additional available vertical space.

childForceExpandWidth

Whether to force the children to expand to ll additional available horizontal space.

spacing

The spacing to use between layout elements in the layout group.

Protected Methods
CalcAlongAxis

Calculate the layout element properties for this layout element along the given axis.

SetChildrenAlongAxis

Set the positions and sizes of the child layout elements for the given axis.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

childAlignment

The alignment to use for the child layout elements in the layout group.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

padding

The padding to add around the child layout elements.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this
game object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached,
null if it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its
children using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its
parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its
children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its
parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this
game object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this
game object and on every ancestor of the behaviour.

CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in
routine running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been
destroyed.

Protected Methods
GetAlignmentOnAxis

Returns the alignment on the speci ed axis as a fraction where 0 is
left/top, 0.5 is middle, and 1 is right/bottom.

GetStartO set

Returns the calculated position of the rst child layout element along
the given axis.

GetTotalFlexibleSize

The exible size for the layout group on the given axis.

GetTotalMinSize

The min size for the layout group on the given axis.

GetTotalPreferredSize

The preferred size for the layout group on the given axis.

OnDidApplyAnimationProperties

Callback for when properties have been changed by animation.

OnDisable

See MonoBehaviour.OnDisable.

SetChildAlongAxis

Set the position and size of a child layout element along the given axis.

SetDirty

Mark the LayoutGroup as dirty.

SetLayoutInputForAxis

Used to set the calculated layout properties for the given axis.

SetProperty

Helper method used to set a given property if it has changed.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while

performing a Move.
OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ICanvasRaycastFilter, ILayoutElement, ISerializationCallbackReceiver

Description
Displays a Sprite for the UI System.

Static Properties
defaultETC1GraphicMaterial

Cache of the default Canvas Ericsson Texture Compression 1 (ETC1) and alpha
Material.

Properties
alphaHitTestMinimumThreshold

The alpha threshold speci es the minimum alpha a pixel must have for the
event to considered a "hit" on the Image.

llAmount

Amount of the Image shown when the Image.type is set to
Image.Type.Filled.

llCenter

Whether or not to render the center of a Tiled or Sliced image.

llClockwise

Whether the Image should be lled clockwise (true) or counter-clockwise
(false).

llMethod

What type of ll method to use.

llOrigin

Controls the origin point of the Fill process. Value means di erent things
with each ll method.

exibleHeight

See ILayoutElement. exibleHeight.

exibleWidth

See ILayoutElement. exibleWidth.

hasBorder

True if the sprite used has borders.

layoutPriority

See ILayoutElement.layoutPriority.

mainTexture

The image's texture. (ReadOnly).

material

The speci ed Material used by this Image. The default Material is used
instead if one wasn't speci ed.

minHeight

See ILayoutElement.minHeight.

minWidth

See ILayoutElement.minWidth.

overrideSprite

Set an override sprite to be used for rendering.

preferredHeight

See ILayoutElement.preferredHeight.

preferredWidth

See ILayoutElement.preferredWidth.

preserveAspect

Whether this image should preserve its Sprite aspect ratio.

sprite

The sprite that is used to render this image.

type

How to display the image.

useSpriteMesh

Allows you to specify whether the UI Image should be displayed using the
mesh generated by the TextureImporter, or by a simple quad mesh.

Public Methods
CalculateLayoutInputHorizontal

See ILayoutElement.CalculateLayoutInputHorizontal.

CalculateLayoutInputVertical

See ILayoutElement.CalculateLayoutInputVertical.

IsRaycastLocationValid

See:ICanvasRaycastFilter.

OnAfterDeserialize

Serialization Callback.

OnBeforeSerialize

Serialization Callback.

SetNativeSize

Adjusts the image size to make it pixel-perfect.

Inherited Members
Static Properties
defaultGraphicMaterial

Default material used to draw UI elements if no explicit material was speci ed.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

canvas

A reference to the Canvas this Graphic is rendering to.

canvasRenderer

The CanvasRenderer used by this Graphic.

color

Base color of the Graphic.

defaultMaterial

Returns the default material for the graphic.

depth

Absolute depth of the graphic in the hierarchy, used by rendering and events.

mainTexture

The graphic's texture. (Read Only).

material

The Material set by the user.

materialForRendering

The material that will be sent for Rendering (Read only).

raycastTarget

Should this graphic be considered a target for raycasting?

rectTransform

The RectTransform component used by the Graphic.

maskable

Does this graphic allow masking.

onCullStateChanged

Callback issued when culling changes.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this
game object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached,
null if it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its
children using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its
parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its
children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its
parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this

game object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this
game object and on every ancestor of the behaviour.

CrossFadeAlpha

Tweens the alpha of the CanvasRenderer color associated with this
Graphic.

CrossFadeColor

Tweens the CanvasRenderer color associated with this Graphic.

GetPixelAdjustedRect

Returns a pixel perfect Rect closest to the Graphic RectTransform.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnCullingChanged

Callback function to call when the culling has changed.

OnRebuildRequested

Editor-only callback that is issued by Unity if a rebuild of the Graphic is
required.

PixelAdjustPoint

Adjusts the given pixel to be pixel perfect.

Raycast

When a GraphicRaycaster is raycasting into the Scene it does two things.
First it lters the elements using their RectTransform rect. Then it uses this
Raycast function to determine the elements hit by the raycast.

Rebuild

Rebuilds the graphic geometry and its material on the PreRender cycle.

RegisterDirtyLayoutCallback

Add a listener to receive noti cation when the graphics layout is dirtied.

RegisterDirtyMaterialCallback

Add a listener to receive noti cation when the graphics material is dirtied.

RegisterDirtyVerticesCallback

Add a listener to receive noti cation when the graphics vertices are dirtied.

SetAllDirty

Mark the Graphic as dirty.

SetLayoutDirty

Mark the layout as dirty.

SetMaterialDirty

Mark the Material as dirty.

SetVerticesDirty

Mark the vertices as dirty.

UnregisterDirtyLayoutCallback

Remove a listener from receiving noti cations when the graphics layout is
dirtied.

UnregisterDirtyMaterialCallback

Remove a listener from receiving noti cations when the graphics material
is dirtied.

UnregisterDirtyVerticesCallback

Remove a listener from receiving noti cations when the graphics vertices
are dirtied.

Cull

See IClippable.Cull.

GetModi edMaterial

See IMaterialModi er.GetModi edMaterial.

RecalculateClipping

See: IClippable.RecalculateClipping.

RecalculateMasking

See: IMaskable.RecalculateMasking.

SetClipRect

See IClippable.SetClipRect.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in
routine running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been
destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

OnPopulateMesh

Callback function when a UI element needs to generate vertices.

UpdateGeometry

Call to update the geometry of the Graphic onto the CanvasRenderer.

UpdateMaterial

Call to update the Material of the graphic onto the CanvasRenderer.

OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of

the Update methods are called the rst time.
Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Fill method to be used by the Image.
See Also: Image. llMethod.

Properties
Horizontal

The Image will be lled Horizontally.

Vertical

The Image will be lled Vertically.

Radial90

The Image will be lled Radially with the radial center in one of the corners.

Radial180

The Image will be lled Radially with the radial center in one of the edges.

Radial360

The Image will be lled Radially with the radial center at the center.

Leave feedback

Description
Origin for the Image.FillMethod.Radial180.

Properties
Bottom

Center of the radial at the center of the Bottom edge.

Left

Center of the radial at the center of the Left edge.

Top

Center of the radial at the center of the Top edge.

Right

Center of the radial at the center of the Right edge.

Leave feedback

Description
One of the points of the Arc for the Image.FillMethod.Radial360.

Properties
Bottom

Arc starting at the center of the Bottom edge.

Right

Arc starting at the center of the Right edge.

Top

Arc starting at the center of the Top edge.

Left

Arc starting at the center of the Left edge.

Leave feedback

Description
Origin for the Image.FillMethod.Radial90.

Properties
BottomLeft

Radial starting at the Bottom Left corner.

TopLeft

Radial starting at the Top Left corner.

TopRight

Radial starting at the Top Right corner.

BottomRight

Radial starting at the Bottom Right corner.

Leave feedback

Description
Origin for the Image.FillMethod.Horizontal.

Properties
Left

Origin at the Left side.

Right

Origin at the Right side.

Leave feedback

Description
Origin for the Image.FillMethod.Vertical.

Properties
Bottom

Origin at the Bottom edge.

Top

Origin at the Top edge.

Leave feedback

Description
Image Type.
Controls how to display the Image.

Properties
Simple

Displays the full Image.

Sliced

Displays the Image as a 9-sliced graphic.

Tiled

Displays a sliced Sprite with its resizable sections tiled instead of stretched.

Filled

Displays only a portion of the Image.

Leave feedback
Implements interfaces:IBeginDragHandler, ICanvasElement, IDragHandler, IEndDragHandler,
IEventSystemHandler, ILayoutElement, IPointerClickHandler, ISubmitHandler, IUpdateSelectedHandler

Description
Turn a simple label into a interactable input eld.

Properties
asteriskChar

The character used for password elds.

caretBlinkRate

The blinking rate of the input caret, de ned as the number of times the blink cycle
occurs per second.

caretColor

The custom caret color used if customCaretColor is set.

caretPosition

Current InputField caret position (also selection tail).

caretWidth

The width of the caret in pixels.

characterLimit

How many characters the input eld is limited to. 0 = in nite.

characterValidation

The type of validation to perform on a character.

contentType

Speci es the type of the input text content.

customCaretColor

Should a custom caret color be used or should the textComponent.color be used.

inputType

The type of input expected. See InputField.InputType.

isFocused

Does the InputField currently have focus and is able to process events.

keyboardType

They type of mobile keyboard that will be used.

lineType

The LineType used by the InputField.

multiLine

If the input eld supports multiple lines.

onEndEdit

The Unity Event to call when editing has ended.

onValidateInput

The function to call to validate the input characters.

onValueChanged

Accessor to the OnChangeEvent.

placeholder

This is an optional ‘empty’ graphic to show that the InputField text eld is empty.

readOnly

Set the InputField to be read only.

selectionAnchorPosition

The beginning point of the selection.

selectionColor

The color of the highlight to show which characters are selected.

selectionFocusPosition

The end point of the selection.

shouldHideMobileInput

Should the mobile keyboard input be hidden.

text

The current value of the input eld.

textComponent

The Text component that is going to be used to render the text to screen.

touchScreenKeyboard

The TouchScreenKeyboard being used to edit the Input Field.

wasCanceled

If the InputField was canceled and will revert back to the original text upon
DeactivateInputField.

Public Methods
ActivateInputField

Function to activate the InputField to begin processing Events.

DeactivateInputField

Function to deactivate the InputField to stop the processing of Events and send
OnSubmit if not canceled.

ForceLabelUpdate

Force the label to update immediatly. This will recalculate the positioning of the
caret and the visible text.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

MoveTextEnd

Move the caret index to end of text.

MoveTextStart

Move the caret index to start of text.

OnBeginDrag

Capture the OnBeginDrag callback from the EventSystem and ensure we should
listen to the drag events to follow.

OnDeselect

What to do when the event system sends a Deselect Event.

OnDrag

What to do when the event system sends a Drag Event.

OnEndDrag

Capture the OnEndDrag callback from the EventSystem and cancel the listening of
drag events.

OnPointerClick

What to do when the event system sends a pointer click Event.

OnPointerDown

What to do when the event system sends a pointer down Event.

OnSubmit

What to do when the event system sends a submit Event.

OnUpdateSelected

What to do when the event system sends a Update selected Event.

ProcessEvent

Helper function to allow separate events to be processed by the InputField.

Rebuild

Rebuild the input elds geometry. (caret and highlight).

Protected Methods
Append

Append a character to the input eld.

ClampPos

Clamp a value (by reference) between 0 and the current text length.

GetCharacterIndexFromPosition

The character that is under the mouse.

KeyPressed

Process the Event and perform the appropriate action for that key.

OnDisable

See MonoBehaviour.OnDisable.

OnFocus

Focus the input eld initializing properties.

SelectAll

Highlight the whole InputField.

SendOnSubmit

Convenience function to make functionality to send the SubmitEvent
easier.

UpdateLabel

Update the Text associated with this input eld.

Validate

Prede ned validation functionality for di erent characterValidation types.

Delegates
OnValidateInput

Custom validation callback.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

FindSelectableOnDown

Find the selectable object below this one.

FindSelectableOnLeft

Find the selectable object to the left of this one.

FindSelectableOnRight

Find the selectable object to the right of this one.

FindSelectableOnUp

Find the selectable object above this one.

IsInteractable

UI.Selectable.IsInteractable.

OnMove

Determine in which of the 4 move directions the next selectable object should
be found.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
The callback sent anytime the Input eld is updated.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Unity Event with a input eld as a param.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
The type of characters that are allowed to be added to the string.
Note that the character validation does not validate the entire string as being valid or not. It only does validation
on a per-character level, resulting in the typed character either being added to the string or not.

Properties
None

No validation. Any input is valid.

Integer

Allow whole numbers (positive or negative).

Decimal

Allows decimal numbers (positive or negative). Characters 0-9, . (dot), and - (dash / minus
sign) are allowed. The dash is only allowed as the rst character. Only one dot in the string
is allowed.

Alphanumeric

Allows letters A-Z, a-z and numbers 0-9.

Name

Only allow names and enforces capitalization.

EmailAddress

Allows the characters that are allowed in an email address.

Leave feedback

Description
Speci es the type of the input text content.
The ContentType a ects character validation, keyboard type used (on platforms with on-screen keyboards),
whether the InputField accepts multiple lines, and whether the text is autocorrected (on platforms that o er input
auto-correction) or is treated as a password where the characters are not shown directly.

Properties
Standard

Allows all input.

Autocorrected

Allows all input and performs auto-correction on platforms that support it.

IntegerNumber

Allow whole numbers (positive or negative).

DecimalNumber

Allows decimal numbers (positive or negative).

Alphanumeric

Allows letters A-Z, a-z and numbers 0-9.

Name

The InputField is used for typing in a name, and enforces capitalization of the rst letter of
each word. Note that the user can circumvent the rst letter capitalization rules by
deleting automatically-capitalized letters.

EmailAddress

The input is used for typing in an email address.

Password

Allows all input and hides the typed characters by showing them as asterisks characters.

Pin

Allows integer numbers and hides the typed characters by showing them as asterisks
characters.

Custom

Custom types that allows user-de ned settings.

Leave feedback

Description
Type of data expected by the input eld.

Properties
Standard

The standard mobile keyboard.

AutoCorrect

The mobile autocorrect keyboard.

Password

The mobile password keyboard.

Leave feedback

Description
The LineType is used to describe the behavior of the InputField.

Properties
SingleLine

Only allows 1 line to be entered. Has horizontal scrolling and no word wrap. Pressing
enter will submit the InputField.

MultiLineSubmit

Is a multiline InputField with vertical scrolling and over ow. Pressing the return key will
submit.

MultiLineNewline

Is a multiline InputField with vertical scrolling and over ow. Pressing the return key will
insert a new line character.

Leave feedback
Implements interfaces:ILayoutElement, ILayoutIgnorer

Description
Add this component to a GameObject to make it into a layout element or override values on an existing layout
element.
See Also: Auto Layout.

Properties
exibleHeight

The extra relative height this layout element should be allocated if there is additional
available space.

exibleWidth

The extra relative width this layout element should be allocated if there is additional
available space.

ignoreLayout

Should this RectTransform be ignored by the layout system?

layoutPriority

Called by the layout system.

minHeight

The minimum height this layout element may be allocated.

minWidth

The minimum width this layout element may be allocated.

preferredHeight

The preferred height this layout element should be allocated if there is su cient space.

preferredWidth

The preferred width this layout element should be allocated if there is su cient space.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

SetDirty

Mark the LayoutElement as dirty.

Inherited Members
Properties

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every

repeatRate seconds.
IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ILayoutController, ILayoutElement, ILayoutGroup

Description
Abstract base class to use for layout groups.

Properties
childAlignment

The alignment to use for the child layout elements in the layout group.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

padding

The padding to add around the child layout elements.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

Protected Methods
GetAlignmentOnAxis

Returns the alignment on the speci ed axis as a fraction where 0 is
left/top, 0.5 is middle, and 1 is right/bottom.

GetStartO set

Returns the calculated position of the rst child layout element along the
given axis.

GetTotalFlexibleSize

The exible size for the layout group on the given axis.

GetTotalMinSize

The min size for the layout group on the given axis.

GetTotalPreferredSize

The preferred size for the layout group on the given axis.

OnDidApplyAnimationProperties

Callback for when properties have been changed by animation.

OnDisable

See MonoBehaviour.OnDisable.

SetChildAlongAxis

Set the position and size of a child layout element along the given axis.

SetDirty

Mark the LayoutGroup as dirty.

SetLayoutInputForAxis

Used to set the calculated layout properties for the given axis.

SetProperty

Helper method used to set a given property if it has changed.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its

dimensions changed.
OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ICanvasElement

Description
Wrapper class for managing layout rebuilding of CanvasElement.

Properties
transform

See ICanvasElement.

Public Methods
Equals

Does the passed rebuilder point to the same CanvasElement.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

IsDestroyed

Has the native representation of this LayoutRebuilder been destroyed?

LayoutComplete

See ICanvasElement.LayoutComplete.

Rebuild

See ICanvasElement.Rebuild.

Static Methods
ForceRebuildLayoutImmediate

Forces an immediate rebuild of the layout element and child layout elements
a ected by the calculations.

MarkLayoutForRebuild

Mark the given RectTransform as needing it's layout to be recalculated
during the next layout pass.

Leave feedback

Description
Utility functions for querying layout elements for their minimum, preferred, and exible sizes.
See Also: Auto Layout.

Static Methods
GetFlexibleHeight

Returns the exible height of the layout element.

GetFlexibleSize

Returns the exible size of the layout element.

GetFlexibleWidth

Returns the exible width of the layout element.

GetLayoutProperty

Gets a calculated layout property for the layout element with the given RectTransform.

GetMinHeight

Returns the minimum height of the layout element.

GetMinSize

Returns the minimum size of the layout element.

GetMinWidth

Returns the minimum width of the layout element.

GetPreferredHeight

Returns the preferred height of the layout element.

GetPreferredSize

Returns the preferred size of the layout element.

GetPreferredWidth

Returns the preferred width of the layout element.

Leave feedback
Implements interfaces:ICanvasRaycastFilter, IMaterialModi er

Description
A component for masking children elements.
By using this element any children elements that have masking enabled will mask where a sibling Graphic would
write 0 to the stencil bu er.

Properties
graphic

The graphic associated with the Mask.

rectTransform

Cached RectTransform.

showMaskGraphic

Show the graphic that is associated with the Mask render area.

Public Methods
GetModi edMaterial

See: IMaterialModi er.

IsRaycastLocationValid

See:ICanvasRaycastFilter.

MaskEnabled

See:IMask.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the

editor).
useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

p
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this

object's collider (2D physics only).
OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:IClippable, IMaskable, IMaterialModi er

Description
A Graphic that is capable of being masked out.

Properties
maskable

Does this graphic allow masking.

onCullStateChanged

Callback issued when culling changes.

Public Methods
Cull

See IClippable.Cull.

GetModi edMaterial

See IMaterialModi er.GetModi edMaterial.

RecalculateClipping

See: IClippable.RecalculateClipping.

RecalculateMasking

See: IMaskable.RecalculateMasking.

SetClipRect

See IClippable.SetClipRect.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Static Properties
defaultGraphicMaterial

Default material used to draw UI elements if no explicit material was speci ed.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

canvas

A reference to the Canvas this Graphic is rendering to.

canvasRenderer

The CanvasRenderer used by this Graphic.

color

Base color of the Graphic.

defaultMaterial

Returns the default material for the graphic.

depth

Absolute depth of the graphic in the hierarchy, used by rendering and events.

mainTexture

The graphic's texture. (Read Only).

material

The Material set by the user.

materialForRendering

The material that will be sent for Rendering (Read only).

raycastTarget

Should this graphic be considered a target for raycasting?

rectTransform

The RectTransform component used by the Graphic.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this
game object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached,
null if it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its
children using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its
parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its
children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its

parents.
SendMessage

Calls the method named methodName on every MonoBehaviour in this
game object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this
game object and on every ancestor of the behaviour.

CrossFadeAlpha

Tweens the alpha of the CanvasRenderer color associated with this
Graphic.

CrossFadeColor

Tweens the CanvasRenderer color associated with this Graphic.

GetPixelAdjustedRect

Returns a pixel perfect Rect closest to the Graphic RectTransform.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnCullingChanged

Callback function to call when the culling has changed.

OnRebuildRequested

Editor-only callback that is issued by Unity if a rebuild of the Graphic is
required.

PixelAdjustPoint

Adjusts the given pixel to be pixel perfect.

Raycast

When a GraphicRaycaster is raycasting into the Scene it does two things.
First it lters the elements using their RectTransform rect. Then it uses this
Raycast function to determine the elements hit by the raycast.

Rebuild

Rebuilds the graphic geometry and its material on the PreRender cycle.

RegisterDirtyLayoutCallback

Add a listener to receive noti cation when the graphics layout is dirtied.

RegisterDirtyMaterialCallback

Add a listener to receive noti cation when the graphics material is dirtied.

RegisterDirtyVerticesCallback

Add a listener to receive noti cation when the graphics vertices are dirtied.

SetAllDirty

Mark the Graphic as dirty.

SetLayoutDirty

Mark the layout as dirty.

SetMaterialDirty

Mark the Material as dirty.

SetNativeSize

Adjusts the graphic size to make it pixel-perfect.

SetVerticesDirty

Mark the vertices as dirty.

UnregisterDirtyLayoutCallback

Remove a listener from receiving noti cations when the graphics layout is
dirtied.

UnregisterDirtyMaterialCallback

Remove a listener from receiving noti cations when the graphics material
is dirtied.

UnregisterDirtyVerticesCallback

Remove a listener from receiving noti cations when the graphics vertices
are dirtied.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in
routine running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been
destroyed.

Protected Methods
OnPopulateMesh

Callback function when a UI element needs to generate vertices.

UpdateGeometry

Call to update the geometry of the Graphic onto the CanvasRenderer.

UpdateMaterial

Call to update the Material of the graphic onto the CanvasRenderer.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Mask related utility class.
This class provides masking-speci c utility functions.

Static Methods
FindRootSortOverrideCanvas

Find a root Canvas.

GetRectMaskForClippable

Find the correct RectMask2D for a given IClippable.

GetRectMasksForClip

Search for all RectMask2D that apply to the given RectMask2D (includes self).

GetStencilDepth

Find the stencil depth for a given element.

IsDescendantOrSelf

Helper function to determine if the child is a descendant of father or is father.

Notify2DMaskStateChanged

Notify all IClippables under the given component that they need to recalculate
clipping.

NotifyStencilStateChanged

Notify all IMaskable under the given component that they need to recalculate
masking.

Leave feedback

Description
Structure storing details related to navigation.

Static Properties
defaultNavigation

Return a Navigation with sensible default values.

Properties
mode

Navigation mode.

selectOnDown

Specify a Selectable UI GameObject to highlight when the down arrow key is pressed.

selectOnLeft

Specify a Selectable UI GameObject to highlight when the left arrow key is pressed.

selectOnRight

Specify a Selectable UI GameObject to highlight when the right arrow key is pressed.

selectOnUp

Specify a Selectable UI GameObject to highlight when the Up arrow key is pressed.

Leave feedback

Description
Navigation mode. Used by Selectable.

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class ExampleClass : MonoBehaviour
{
public Button button;

void Start()
{
//Set the navigation to the mode "Vertical".
if (button.navigation.mode == Navigation.Mode.Vertical)
{
Debug.Log("The button's navigation mode is Vertical");
}
}
}

Properties
None

No navigation.

Horizontal

Horizontal Navigation.

Vertical

Vertical navigation.

Automatic

Automatic navigation.

Explicit

Explicit navigaion.

Leave feedback

Description
Adds an outline to a graphic using IVertexModi er.
Modify the generated vertices to add an outline to a sibling Graphic.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

e ectColor

Color for the e ect.

e ectDistance

How far is the shadow from the graphic.

useGraphicAlpha

Should the shadow inherit the alpha from the graphic?

Public Methods
ModifyMesh

See:IMeshModi er.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

ModifyMesh

See: IMeshModi er.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

ApplyShadow

Duplicate vertices from start to end and turn them into shadows with
the given o set.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages

Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be

created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
An IVertexModi er which sets the raw vertex position into UV1 of the generated verts.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ModifyMesh

See:IMeshModi er.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its

dimensions changed.
OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Displays a Texture2D for the UI System.
Keep in mind that this will create an extra draw call with each RawImage present, so it's best to use it only for
backgrounds or temporary visible graphics.

Properties
mainTexture

The RawImage's texture. (ReadOnly).

texture

The RawImage's texture.

uvRect

The RawImage texture coordinates.

Public Methods
SetNativeSize

Adjusts the raw image size to make it pixel-perfect.

Inherited Members
Static Properties
defaultGraphicMaterial

Default material used to draw UI elements if no explicit material was speci ed.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

canvas

A reference to the Canvas this Graphic is rendering to.

canvasRenderer

The CanvasRenderer used by this Graphic.

color

Base color of the Graphic.

defaultMaterial

Returns the default material for the graphic.

depth

Absolute depth of the graphic in the hierarchy, used by rendering and events.

mainTexture

The graphic's texture. (Read Only).

material

The Material set by the user.

materialForRendering

The material that will be sent for Rendering (Read only).

raycastTarget

Should this graphic be considered a target for raycasting?

rectTransform

The RectTransform component used by the Graphic.

maskable

Does this graphic allow masking.

onCullStateChanged

Callback issued when culling changes.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this
game object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached,
null if it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its
children using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its
parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its
children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its
parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this
game object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this
game object and on every ancestor of the behaviour.

CrossFadeAlpha

Tweens the alpha of the CanvasRenderer color associated with this
Graphic.

CrossFadeColor

Tweens the CanvasRenderer color associated with this Graphic.

GetPixelAdjustedRect

Returns a pixel perfect Rect closest to the Graphic RectTransform.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnCullingChanged

Callback function to call when the culling has changed.

OnRebuildRequested

Editor-only callback that is issued by Unity if a rebuild of the Graphic is
required.

PixelAdjustPoint

Adjusts the given pixel to be pixel perfect.

Raycast

When a GraphicRaycaster is raycasting into the Scene it does two things.
First it lters the elements using their RectTransform rect. Then it uses this
Raycast function to determine the elements hit by the raycast.

Rebuild

Rebuilds the graphic geometry and its material on the PreRender cycle.

RegisterDirtyLayoutCallback

Add a listener to receive noti cation when the graphics layout is dirtied.

RegisterDirtyMaterialCallback

Add a listener to receive noti cation when the graphics material is dirtied.

RegisterDirtyVerticesCallback

Add a listener to receive noti cation when the graphics vertices are dirtied.

SetAllDirty

Mark the Graphic as dirty.

SetLayoutDirty

Mark the layout as dirty.

SetMaterialDirty

Mark the Material as dirty.

SetVerticesDirty

Mark the vertices as dirty.

UnregisterDirtyLayoutCallback

Remove a listener from receiving noti cations when the graphics layout is
dirtied.

UnregisterDirtyMaterialCallback

Remove a listener from receiving noti cations when the graphics material
is dirtied.

UnregisterDirtyVerticesCallback

Remove a listener from receiving noti cations when the graphics vertices
are dirtied.

Cull

See IClippable.Cull.

GetModi edMaterial

See IMaterialModi er.GetModi edMaterial.

RecalculateClipping

See: IClippable.RecalculateClipping.

RecalculateMasking

See: IMaskable.RecalculateMasking.

SetClipRect

See IClippable.SetClipRect.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in
routine running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been
destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

OnPopulateMesh

Callback function when a UI element needs to generate vertices.

UpdateGeometry

Call to update the geometry of the Graphic onto the CanvasRenderer.

UpdateMaterial

Call to update the Material of the graphic onto the CanvasRenderer.

OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also

pickable and always drawn.
OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ICanvasRaycastFilter, IClipper

Description
A 2D rectangular mask that allows for clipping / masking of areas outside the mask.
The RectMask2D behaves in a similar way to a standard Mask component. It di ers though in some of the
restrictions that it has.
A RectMask2D: *Only works in the 2D plane *Requires elements on the mask to be coplanar. *Does not require
stencil bu er / extra draw calls *Requres fewer draw calls *Culls elements that are outside the mask area.

Properties
canvasRect

Get the Rect for the mask in canvas space.

rectTransform

Get the RectTransform for the mask.

Public Methods
AddClippable

Add a [IClippable]] to be tracked by the mask.

IsRaycastLocationValid

See:ICanvasRaycastFilter.

PerformClipping

See: IClipper.PerformClipping.

RemoveClippable

Remove an IClippable from being tracked by the mask.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:IBeginDragHandler, ICanvasElement, IDragHandler, IEventSystemHandler,
IInitializePotentialDragHandler

Description
A standard scrollbar with a variable sized handle that can be dragged between 0 and 1.
The slider component is a Selectable that controls a handle which follow the current value and is sized accoring to
the size property.
The anchors of the handle RectTransforms are driven by the Scrollbar. The handle can be a direct child of the
GameObject with the Scrollbar, or intermediary RectTransforms can be placed in between for additional control.
When a change to the scrollbar value occurs, a callback is sent to any registered listeners of onValueChanged.

Properties
direction

The direction of the scrollbar from minimum to maximum value.

handleRect

The RectTransform to use for the handle.

numberOfSteps

The number of steps to use for the value. A value of 0 disables use of steps.

onValueChanged

Handling for when the scrollbar value is changed.

size

The size of the scrollbar handle where 1 means it lls the entire scrollbar.

value

The current value of the scrollbar, between 0 and 1.

Public Methods
FindSelectableOnDown

See member in base class.

FindSelectableOnLeft

See member in base class.

FindSelectableOnRight

See member in base class.

FindSelectableOnUp

See member in base class.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnBeginDrag

Handling for when the scrollbar value is beginning to be dragged.

OnDrag

Handling for when the scrollbar value is dragged.

OnInitializePotentialDrag

See: IInitializePotentialDragHandler.OnInitializePotentialDrag.

OnMove

Handling for movement events.

OnPointerDown

Event triggered when pointer is pressed down on the scrollbar.

OnPointerUp

Event triggered when pointer is released after pressing on the scrollbar.

Rebuild

Handling for when the canvas is rebuilt.

SetDirection

Set the direction of the scrollbar, optionally setting the layout as well.

Protected Methods
ClickRepeat

Coroutine function for handling continual press during Scrollbar.OnPointerDown.

OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
UnityEvent callback for when a scrollbar is scrolled.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Setting that indicates one of four directions.

Properties
LeftToRight

From left to right.

RightToLeft

From right to left.

BottomToTop

From bottom to top.

TopToBottom

From top to bottom.

Leave feedback
Implements interfaces:IBeginDragHandler, ICanvasElement, IDragHandler, IEndDragHandler,
IEventSystemHandler, IInitializePotentialDragHandler, ILayoutController, ILayoutElement, ILayoutGroup,
IScrollHandler

Description
A component for making a child RectTransform scroll.
ScrollRect will not do any clipping on its own. Combined with a Mask component, it can be turned into a scroll
view.

Properties
content

The content that can be scrolled. It should be a child of the GameObject with
ScrollRect on it.

decelerationRate

The rate at which movement slows down.

elasticity

The amount of elasticity to use when the content moves beyond the scroll
rect.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

horizontal

Should horizontal scrolling be enabled?

horizontalNormalizedPosition

The horizontal scroll position as a value between 0 and 1, with 0 being at the
left.

horizontalScrollbar

Optional Scrollbar object linked to the horizontal scrolling of the ScrollRect.

horizontalScrollbarSpacing

The space between the scrollbar and the viewport.

horizontalScrollbarVisibility

The mode of visibility for the horizontal scrollbar.

inertia

Should movement inertia be enabled?

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

movementType

The behavior to use when the content moves beyond the scroll rect.

normalizedPosition

The scroll position as a Vector2 between (0,0) and (1,1) with (0,0) being the
lower left corner.

onValueChanged

Callback executed when the position of the child changes.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

scrollSensitivity

The sensitivity to scroll wheel and track pad scroll events.

velocity

The current velocity of the content.

vertical

Should vertical scrolling be enabled?

verticalNormalizedPosition

The vertical scroll position as a value between 0 and 1, with 0 being at the
bottom.

verticalScrollbar

Optional Scrollbar object linked to the vertical scrolling of the ScrollRect.

verticalScrollbarSpacing

The space between the scrollbar and the viewport.

verticalScrollbarVisibility

The mode of visibility for the vertical scrollbar.

viewport

Reference to the viewport RectTransform that is the parent of the content
RectTransform.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

IsActive

See member in base class.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnBeginDrag

Handling for when the content is being dragged.

OnDrag

Handling for when the content is dragged.

OnEndDrag

Handling for when the content has nished being dragged.

OnInitializePotentialDrag

See: IInitializePotentialDragHandler.OnInitializePotentialDrag.

OnScroll

See IScrollHandler.OnScroll.

Rebuild

Rebuilds the scroll rect data after initialization.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

StopMovement

Sets the velocity to zero on both axes so the content stops moving.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

SetContentAnchoredPosition

Sets the anchored position of the content.

SetDirty

Override to alter or add to the code that keeps the appearance of the scroll
rect synced with its data.

SetDirtyCaching

Override to alter or add to the code that caches data to avoid repeated heavy
operations.

SetNormalizedPosition

Set the horizontal or vertical scroll position as a value between 0 and 1, with 0
being at the left or at the bottom.

UpdateBounds

Calculate the bounds the ScrollRect should be using.

UpdatePrevData

Helper function to update the previous data elds on a ScrollRect. Call this
before you change data in the ScrollRect.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Event type used by the ScrollRect.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
A setting for which behavior to use when content moves beyond the con nes of its container.

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class ExampleClass : MonoBehaviour
{
public ScrollRect myScrollRect;
public Scrollbar newScrollBar;

//Called when a button is pressed
public void Example(int option)
{
if (option == 0)
{
myScrollRect.movementType = ScrollRect.MovementType.Clamped;
}
else if (option == 1)
{
myScrollRect.movementType = ScrollRect.MovementType.Elastic;
}
else if (option == 2)
{
myScrollRect.movementType = ScrollRect.MovementType.Unrestricted;
}
}
}

Properties
Unrestricted

Unrestricted movement. The content can move forever.

Elastic

Elastic movement. The content is allowed to temporarily move beyond the container, but
is pulled back elastically.

Clamped

Clamped movement. The content can not be moved beyond its container.

Leave feedback

Description
Enum for which behavior to use for scrollbar visibility.

Properties
Permanent

Always show the scrollbar.

AutoHide

Automatically hide the scrollbar when no scrolling is needed on this axis. The
viewport rect will not be changed.

AutoHideAndExpandViewport

Automatically hide the scrollbar when no scrolling is needed on this axis, and
expand the viewport rect accordingly.

Leave feedback
Implements interfaces:IDeselectHandler, IEventSystemHandler, IMoveHandler, IPointerDownHandler,
IPointerEnterHandler, IPointerExitHandler, IPointerUpHandler, ISelectHandler

Description
Simple selectable object - derived from to create a selectable control.

Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
FindSelectable

Finds the selectable object next to this one.

FindSelectableOnDown

Find the selectable object below this one.

FindSelectableOnLeft

Find the selectable object to the left of this one.

FindSelectableOnRight

Find the selectable object to the right of this one.

FindSelectableOnUp

Find the selectable object above this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnMove

Determine in which of the 4 move directions the next selectable object should be
found.

OnPointerDown

Evaluate current state and transition to pressed state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

OnDisable

See MonoBehaviour.OnDisable.

UpdateSelectionState

Internally update the selection state of the Selectable.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene

receiving OnDestroy.
OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be

created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
An enumeration of selected states of objects.

Properties
Normal

The UI object can be selected.

Highlighted

The UI object is highlighted.

Pressed

The UI object is pressed.

Disabled

The UI object cannot be selected.

Leave feedback

Description
Transition mode for a Selectable.

Properties
None

No Transition.

ColorTint

Use an color tint transition.

SpriteSwap

Use a sprite swap transition.

Animation

Use an animation transition.

Leave feedback

Description
Adds an outline to a graphic using IVertexModi er.
See:IVertexModi er.

Properties
e ectColor

Color for the e ect.

e ectDistance

How far is the shadow from the graphic.

useGraphicAlpha

Should the shadow inherit the alpha from the graphic?

Public Methods
ModifyMesh

See: IMeshModi er.

Protected Methods
ApplyShadow

Duplicate vertices from start to end and turn them into shadows with the given o set.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with

Network.Instantiate.
OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ICanvasElement, IDragHandler, IEventSystemHandler, IInitializePotentialDragHandler

Description
A standard slider that can be moved between a minimum and maximum value.
The slider component is a Selectable that controls a ll, a handle, or both. The ll, when used, spans from the
minimum value to the current value while the handle, when used, follow the current value.
The anchors of the ll and handle RectTransforms are driven by the Slider. The ll and handle can be direct
children of the GameObject with the Slider, or intermediary RectTransforms can be placed in between for
additional control.
When a change to the slider value occurs, a callback is sent to any registered listeners of Slider.onValueChanged.

Properties
direction
llRect

The direction of the slider, from minimum to maximum value.
Optional RectTransform to use as ll for the slider.

handleRect

Optional RectTransform to use as a handle for the slider.

maxValue

The maximum allowed value of the slider.

minValue

The minimum allowed value of the slider.

normalizedValue

The current value of the slider normalized into a value between 0 and 1.

onValueChanged

Callback executed when the value of the slider is changed.

value

The current value of the slider.

wholeNumbers

Should the value only be allowed to be whole numbers?

Public Methods
FindSelectableOnDown

See member in base class.

FindSelectableOnLeft

See member in base class.

FindSelectableOnRight

See member in base class.

FindSelectableOnUp

See member in base class.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnDrag

Handling for when the slider is dragged.

OnInitializePotentialDrag

See: IInitializePotentialDragHandler.OnInitializePotentialDrag.

OnMove

Handling for movement events.

Rebuild

Handling for when the canvas is rebuilt.

SetDirection

Sets the direction of this slider, optionally changing the layout as well.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Set

Set the value of the slider.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnPointerDown

Evaluate current state and transition to pressed state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
Event type used by the Slider.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Setting that indicates one of four directions.

Properties
LeftToRight

From left to right.

RightToLeft

From right to left.

BottomToTop

From bottom to top.

TopToBottom

From top to bottom.

Leave feedback

Description
Structure to store the state of a sprite transition on a Selectable.

Properties
disabledSprite

Disabled sprite.

highlightedSprite

Highlighted sprite.

pressedSprite

Pressed sprite.

Leave feedback
Implements interfaces:ILayoutElement

Description
The default Graphic to draw font data to screen.

Properties
alignByGeometry

Use the extents of glyph geometry to perform horizontal alignment rather
than glyph metrics.

alignment

The positioning of the text reliative to its RectTransform.

cachedTextGenerator

The cached TextGenerator used when generating visible Text.

cachedTextGeneratorForLayout

The cached TextGenerator used when determine Layout.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

font

The Font used by the text.

fontSize

The size that the Font should render at.

fontStyle

FontStyle used by the text.

horizontalOver ow

Horizontal over ow mode.

layoutPriority

Called by the layout system.

lineSpacing

Line spacing, speci ed as a factor of font line height. A value of 1 will
produce normal line spacing.

mainTexture

The Texture that comes from the Font.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

pixelsPerUnit

(Read Only) Provides information about how fonts are scale to the screen.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

resizeTextForBestFit

Should the text be allowed to auto resized.

resizeTextMaxSize

The maximum size the text is allowed to be. 1 = in nitly large.

resizeTextMinSize

The minimum size the text is allowed to be.

supportRichText

Whether this Text will support rich text.

text

The string value this Text displays.

verticalOver ow

Vertical over ow mode.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

FontTextureChanged

Called by the [FontUpdateTracker] when the texture associated with a font
is modi ed.

GetGenerationSettings

Convenience function to populate the generation setting for the text.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Static Methods
GetTextAnchorPivot

Convenience function to determine the vector o set of the anchor.

Inherited Members
Static Properties
defaultGraphicMaterial

Default material used to draw UI elements if no explicit material was speci ed.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

canvas

A reference to the Canvas this Graphic is rendering to.

canvasRenderer

The CanvasRenderer used by this Graphic.

color

Base color of the Graphic.

defaultMaterial

Returns the default material for the graphic.

depth

Absolute depth of the graphic in the hierarchy, used by rendering and events.

mainTexture

The graphic's texture. (Read Only).

material

The Material set by the user.

materialForRendering

The material that will be sent for Rendering (Read only).

raycastTarget

Should this graphic be considered a target for raycasting?

rectTransform

The RectTransform component used by the Graphic.

maskable

Does this graphic allow masking.

onCullStateChanged

Callback issued when culling changes.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this
game object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached,
null if it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its
children using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its
parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its
children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its

parents.
SendMessage

Calls the method named methodName on every MonoBehaviour in this
game object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this
game object and on every ancestor of the behaviour.

CrossFadeAlpha

Tweens the alpha of the CanvasRenderer color associated with this
Graphic.

CrossFadeColor

Tweens the CanvasRenderer color associated with this Graphic.

GetPixelAdjustedRect

Returns a pixel perfect Rect closest to the Graphic RectTransform.

GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnCullingChanged

Callback function to call when the culling has changed.

OnRebuildRequested

Editor-only callback that is issued by Unity if a rebuild of the Graphic is
required.

PixelAdjustPoint

Adjusts the given pixel to be pixel perfect.

Raycast

When a GraphicRaycaster is raycasting into the Scene it does two things.
First it lters the elements using their RectTransform rect. Then it uses this
Raycast function to determine the elements hit by the raycast.

Rebuild

Rebuilds the graphic geometry and its material on the PreRender cycle.

RegisterDirtyLayoutCallback

Add a listener to receive noti cation when the graphics layout is dirtied.

RegisterDirtyMaterialCallback

Add a listener to receive noti cation when the graphics material is dirtied.

RegisterDirtyVerticesCallback

Add a listener to receive noti cation when the graphics vertices are dirtied.

SetAllDirty

Mark the Graphic as dirty.

SetLayoutDirty

Mark the layout as dirty.

SetMaterialDirty

Mark the Material as dirty.

SetNativeSize

Adjusts the graphic size to make it pixel-perfect.

SetVerticesDirty

Mark the vertices as dirty.

UnregisterDirtyLayoutCallback

Remove a listener from receiving noti cations when the graphics layout is
dirtied.

UnregisterDirtyMaterialCallback

Remove a listener from receiving noti cations when the graphics material
is dirtied.

UnregisterDirtyVerticesCallback

Remove a listener from receiving noti cations when the graphics vertices
are dirtied.

Cull

See IClippable.Cull.

GetModi edMaterial

See IMaterialModi er.GetModi edMaterial.

RecalculateClipping

See: IClippable.RecalculateClipping.

RecalculateMasking

See: IMaskable.RecalculateMasking.

SetClipRect

See IClippable.SetClipRect.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in
routine running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been
destroyed.

Protected Methods
OnPopulateMesh

Callback function when a UI element needs to generate vertices.

UpdateGeometry

Call to update the geometry of the Graphic onto the CanvasRenderer.

UpdateMaterial

Call to update the Material of the graphic onto the CanvasRenderer.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback
Implements interfaces:ICanvasElement, IEventSystemHandler, IPointerClickHandler, ISubmitHandler

Description
A standard toggle that has an on / o state.
The toggle component is a Selectable that controls a child graphic which displays the on / o state.
When a toggle event occurs a callback is sent to any registered listeners of Toggle.onValueChanged.

Properties
graphic

Graphic a ected by the toggle.

group

Group the toggle belongs to.

isOn

Return or set whether the Toggle is on or not.

onValueChanged

Callback executed when the value of the toggle is changed.

toggleTransition

Transition mode for the toggle.

Public Methods
GraphicUpdateComplete

See ICanvasElement.GraphicUpdateComplete.

LayoutComplete

See ICanvasElement.LayoutComplete.

OnPointerClick

Handling for when the toggle is 'clicked'.

OnSubmit

Handling for when the submit key is pressed.

Rebuild

Handling for when the canvas is rebuilt.

Protected Methods
OnDisable

See MonoBehaviour.OnDisable.

Inherited Members
Static Properties
allSelectables

List of all the selectable objects currently active in the Scene.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationTriggers

The AnimationTriggers for this selectable object.

animator

Convenience function to get the Animator component on the GameObject.

colors

The ColorBlock for this selectable object.

image

Convenience function that converts the referenced Graphic to a Image, if possible.

interactable

Use to enable or disable the ability to select a selectable UI element (for example, a
Button).

navigation

The Navigation setting for this selectable object.

spriteState

The SpriteState for this selectable object.

targetGraphic

Graphic that will be transitioned upon.

transition

The type of transition that will be applied to the targetGraphic when the state changes.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

FindSelectable

Finds the selectable object next to this one.

FindSelectableOnDown

Find the selectable object below this one.

FindSelectableOnLeft

Find the selectable object to the left of this one.

FindSelectableOnRight

Find the selectable object to the right of this one.

FindSelectableOnUp

Find the selectable object above this one.

IsInteractable

UI.Selectable.IsInteractable.

OnDeselect

Unset selection and transition to appropriate state.

OnMove

Determine in which of the 4 move directions the next selectable object should
be found.

OnPointerDown

Evaluate current state and transition to pressed state.

OnPointerEnter

Evaluate current state and transition to appropriate state.

OnPointerExit

Evaluate current state and transition to normal state.

OnPointerUp

Evaluate eventData and transition to appropriate state.

OnSelect

Set selection and transition to appropriate state.

Select

Selects this Selectable.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
DoStateTransition

Transition the Selectable to the entered state.

InstantClearState

Clear any internal state from the Selectable (used when disabling).

IsHighlighted

Returns whether the selectable is currently 'highlighted' or not.

IsPressed

Whether the current selectable is being pressed.

UpdateSelectionState

Internally update the selection state of the Selectable.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods

print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button

while over the GUIElement or Collider.
OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
UnityEvent callback for when a toggle is toggled.

Inherited Members
Public Methods
GetPersistentEventCount

Get the number of registered persistent listeners.

GetPersistentMethodName

Get the target method name of the listener at index index.

GetPersistentTarget

Get the target component of the listener at index index.

RemoveAllListeners

Remove all non-persisent (ie created from script) listeners from the event.

SetPersistentListenerState

Modify the execution state of a persistent listener.

Static Methods
GetValidMethodInfo

Given an object, function name, and a list of argument types; nd the method that
matches.

Leave feedback

Description
Display settings for when a toggle is activated or deactivated.

Properties
None

Show / hide the toggle instantly.

Fade

Fade the toggle in / out.

Leave feedback

Description
A component that represents a group of Toggles.
When using a group reference the group from a Toggle. Only one member of a group can be active at a time.

Properties
allowSwitchO

Is it allowed that no toggle is switched on?

Public Methods
ActiveToggles

Returns the toggles in this group that are active.

AnyTogglesOn

Are any of the toggles on?

NotifyToggleOn

Notify the group that the given toggle is enabled.

RegisterToggle

Register a toggle with the group.

SetAllTogglesO

Switch all toggles o .

UnregisterToggle

Toggle to unregister.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while

performing a Move.
OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
A utility class that can aid in the generation of meshes for the UI.
This class implements IDisposable to aid with memory management.

using UnityEngine;
using UnityEngine.UI;

public class ExampleClass : MonoBehaviour
{
Mesh m;

void Start()
{
Color32 color32 = Color.red;
using (var vh = new VertexHelper())
{
vh.AddVert(new Vector3(0, 0), color32, new Vector2(0f, 0f));
vh.AddVert(new Vector3(0, 100), color32, new Vector2(0f, 1f));
vh.AddVert(new Vector3(100, 100), color32, new Vector2(1f, 1f));
vh.AddVert(new Vector3(100, 0), color32, new Vector2(1f, 0f));

vh.AddTriangle(0, 1, 2);
vh.AddTriangle(2, 3, 0);
vh.FillMesh(m);
}
}
}

Properties
currentIndexCount

Get the number of indices set on the VertexHelper.

currentVertCount

Current number of vertices in the bu er.

Public Methods

AddTriangle

Add a triangle to the bu er.

AddUIVertexQuad

Add a quad to the stream.

AddUIVertexStream

Add a stream of custom UIVertex and corresponding indices.

AddUIVertexTriangleStream

Add a list of triangles to the stream.

AddVert

Add a single vertex to the stream.

Clear

Clear all vertices from the stream.

Dispose

Cleanup allocated memory.

FillMesh

Fill the given mesh with the stream data.

GetUIVertexStream

Create a stream of UI vertex (in triangles) from the stream.

PopulateUIVertex

Fill a UIVertex with data from index i of the stream.

SetUIVertex

Set a UIVertex at the given index.

Leave feedback

Description
Layout child layout elements below each other.
The VerticalLayoutGroup component is used to layout child layout elements below each other.
See Also: Auto Layout.

Public Methods
CalculateLayoutInputHorizontal

Called by the layout system.

CalculateLayoutInputVertical

Called by the layout system.

SetLayoutHorizontal

Called by the layout system.

SetLayoutVertical

Called by the layout system.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to
a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

childControlHeight

Returns true if the Layout Group controls the heights of its children. Returns false if
children control their own heights.

childControlWidth

Returns true if the Layout Group controls the widths of its children. Returns false if
children control their own widths.

childForceExpandHeight

Whether to force the children to expand to ll additional available vertical space.

childForceExpandWidth

Whether to force the children to expand to ll additional available horizontal space.

spacing

The spacing to use between layout elements in the layout group.

childAlignment

The alignment to use for the child layout elements in the layout group.

exibleHeight

Called by the layout system.

exibleWidth

Called by the layout system.

layoutPriority

Called by the layout system.

minHeight

Called by the layout system.

minWidth

Called by the layout system.

padding

The padding to add around the child layout elements.

preferredHeight

Called by the layout system.

preferredWidth

Called by the layout system.

runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in
the editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every
repeatRate seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine
running on this behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

IsActive

Returns true if the GameObject and the Component are active.

IsDestroyed

Returns true if the native representation of the behaviour has been destroyed.

Protected Methods
CalcAlongAxis

Calculate the layout element properties for this layout element along
the given axis.

SetChildrenAlongAxis

Set the positions and sizes of the child layout elements for the given
axis.

GetAlignmentOnAxis

Returns the alignment on the speci ed axis as a fraction where 0 is
left/top, 0.5 is middle, and 1 is right/bottom.

GetStartO set

Returns the calculated position of the rst child layout element along
the given axis.

GetTotalFlexibleSize

The exible size for the layout group on the given axis.

GetTotalMinSize

The min size for the layout group on the given axis.

GetTotalPreferredSize

The preferred size for the layout group on the given axis.

OnDidApplyAnimationProperties

Callback for when properties have been changed by animation.

OnDisable

See MonoBehaviour.OnDisable.

SetChildAlongAxis

Set the position and size of a child layout element along the given axis.

SetDirty

Mark the LayoutGroup as dirty.

SetLayoutInputForAxis

Used to set the calculated layout properties for the given axis.

SetProperty

Helper method used to set a given property if it has changed.

Awake

See MonoBehaviour.Awake.

OnBeforeTransformParentChanged

See MonoBehaviour.OnBeforeTransformParentChanged.

OnCanvasGroupChanged

See MonoBehaviour.OnCanvasGroupChanged.

OnCanvasHierarchyChanged

Called when the state of the parent Canvas is changed.

OnDestroy

See MonoBehaviour.OnDestroy.

OnDidApplyAnimationProperties

See LayoutGroup.OnDidApplyAnimationProperties.

OnDisable

See MonoBehaviour.OnDisable.

OnEnable

See MonoBehaviour.OnEnable.

OnRectTransformDimensionsChange

This callback is called if an associated RectTransform has its
dimensions changed.

OnTransformParentChanged

See MonoBehaviour.OnRectTransformParentChanged.

OnValidate

See MonoBehaviour.OnValidate.

Reset

See MonoBehaviour.Reset.

Start

See MonoBehaviour.Start.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene

receiving OnDestroy.
OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have

died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.
OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Leave feedback

Description
This is an element that can live on a Canvas.

Properties
transform

Get the transform associated with the ICanvasElement.

Public Methods
GraphicUpdateComplete

Callback sent when this ICanvasElement has completed Graphic rebuild.

IsDestroyed

Return true if the element is considered destroyed. Used if the native
representation has been destroyed.

LayoutComplete

Callback sent when this ICanvasElement has completed layout.

Rebuild

Rebuild the element for the given stage.

Leave feedback

Description
Interface for elements that can be clipped if they are under an [[IClipper].

Properties
gameObject

GameObject of the IClippable.

rectTransform

RectTransform of the clippable.

Public Methods
Cull

Clip and cull the IClippable given the clipRect.

RecalculateClipping

Called when the state of a parent IClippable changes.

SetClipRect

Set the clip rect for the IClippable.

Leave feedback

Description
Interface that can be used to recieve clipping callbacks as part of the canvas update loop.

Public Methods
PerformClipping

Called after layout and before Graphic update of the Canvas update loop.

Leave feedback

Description
Base interface to implement by components that control the layout of RectTransforms.
If a component is driving its own RectTransform it should implement the interface ILayoutSelfController. If a
component is driving the RectTransforms of its children, it should implement ILayoutGroup.
The layout system will rst invoke SetLayoutHorizontal and then SetLayoutVertical.
In the SetLayoutHorizontal call it is valid to call LayoutUtility.GetMinWidth, LayoutUtility.GetPreferredWidth, and
LayoutUtility.GetFlexibleWidth on the RectTransform of itself or any of its children. In the SetLayoutVertical call it
is valid to call LayoutUtility.GetMinHeight, LayoutUtility.GetPreferredHeight, and LayoutUtility.GetFlexibleHeight
on the RectTransform of itself or any of its children.
The component may use this information to determine the width and height to use for its own RectTransform or
the RectTransforms of its children.

Public Methods
SetLayoutHorizontal

Callback invoked by the auto layout system which handles horizontal aspects of the
layout.

SetLayoutVertical

Callback invoked by the auto layout system which handles vertical aspects of the
layout.

Leave feedback

Description
A component is treated as a layout element by the auto layout system if it implements ILayoutElement.
The layout system will invoke CalculateLayoutInputHorizontal before querying minWidth, preferredWidth, and
exibleWidth. It can potentially save performance if these properties are cached when
CalculateLayoutInputHorizontal is invoked, so they don't need to be recalculated every time the properties are
queried.
The layout system will invoke CalculateLayoutInputVertical before querying minHeight, preferredHeight, and
exibleHeight. It can potentially save performance if these properties are cached when
CalculateLayoutInputVertical is invoked, so they don't need to be recalculated every time the properties are
queried.
The minWidth, preferredWidth, and exibleWidth properties should not rely on any properties of the
RectTransform of the layout element, otherwise the behavior will be non-deterministic. The minHeight,
preferredHeight, and exibleHeight properties may rely on horizontal aspects of the RectTransform, such as the
width or the X component of the position. Any properties of the RectTransforms on child layout elements may
always be relied on.
See Also: Auto Layout.

Properties
exibleHeight

The extra relative height this layout element should be allocated if there is additional
available space.

exibleWidth

The extra relative width this layout element should be allocated if there is additional
available space.

layoutPriority

The layout priority of this component.

minHeight

The minimum height this layout element may be allocated.

minWidth

The minimum width this layout element may be allocated.

preferredHeight

The preferred height this layout element should be allocated if there is su cient space.

preferredWidth

The preferred width this layout element should be allocated if there is su cient space.

Public Methods
CalculateLayoutInputHorizontal

The minWidth, preferredWidth, and exibleWidth values may be calculated
in this callback.

CalculateLayoutInputVertical

The minHeight, preferredHeight, and exibleHeight values may be
calculated in this callback.

Leave feedback
Implements interfaces:ILayoutController

Description
ILayoutGroup is an ILayoutController that should drive the RectTransforms of its children.
ILayoutGroup derives from ILayoutController and requires the same members to be implemented.
See Also: ILayoutController.

Leave feedback

Description
A RectTransform will be ignored by the layout system if it has a component which implements ILayoutIgnorer.
A components that implements ILayoutIgnorer can be used to make a parent layout group component not
consider this RectTransform part of the group. The RectTransform can then be manually positioned despite being
a child GameObject of a layout group.
See Also: Auto Layout, LayoutElement.

Properties
ignoreLayout

Should this RectTransform be ignored bvy the layout system?

Leave feedback
Implements interfaces:ILayoutController

Description
ILayoutSelfController is an ILayoutController that should drive its own RectTransform.
The iLayoutSelfController derives from the base controller ILayoutController and controls the layout of a
RectTransform.
Use the ILayoutSelfController to manipulate a GameObject’s own RectTransform component, which you attach in
the Inspector. Use ILayoutGroup to manipulate RectTransforms belonging to the children of the GameObject.
Call ILayoutController.SetLayoutHorizontal to handle horizontal parts of the layout, and call
ILayoutController.SetLayoutVertical to handle vertical parts. You can change the height, width, position and
rotation of the RectTransform.

//This script shows how the GameObject’s own RectTransforms can be changed.
//This creates a rectangle on the screen of the scale, positition and rotation y
//Make sure to set the X and Y scale to be more than 0 to see it

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class Example : UIBehaviour, ILayoutSelfController
{
//Fields in the inspector used to manipulate the RectTransform
public Vector3 m_Position;
public Vector3 m_Rotation;
public Vector2 m_Scale;

//This handles horizontal aspects of the layout (derived from ILayoutControl
public virtual void SetLayoutHorizontal()
{
//Move and Rotate the RectTransform appropriately
UpdateRectTransform();
}

//This handles vertical aspects of the layout
public virtual void SetLayoutVertical()

{
//Move and Rotate the RectTransform appropriately
UpdateRectTransform();
}

//This tells when there is a change in the inspector
#if UNITY_EDITOR
protected override void OnValidate()
{
Debug.Log("Validate");
//Update the RectTransform position, rotation and scale
UpdateRectTransform();
}

#endif

//This tells when there has been a change to the RectTransform's settings in
protected override void OnRectTransformDimensionsChange()
{
//Update the RectTransform position, rotation and scale
UpdateRectTransform();
}

void UpdateRectTransform()
{
//Fetch the RectTransform from the GameObject
RectTransform rectTransform = GetComponent();

//Change the scale of the RectTransform using the fields in the inspecto
rectTransform.localScale = new Vector3(m_Scale.x, m_Scale.y, 0);

//Change the position and rotation of the RectTransform
rectTransform.SetPositionAndRotation(m_Position, Quaternion.Euler(m_Rota
}
}

Leave feedback
Obsolete

Description
Is this element a mask.
Used internally to increment the mask value that is used for rendering.

Leave feedback

Description
This element is capable of being masked out.

Public Methods
RecalculateMasking

Recalculate masking for this element and all children elements.

Leave feedback

Description
Interface which allows for the modi cation of the Material used to render a Graphic before they are passed to the
CanvasRenderer.
When a Graphic sets a material is is passed (in order) to any components on the GameObject that implement
IMaterialModi er. This component can modify the material to be used for rendering.

Public Methods
GetModi edMaterial

Perform material modi cation in this function.

Leave feedback

Description
Interface which allows for the modi cation of verticies in a Graphic before they are passed to the
CanvasRenderer.
When a Graphic generates a list of vertices they are passed (in order) to any components on the GameObject that
implement IMeshModi er. This component can modify the given Mesh.
See Also: BaseMeshE ect.

Public Methods
ModifyMesh

Call used to modify mesh.

Leave feedback
Obsolete

Description
Interface which allows for the modi cation of verticies in a Graphic before they are passed to the
CanvasRenderer.
When a Graphic generates a list of vertices they are passed (in order) to any components on the GameObject that
implement IVertexModi er. This component can modify the vertex list.
See Also: BaseVertexE ect.

Leave feedback

Description
Values of 'update' called on a Canvas update.

Properties
Prelayout

Called before layout.

Layout

Called for layout.

PostLayout

Called after layout.

PreRender

Called before rendering.

LatePreRender

Called late, before render.

MaxUpdateValue

Max enum value.

Leave feedback

Description
A container for video data.
A VideoClip stores the video portion of a movie le using a codec that is appropriate for the target platform.
VideoClips are referenced by VideoPlayers to play videos.

Properties
audioTrackCount

Number of audio tracks in the clip.

frameCount

The length of the VideoClip in frames. (Read Only).

frameRate

The frame rate of the clip in frames/second. (Read Only).

height

The height of the images in the video clip in pixels. (Read Only).

length

The length of the video clip in seconds. (Read Only).

originalPath

The video clip path in the project's assets. (Read Only).

pixelAspectRatioDenominator

Denominator of the pixel aspect ratio (num:den). (Read Only).

pixelAspectRatioNumerator

Numerator of the pixel aspect ratio (num:den). (Read Only).

width

The width of the images in the video clip in pixels. (Read Only).

Public Methods
GetAudioChannelCount

The number of channels in the audio track. E.g. 2 for a stereo track.

GetAudioLanguage

Get the audio track language. Can be unknown.

GetAudioSampleRate

Get the audio track sampling rate in Hertz.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Plays video content onto a target.
Content can be either a VideoClip imported asset or a URL such as file:// or http://. Video content will be
projected onto one of the supported targets, such as camera background or RenderTexture. If the video content
includes transparency, this transparency will be present in the target, allowing objects behind the video target to
be visible. When the data VideoPlayer.source is set to URL, the audio and video description of what is being
played will only be initialized once the VideoPlayer preparation is completed. This can be tested with
VideoPlayer.isPrepared.
Movie File Format Support Notes
The VideoPlayer uses native audio and video decoding libraries in its implementation and it is your responsibility
to use videos that match the requirements for the target platform. The VideoClipImporter o ers an option to
transcode the VideoClip assets into one of H.264 or VP8 video codecs, along with a few options to experiment
with, such as resolution. This uses the matching codec for audio tracks: AAC and Vorbis respectively.
See Also: VideoClipImporter.SetTargetSettings and VideoImporterTargetSettings.enableTranscoding.
You may choose to omit this transcoding and instead use videos that you already know are supported by the
target systems, keeping ner control over the encoding process using an external program. Over time, the
VideoClipImporter editor will provide guidelines and warnings to better help making proper format and encoding
choices.
For now, vendor recommendations must be followed, and are especially constrained on older mobile platforms.
For example, videos you nd on the web will often require inspection and manipulations before they can be used
reliably in the context of a game running on multiple devices. The following are examples of recommendations
and known limitations:
* Android: Supported Media Formats. See additional notes below.
* Windows: H.264 Video Decoder (see Format Constraints)
* iPhone 6-7: Compare iPhone Models (see TV and Video)
The best natively supported video codec for hardware acceleration is H.264, with VP8 being a software decoding
solution that can be used when required. On Android, VP8 is also supported using native libraries and as such
may also be hardware-assisted depending on models. Key values to look for in your encoding parameters:
* Video Codec: H.264 or VP8.
* Resolution: For example: 1280 x 720.
* Pro le: Applicable for H.264. The pro le is a set of capabilities and constraints; vendors often specify this, such
as "Baseline" or "Main". See here.
* Pro le Level: Applicable for H.264. Within a given pro le, the level speci es certain performance requirements
such as "Baseline 3.1". See here.

* Audio Codec: Typically AAC (with mp4 videos using H.264) or Vorbis (with webm videos using VP8).
* Audio Channels: depends on platform. For example, the Android recommendation is for stereo les, but many
devices will accept 5.1.
Android Notes
* Support for resolutions above 640 x 360 is not available on all devices. Runtime checks are done to verify this
and failures will cause the movie to not be played.
* For Jelly Bean/MR1, movies above 1280 x 720 or with more than 2 audio tracks will not be played due to bugs in
the OS libraries.
* For Lollipop and above, any resolution or number of audio channels may be attempted, but will be constrained
by device capabilities.
* The Vulkan graphics API is not yet supported.
* Format compatibility issues are reported in the adb logcat output and are always pre xed with
AndroidVideoMedia.
* Also pay attention to device-speci c error messages located near Unity's error messages: they are not available
to the engine, but often explain what the compatibility issue is.
* Playback from asset bundles is only supported for uncompressed bundles, read directly from disk.
The following demonstrates a few features of the VideoPlayer:

// Examples of VideoPlayer function

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Will attach a VideoPlayer to the main camera.
GameObject camera = GameObject.Find("Main Camera");

// VideoPlayer automatically targets the camera backplane when it is add
// to a camera object, no need to change videoPlayer.targetCamera.
var videoPlayer = camera.AddComponent();

// Play on awake defaults to true. Set it to false to avoid the url set
// below to auto-start playback since we're in Start().
videoPlayer.playOnAwake = false;

// By default, VideoPlayers added to a camera will use the far plane.
// Let's target the near plane instead.
videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.CameraNearPla

// This will cause our Scene to be visible through the video being playe
videoPlayer.targetCameraAlpha = 0.5F;

// Set the video to play. URL supports local absolute or relative paths.
// Here, using absolute.
videoPlayer.url = "/Users/graham/movie.mov";

// Skip the first 100 frames.
videoPlayer.frame = 100;

// Restart from beginning when done.
videoPlayer.isLooping = true;

// Each time we reach the end, we slow down the playback by a factor of
videoPlayer.loopPointReached += EndReached;

// Start playback. This means the VideoPlayer may have to prepare (reser
// resources, pre-load a few frames, etc.). To better control the delays
// associated with this preparation one can use videoPlayer.Prepare() al
// its prepareCompleted event.
videoPlayer.Play();
}

void EndReached(UnityEngine.Video.VideoPlayer vp)
{
vp.playbackSpeed = vp.playbackSpeed / 10.0F;
}
}

MovieTexture Migration Notes
Since the VideoPlayer is fundamentally di erent from the legacy movie playback solution MovieTexture, we are
providing a few examples to help you migrate your project using MovieTexture to the new VideoPlayer solution.

Playing the Movie Example :
MovieTexture :

using UnityEngine;

public class PlayMovieMT : MonoBehaviour
{
public AudioClip movieAudioClip;
public MovieTexture movieTexture;

void Start()
{
var audioSource = gameObject.AddComponent();
audioSource.clip = movieAudioClip;
}

void Update()
{
if (Input.GetButtonDown("Jump"))
{
var audioSource = GetComponent();
GetComponent().material.mainTexture = movieTexture;

if (movieTexture.isPlaying)
{
movieTexture.Pause();
audioSource.Pause();
}
else
{
movieTexture.Play();
audioSource.Play();
}
}
}
}

VideoPlayer :

using UnityEngine;

public class PlayMovieVP : MonoBehaviour
{
public UnityEngine.Video.VideoClip videoClip;

void Start()
{
var videoPlayer = gameObject.AddComponent
var audioSource = gameObject.AddComponent();

videoPlayer.playOnAwake = false;
videoPlayer.clip = videoClip;
videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.MaterialOverr
videoPlayer.targetMaterialRenderer = GetComponent();
videoPlayer.targetMaterialProperty = "_MainTex";
videoPlayer.audioOutputMode = UnityEngine.Video.VideoAudioOutputMode.Aud
videoPlayer.SetTargetAudioSource(0, audioSource);
}

void Update()
{
if (Input.GetButtonDown("Jump"))
{
var vp = GetComponent();

if (vp.isPlaying)
{
vp.Pause();
}
else
{
vp.Play();
}
}
}
}

Downloading a Movie Example :
MovieTexture :

using UnityEngine;

public class DownloadMovieMT : MonoBehaviour
{
void Start()
{
StartCoroutine(GetMovieTexture());
}

IEnumerator GetMovieTexture()
{
using (var uwr = UnityWebRequestMultimedia.GetMovieTexture("http://myser
{
yield return uwr.SendWebRequest();
if (uwr.isNetworkError || uwr.isHttpError)
{
Debug.LogError(uwr.error);
yield break;
}

MovieTexture movie = DownloadHandlerMovieTexture.GetContent(uwr);

GetComponent().material.mainTexture = movie;
movie.loop = true;
movie.Play();
}
}
}

VideoPlayer :

using UnityEngine;

public class DownloadMovieVP : MonoBehaviour

{
void Start()
{
var vp = gameObject.AddComponent();
vp.url = "http://myserver.com/mymovie.mp4";

vp.isLooping = true;
vp.renderMode = UnityEngine.Video.VideoRenderMode.MaterialOverride;
vp.targetMaterialRenderer = GetComponent();
vp.targetMaterialProperty = "_MainTex";

vp.Play();
}
}

Static Properties
controlledAudioTrackMaxCount

Maximum number of audio tracks that can be controlled. (Read Only)

Properties
aspectRatio

De nes how the video content will be stretched to ll the target area.

audioOutputMode

Destination for the audio embedded in the video.

audioTrackCount

Number of audio tracks found in the data source currently con gured. (Read
Only)

canSetDirectAudioVolume

Whether direct-output volume controls are supported for the current
platform and video format. (Read Only)

canSetPlaybackSpeed

Whether the playback speed can be changed. (Read Only)

canSetSkipOnDrop

Whether frame-skipping to maintain synchronization can be controlled. (Read
Only)

canSetTime

Whether current time can be changed using the time or timeFrames
property. (Read Only)

canSetTimeSource

Whether the time source followed by the VideoPlayer can be changed. (Read
Only)

canStep

Returns true if the VideoPlayer can step forward through the video content.
(Read Only)

clip

The clip being played by the VideoPlayer.

clockTime

The clock time that the VideoPlayer follows to schedule its samples. The clock
time is expressed in seconds. (Read Only)

controlledAudioTrackCount

Number of audio tracks that this VideoPlayer will take control of.

externalReferenceTime

Reference time of the external clock the VideoPlayer uses to correct its drift.

frame

The frame index of the currently available frame in VideoPlayer.texture.

frameCount

Number of frames in the current video content. (Read Only)

frameRate

The frame rate of the clip or URL in frames/second. (Read Only)

height

The height of the images in the VideoClip, or URL, in pixels. (Read Only)

isLooping

Determines whether the VideoPlayer restarts from the beginning when it
reaches the end of the clip.

isPaused

Whether playback is paused. (Read Only)

isPlaying

Whether content is being played. (Read Only)

isPrepared

Whether the VideoPlayer has successfully prepared the content to be played.
(Read Only)

length

The length of the VideoClip, or the URL, in seconds. (Read Only)

pixelAspectRatioDenominator

Denominator of the pixel aspect ratio (num:den) for the VideoClip or the URL.
(Read Only)

pixelAspectRatioNumerator

Numerator of the pixel aspect ratio (num:den) for the VideoClip or the URL.
(Read Only)

playbackSpeed

Factor by which the basic playback rate will be multiplied.

playOnAwake

Whether the content will start playing back as soon as the component
awakes.

renderMode

Where the video content will be drawn.

sendFrameReadyEvents

Enables the frameReady events.

skipOnDrop

Whether the VideoPlayer is allowed to skip frames to catch up with current
time.

source

The source that the VideoPlayer uses for playback.

targetCamera

Camera component to draw to when VideoPlayer.renderMode is set to either
VideoRenderMode.CameraFarPlane or VideoRenderMode.CameraNearPlane.

targetCamera3DLayout

Type of 3D content contained in the source video media.

targetCameraAlpha

Overall transparency level of the target camera plane video.

targetMaterialProperty

Material texture property which is targeted when VideoPlayer.renderMode is
set to Video.VideoTarget.MaterialOverride.

targetMaterialRenderer

Renderer which is targeted when VideoPlayer.renderMode is set to
Video.VideoTarget.MaterialOverride

targetTexture

RenderTexture to draw to when VideoPlayer.renderMode is set to
Video.VideoTarget.RenderTexture.

texture

Internal texture in which video content is placed. (Read Only)

time

The presentation time of the currently available frame in VideoPlayer.texture.

timeReference

The clock that the VideoPlayer observes to detect and correct drift.

timeSource

[NOT YET IMPLEMENTED] The source used used by the VideoPlayer to derive
its current time.

url

The le or HTTP URL that the VideoPlayer reads content from.

waitForFirstFrame

Determines whether the VideoPlayer will wait for the rst frame to be loaded
into the texture before starting playback when VideoPlayer.playOnAwake is
on.

width

The width of the images in the VideoClip, or URL, in pixels. (Read Only)

Public Methods
EnableAudioTrack

Enable/disable audio track decoding. Only e ective when the VideoPlayer is not
currently playing.

GetAudioChannelCount

The number of audio channels in the speci ed audio track.

GetAudioLanguageCode

Returns the language code, if any, for the speci ed track.

GetAudioSampleRate

Gets the audio track sampling rate in Hertz.

GetDirectAudioMute

Gets the direct-output audio mute status for the speci ed track.

GetDirectAudioVolume

Return the direct-output volume for speci ed track.

GetTargetAudioSource

Gets the AudioSource that will receive audio samples for the speci ed track if
VideoPlayer.audioOutputMode is set to VideoAudioOutputMode.AudioSource.

IsAudioTrackEnabled

Whether decoding for the speci ed audio track is enabled. See
VideoPlayer.EnableAudioTrack for distinction with mute.

Pause

Pauses the playback and leaves the current time intact.

Play

Starts playback.

Prepare

Initiates playback engine preparation.

SetDirectAudioMute

Set the direct-output audio mute status for the speci ed track.

SetDirectAudioVolume

Set the direct-output audio volume for the speci ed track.

SetTargetAudioSource

Sets the AudioSource that will receive audio samples for the speci ed track if this
audio target is selected with VideoPlayer.audioOutputMode.

StepForward

Advances the current time by one frame immediately.

Stop

Stops the playback and sets the current time to 0.

Events
clockResyncOccurred

Invoked when the VideoPlayer clock is synced back to its VideoTimeReference.

errorReceived

Errors such as HTTP connection problems are reported through this callback.

frameDropped

[NOT YET IMPLEMENTED] Invoked when the video decoder does not produce a frame
as per the time source during playback.

frameReady

Invoked when a new frame is ready.

loopPointReached

Invoked when the VideoPlayer reaches the end of the content to play.

prepareCompleted

Invoked when the VideoPlayer preparation is complete.

seekCompleted

Invoke after a seek operation completes.

started

Invoked immediately after Play is called.

Delegates
ErrorEventHandler

Delegate type for VideoPlayer events that contain an error message.

EventHandler

Delegate type for all parameterless events emitted by VideoPlayers.

FrameReadyEventHandler

Delegate type for VideoPlayer events that carry a frame number.

TimeEventHandler

Delegate type for VideoPlayer events that carry a time position.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Types of 3D content layout within a video.

Properties
No3D

Video does not have any 3D content.

SideBySide3D

Video contains 3D content where the left eye occupies the left half and right eye occupies
the right half of video frames.

OverUnder3D

Video contains 3D content where the left eye occupies the upper half and right eye
occupies the lower half of video frames.

Leave feedback

Description
Methods used to t a video in the target area.

Properties
NoScaling

Preserve the pixel size without adjusting for target area.

FitVertically

Resize proportionally so that height ts the target area, cropping or adding black bars on
each side if needed.

FitHorizontally

Resize proportionally so that width ts the target area, cropping or adding black bars
above and below if needed.

FitInside

Resize proportionally so that content ts the target area, adding black bars if needed.

FitOutside

Resize proportionally so that content ts the target area, cropping if needed.

Stretch

Resize non-proportionally to t the target area.

Leave feedback

Description
Places where the audio embedded in a video can be sent.

Properties
None

Disable the embedded audio.

AudioSource

Send the embedded audio into a speci ed AudioSource.

Direct

Send the embedded audio direct to the platform's audio hardware.

APIOnly

Send the embedded audio to the associated AudioSampleProvider.

Leave feedback

Description
Type of destination for the images read by a VideoPlayer.

Properties
CameraFarPlane

Draw video content behind a camera's Scene.

CameraNearPlane

Draw video content in front of a camera's Scene.

RenderTexture

Draw video content into a RenderTexture.

MaterialOverride

Draw the video content into a user-speci ed property of the current GameObject's
material.

APIOnly

Don't draw the video content anywhere, but still make it available via the VideoPlayer's
texture property in the API.

Leave feedback

Description
Source of the video content for a VideoPlayer.
A VideoPlayer can contain valid references to both a VideoClip and a URL at the same time. This enum expresses
which of the two should be used for playback.

Properties
VideoClip

Use the current clip as the video content source.

Url

Use the current URL as the video content source.

Leave feedback

Description
The clock that the VideoPlayer observes to detect and correct drift.

Properties
Freerun

Disables the drift detection.

InternalTime

Internal reference clock the VideoPlayer observes to detect and correct drift.

ExternalTime

External reference clock the VideoPlayer observes to detect and correct drift.

Leave feedback

Description
Time source followed by the VideoPlayer when reading content.

Properties
AudioDSPTimeSource

The audio hardware clock.

GameTimeSource

The unscaled game time as de ned by Time.realtimeSinceStartup.

Leave feedback

Description
DictationRecognizer listens to speech input and attempts to determine what phrase was uttered.
Users can register and listen for hypothesis and phrase completed events. Start() and Stop() methods respectively
enable and disable dictation recognition. Once done with the recognizer, it must be disposed using Dispose()
method to release the resources it uses. It will release these resources automatically during garbage collection at
an additional performance cost if they are not released prior to that.

using
using
using
using

UnityEditor;
UnityEngine;
UnityEngine.UI;
UnityEngine.Windows.Speech;

public class DictationScript : MonoBehaviour
{
[SerializeField]
private Text m_Hypotheses;

[SerializeField]
private Text m_Recognitions;

private DictationRecognizer m_DictationRecognizer;

void Start()
{
m_DictationRecognizer = new DictationRecognizer();

m_DictationRecognizer.DictationResult += (text, confidence) =>
{
Debug.LogFormat("Dictation result: {0}", text);
m_Recognitions.text += text + "\n";
};

m_DictationRecognizer.DictationHypothesis += (text) =>
{
Debug.LogFormat("Dictation hypothesis: {0}", text);

m_Hypotheses.text += text;
};

m_DictationRecognizer.DictationComplete += (completionCause) =>
{
if (completionCause != DictationCompletionCause.Complete)
Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.",
};

m_DictationRecognizer.DictationError += (error, hresult) =>
{
Debug.LogErrorFormat("Dictation error: {0}; HResult = {1}.", error,
};

m_DictationRecognizer.Start();
}
}

Dictation recognizer is currently functional only on Windows 10, and requires that dictation is permitted in the
user's Speech privacy policy (Settings->Privacy->Speech, inking & typing). If dictation is not enabled,
DictationRecognizer will fail on Start. Developers can handle this failure in an app-speci c way by providing a
DictationError delegate and testing for SPERR_SPEECH_PRIVACY_POLICY_NOT_ACCEPTED (0x80045509).

Properties
AutoSilenceTimeoutSeconds

The time length in seconds before dictation recognizer session ends due to
lack of audio input.

InitialSilenceTimeoutSeconds

The time length in seconds before dictation recognizer session ends due to
lack of audio input in case there was no audio heard in the current session.

Status

Indicates the status of dictation recognizer.

Constructors
DictationRecognizer

Create a DictationRecognizer with the speci ed minimum con dence and dictation
topic constraint. Phrases under the speci ed minimum level will be ignored.

Public Methods
Dispose

Disposes the resources this dictation recognizer uses.

Start

Starts the dictation recognization session. Dictation recognizer can only be started if
PhraseRecognitionSystem is not running.

Stop

Stops the dictation recognization session.

Events
DictationComplete

Event that is triggered when the recognizer session completes.

DictationError

Event that is triggered when the recognizer session encouters an error.

DictationHypothesis

Event that is triggered when the recognizer changes its hypothesis for the current
fragment.

DictationResult

Event indicating a phrase has been recognized with the speci ed con dence level.

Delegates
DictationCompletedDelegate

Delegate for DictationComplete event.

DictationErrorHandler

Delegate for DictationError event.

DictationHypothesisDelegate

Callback indicating a hypothesis change event. You should register with
DictationHypothesis event.

DictationResultDelegate

Callback indicating a phrase has been recognized with the speci ed
con dence level. You should register with DictationResult event.

Leave feedback

Description
The GrammarRecognizer is a complement to the KeywordRecognizer. In many cases developers will nd the
KeywordRecognizer lls all their development needs. However, in some cases, more complex grammars will be
better expressed in the form of an xml le on disk. The GrammarRecognizer uses Extensible Markup Language
(XML) elements and attributes, as speci ed in the World Wide Web Consortium (W3C) Speech Recognition
Grammar Speci cation (SRGS) Version 1.0. These XML elements and attributes represent the rule structures that
de ne the words or phrases (commands) recognized by speech recognition engines.
Information on this format can be found here http://www.w3.orgspeech­grammarspeech-grammar/ or on
MSDN.
There can be many grammar recognizers active at any given point in time, but no two grammar recognizers may
use the same grammar le.
Grammar recognizer is currently functional only on Windows 10.

Properties
GrammarFilePath

Returns the grammar le path which was supplied when the grammar recognizer was
created.

Constructors
GrammarRecognizer

Creates a grammar recognizer using speci ed le path and minimum con dence.

Inherited Members
Properties
IsRunning

Tells whether the phrase recognizer is listening for phrases.

Public Methods
Dispose

Disposes the resources used by phrase recognizer.

Start

Makes the phrase recognizer start listening to phrases.

Stop

Stops the phrase recognizer from listening to phrases.

Events

OnPhraseRecognized

Event that gets red when the phrase recognizer recognizes a phrase.

Delegates
PhraseRecognizedDelegate

Delegate for OnPhraseRecognized event.

Leave feedback

Description
KeywordRecognizer listens to speech input and attempts to match uttered phrases to a list of registered
keywords.
There can be many keyword recognizers active at any given time, but no two keyword recognizers may be
listening for the same keyword.

using
using
using
using

System;
System.Text;
UnityEngine;
UnityEngine.Windows.Speech;

public class KeywordScript : MonoBehaviour
{
[SerializeField]
private string[] m_Keywords;

private KeywordRecognizer m_Recognizer;

void Start()
{
m_Recognizer = new KeywordRecognizer(m_Keywords);
m_Recognizer.OnPhraseRecognized += OnPhraseRecognized;
m_Recognizer.Start();
}

private void OnPhraseRecognized(PhraseRecognizedEventArgs args)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat("{0} ({1}){2}", args.text, args.confidence, Environ
builder.AppendFormat("\tTimestamp: {0}{1}", args.phraseStartTime, Enviro
builder.AppendFormat("\tDuration: {0} seconds{1}", args.phraseDuration.T
Debug.Log(builder.ToString());
}
}

Keyword recognizer is currently functional only on Windows 10.

Properties
Keywords

Returns the list of keywords which was supplied when the keyword recognizer was
created.

Constructors
KeywordRecognizer

Create a KeywordRecognizer which listens to speci ed keywords with the speci ed
minimum con dence. Phrases under the speci ed minimum level will be ignored.

Inherited Members
Properties
IsRunning

Tells whether the phrase recognizer is listening for phrases.

Public Methods
Dispose

Disposes the resources used by phrase recognizer.

Start

Makes the phrase recognizer start listening to phrases.

Stop

Stops the phrase recognizer from listening to phrases.

Events
OnPhraseRecognized

Event that gets red when the phrase recognizer recognizes a phrase.

Delegates
PhraseRecognizedDelegate

Delegate for OnPhraseRecognized event.

Leave feedback

Description
Phrase recognition system is responsible for managing phrase recognizers and dispatching recognition events to
them.
In order for any phrase recognizers to recognize a phrase, PhraseRecognitionSystem must be running. Starting a
phrase recognition will automatically start the phrase recognition system if it's stopped.
Phrase recognition system cannot be started if there are any dictation recognizers active.
Phrase recognition system is currently only functional on Windows 10. Use PhraseRecognitionSystem.isSupported
property to determine whether speech recognition is supported on the system that the application is running on.

Static Properties
isSupported

Returns whether speech recognition is supported on the machine that the application is
running on.

Status

Returns the current status of the phrase recognition system.

Static Methods
Restart

Attempts to restart the phrase recognition system.

Shutdown

Shuts phrase recognition system down.

Events
OnError

Event that gets invoked when phrase recognition system encounters an error.

OnStatusChanged

Event which occurs when the status of the phrase recognition system changes.

Delegates
ErrorDelegate

Delegate for OnError event.

StatusDelegate

Delegate for OnStatusChanged event.

Leave feedback

Description
Provides information about a phrase recognized event.

Properties
con dence

A measure of correct recognition certainty.

phraseDuration

The time it took for the phrase to be uttered.

phraseStartTime

The moment in time when uttering of the phrase began.

semanticMeanings

A semantic meaning of recognized phrase.

text

The text that was recognized.

Leave feedback

Description
A common base class for both keyword recognizer and grammar recognizer.
Phrase recognizer is the smallest speech recognition unit that can be individually started and stopped. Typically,
you should create all your phrase recognizers at the start of the Scene, and the start and stop them on demand
as needed.

Properties
IsRunning

Tells whether the phrase recognizer is listening for phrases.

Public Methods
Dispose

Disposes the resources used by phrase recognizer.

Start

Makes the phrase recognizer start listening to phrases.

Stop

Stops the phrase recognizer from listening to phrases.

Events
OnPhraseRecognized

Event that gets red when the phrase recognizer recognizes a phrase.

Delegates
PhraseRecognizedDelegate

Delegate for OnPhraseRecognized event.

Leave feedback

Description
Semantic meaning is a collection of semantic properties of a recognized phrase. These semantic properties can
be speci ed in SRGS grammar les.

Properties
key

A key of semantic meaning.

values

Values of semantic property that the correspond to the semantic meaning key.

Leave feedback

Description
Used by KeywordRecognizer, GrammarRecognizer, DictationRecognizer. Phrases under the speci ed minimum
level will be ignored.

Properties
High

High con dence level.

Medium

Medium con dence level.

Low

Low con dence level.

Rejected

Everything is rejected.

Leave feedback

Description
Represents the reason why dictation session has completed.

Properties
Complete

Dictation session has completed successfully.

AudioQualityFailure

Dictation session completion was caused by bad audio quality.

Canceled

Dictation session was either cancelled, or the application was paused while
dictation session was in progress.

TimeoutExceeded

Dictation session has reached its timeout.

NetworkFailure

Dictation session has nished because network connection was not available.

MicrophoneUnavailable

Dictation session has nished because a microphone was not available.

UnknownError

Dictation session has completed due to an unknown error.

Leave feedback

Description
DictationTopicConstraint enum speci es the scenario for which a speci c dictation recognizer should optimize.

Properties
WebSearch

Dictation recognizer will optimize for web search scenario.

Form

Dictation recognizer will optimize for form- lling scenario.

Dictation

Dictation recognizer will optimize for dictation scenario.

Leave feedback

Description
Represents an error in a speech recognition system.

Properties
NoError

No error occurred.

TopicLanguageNotSupported

Supplied grammar le language is not supported.

GrammarCompilationFailure

Speech recognition engine failed to compiled speci ed grammar.

AudioQualityFailure

Speech recognition engine failed because the audio quality was too low.

TimeoutExceeded

A speech recognition system has timed out.

NetworkFailure

Speech error occurred due to a network failure.

MicrophoneUnavailable

Speech error occurred because a microphone was not available.

UnknownError

A speech recognition system has encountered an unknown error.

Leave feedback

Description
Represents the current status of the speech recognition system or a dictation recognizer.

Properties
Stopped

Speech recognition system is stopped.

Running

Speech recognition system is running.

Failed

Speech recognition system has encountered an error and is in an indeterminate state.

Leave feedback

Description
Exposes useful information related to crash reporting on Windows platforms.

Static Properties
crashReportFolder

Returns the path to the crash report folder on Windows.

Leave feedback

Description
Class representing cryptography algorithms.
Note: this class is only available when targeting Universal Windows Platform.

Static Methods
ComputeMD5Hash

Computes MD5 hash value for the speci ed byte array.

ComputeSHA1Hash

Computes SHA1 hash value for the speci ed byte array.

Leave feedback

Description
Exposes static methods for directory operations.
This is an alternative to System.IO.Directory class. Note: this class is only available when targeting Universal
Windows Platform.

Static Properties
localFolder

Returns a path to local folder.

roamingFolder

Returns a path to roaming folder.

temporaryFolder

Returns a path to temporary folder.

Static Methods
CreateDirectory

Creates directory in the speci ed path.

Delete

Deletes a directory from a speci ed path.

Exists

Determines whether the given path refers to an existing directory.

Leave feedback

Description
Provides static methods for le operations.
This is an alternative for System.IO.File class. Note: this class is only available when targeting Universal Windows
Platform.

Static Methods
Delete

Deletes the speci ed le.

Exists

Determines whether the speci ed le exists.

ReadAllBytes

Opens a binary le, reads the contents of the le into a byte array, and then closes the
le.

WriteAllBytes

Creates a new le, writes the speci ed byte array to the le, and then closes the le. If the
target le already exists, it is overwritten.

Leave feedback

Description
This class provides information regarding application's trial status and allows initiating application purchase.
Note: this class is only available on Universal Windows Platform.

Static Properties
isOnAppTrial

Checks whether the application is installed in trial mode.

Static Methods
PurchaseApp

Attempts to purchase the app if it is in installed in trial mode.

Leave feedback

Description
Provides essential methods related to Window Store application.

Static Properties
advertisingIdenti er

Advertising ID.

arguments

Arguments passed to application.

Static Methods
InvokeOnAppThread

Executes callback item on application thread.

InvokeOnUIThread

Executes callback item on UI thread.

RunningOnAppThread

Returns true if you're running on application thread.

RunningOnUIThread

Returns true if you're running on UI thread.

Events
windowActivated

Fired when application window is activated.

windowSizeChanged

Fired when window size changes.

Leave feedback

Description
Cursor API for Windows Store Apps.

Static Methods
SetCustomCursor

Set a custom cursor.

Leave feedback

Description
Class which is capable of launching user's default app for le type or a protocol. See also PlayerSettings where
you can specify le or URI associations.

Static Methods
LaunchFile

Launches the default app associated with speci ed le.

LaunchFileWithPicker

Opens a dialog for picking the le.

LaunchUri

Starts the default app associated with the URI scheme name for the speci ed URI,
using the speci ed options.

Leave feedback

Description
De nes the default look of secondary tile.
Some values are also used when a noti cation is sent to the same tile.

Properties
arguments

Arguments to be passed for application when secondary tile is
activated.

backgroundColor

De nes background color for secondary tile.

backgroundColorSet

De nes, whether backgroundColor should be used.

displayName

Display name for secondary tile.

foregroundText

De nes the style for foreground text on a secondary tile.

lockScreenBadgeLogo

Uri to logo, shown for secondary tile on lock screen.

lockScreenDisplayBadgeAndTileText

Whether to show secondary tile on lock screen.

phoneticName

Phonetic name for secondary tile.

roamingEnabled

De nes whether secondary tile is copied to another device when
application is installed by the same users account.

showNameOnSquare150x150Logo

De nes whether the displayName should be shown on a medium
secondary tile.

showNameOnSquare310x310Logo

De nes whether the displayName should be shown on a large
secondary tile.

showNameOnWide310x150Logo

De nes whether the displayName should be shown on a wide
secondary tile.

square150x150Logo

Uri to the logo for medium size tile.

square30x30Logo

Uri to the logo shown on tile

square310x310Logo

Uri to the logo for large size tile.

square70x70Logo

Uri to the logo for small size tile.

tileId

Unique identi er within application for a secondary tile.

wide310x150Logo

Uri to the logo for wide tile.

Constructors
SecondaryTileData

Constructor for SecondaryTileData, sets default values for all members.

Leave feedback

Description
Represents tile on Windows start screen
This class can be used to create or update secondary tiles on start screen and get instances of tiles to send
noti cations to them.

Static Properties
main

Returns applications main tile

Properties
exists

Whether secondary tile is pinned to start screen.

hasUserConsent

Whether secondary tile was approved (pinned to start screen) or rejected by user.

id

A unique string, identifying secondary tile

Public Methods
Delete

Show a request to unpin secondary tile from start screen.

PeriodicBadgeUpdate

Starts periodic update of a badge on a tile.

PeriodicUpdate

Starts periodic update of a tile.

RemoveBadge

Remove badge from tile.

StopPeriodicBadgeUpdate

Stops previously started periodic update of a tile.

StopPeriodicUpdate

Stops previously started periodic update of a tile.

Update

Send a noti cation for tile (update tiles look).

UpdateBadgeImage

Sets or updates badge on a tile to an image.

UpdateBadgeNumber

Set or update a badge on a tile to a number.

Static Methods
CreateOrUpdateSecondary

Creates new or updates existing secondary tile.

DeleteSecondary

Show a request to unpin secondary tile from start screen.

Exists

Whether secondary tile is pinned to start screen.

GetSecondaries

Gets all secondary tiles.

GetSecondary

Returns the secondary tile, identi ed by tile id.

GetTemplate

Get template XML for tile noti cation.

Leave feedback

Description
Represents a toast noti cation in Windows Store Apps.
Application must be declared "Toast capable" in manifest for toast noti cations to work.

Properties
activated

true if toast was activated by user.

arguments

Arguments to be passed for application when toast noti cation is activated.

dismissed

true if toast noti cation was dismissed (for any reason).

dismissedByUser

true if toast noti cation was explicitly dismissed by user.

Public Methods
Hide

Hide displayed toast noti cation.

Show

Show toast noti cation.

Static Methods
Create

Create toast noti cation.

GetTemplate

Get template XML for toast noti cation.

Leave feedback

Description
List of accessible folders on Windows Store Apps.

Leave feedback

Description
Style for foreground text on a secondary tile.

Leave feedback

Description
Templates for various tile styles.
Each template represents an XML document for updating tile. Note that availability of templates depends on
version of Microsoft Windows. For more detailed information, see: http://msdn.microsoft.com/enus/library/windows/apps/hh761491.aspx

Leave feedback

Description
Templates for various toast styles.
Each template represents an XML document for presenting toast noti cation. For more detailed information, see:
http://msdn.microsoft.com/en-us/library/windows/apps/hh761494.aspx

Leave feedback

Description
Speci es the set of reasons that a windowActivated event was raised.

Properties
CodeActivated

The window was activated.

Deactivated

The window was deactivated.

PointerActivated

The window was activated by pointer interaction.

Leave feedback

Description
Contains elds that are relevant during an error event.
To receive this information, you should register with GestureError.

Properties
error

A readable error string (when possible).

hresult

The HRESULT code from the platform.

Leave feedback

Description
Manager class with API for recognizing user gestures.
GestureRecognizer performs only the minimal disambiguation between the set of gestures that you request. For
example, if you request just Tap, the user may hold their nger down as long as they like and a Tap will still occur
when the user releases their nger. For more details on the types of gestures available see GestureSettings.
GestureRecognizers will only receive events after StartCapturingGestures is called. StopCapturingGestures can be
called again to stop events. This allows for GestureRecognizer to be activated and deactivated on demand such as
when a users gaze moves over and away from an object.

Constructors
GestureRecognizer

Create a GestureRecognizer.

Public Methods
CancelGestures

Cancels any pending gesture events. Additionally this will call
StopCapturingGestures.

Dispose

Disposes the resources used by gesture recognizer.

GetRecognizableGestures

Retrieve a mask of the currently enabled gestures.

IsCapturingGestures

Used to query if the GestureRecognizer is currently receiving Gesture events.

SetRecognizableGestures

Set the recognizable gestures to the ones speci ed in newMaskValues and return
the old settings.

StartCapturingGestures

Call to begin receiving gesture events on this recognizer. No events will be
received until this method is called.

StopCapturingGestures

Call to stop receiving gesture events on this recognizer.

Events
GestureError

Fires when Microsoft's gesture-recognition system encounters a warning or
error.

GestureErrorEvent

Fired when a warning or error is emitted by the GestureRecognizer.

HoldCanceled

Fires when Microsoft's gesture-recognition system recognizers that a user has
canceled a hold gesture.

HoldCanceledEvent

Fired when the user does a cancel event either using their hands or in
speech.

HoldCompleted

Fires when Microsoft's gesture-recognition system recognizers that a user has
completed a hold gesture.

HoldCompletedEvent

Fired when users complete a hold gesture.

HoldStarted

Fires when Microsoft's gesture-recognition system recognizes that a user has
started a hold gesture.

HoldStartedEvent

Fired when users start a hold gesture.

ManipulationCanceled

Fires when Microsoft's gesture-recognition system recognizes that a user has
canceled a manipulation gesture.

ManipulationCanceledEvent

Fires when a Manipulation gesture is canceled.

ManipulationCompleted

Fires when Microsoft's gesture-recognition system recognizes that a user has
completed a manipulation gesture.

ManipulationCompletedEvent

Fires when a Manipulation gesture is completed.

ManipulationStarted

Fires when Microsoft's gesture-recognition system recognizes that a user has
started a manipulation gesture.

ManipulationStartedEvent

Fires when an interaction becomes a Manipulation gesture.

ManipulationUpdated

Fires when Microsoft's gesture-recognition system recognizes that a user has
updated a manipulation gesture.

ManipulationUpdatedEvent

Fires when a Manipulation gesture is updated due to hand movement.

NavigationCanceled

Fires when Microsoft's gesture-recognition system recognizes that a user has
canceled a navigation gesture.

NavigationCanceledEvent

Fires when a Navigation gesture is canceled.

NavigationCompleted

Fires when Microsoft's gesture-recognition system recognizes that a
navigation gesture completes.

NavigationCompletedEvent

Fires when a Navigation gesture is completed.

NavigationStarted

Fires when Microsoft's gesture-recognition system recognizes that a user has
started a navigation gesture.

NavigationStartedEvent

Fires when an interaction becomes a Navigation gesture.

NavigationUpdated

Fires when Microsoft's gesture-recognition system recognizes that navigation
gesture has updated.

NavigationUpdatedEvent

Fires when a Navigation gesture is updated due to hand or controller
movement.

RecognitionEnded

Fires when recognition of gestures is done, either due to completion of a
gesture or cancellation.

RecognitionEndedEvent

Fires when recognition of gestures is done, either due to completion of a
gesture or cancellation.

RecognitionStarted

Fires when recognition of gestures begins.

RecognitionStartedEvent

Fires when recognition of gestures begins.

Tapped

Fires when Microsoft's gesture-recognition system recognizes that a user has
done a tap gesture and after the system voice command "Select" has been
processed. For controllers, this event res when the primary button is
released after it was pressed.

TappedEvent

Occurs when a Tap gesture is recognized.

Delegates
GestureErrorDelegate

Callback indicating an error or warning occurred.

HoldCanceledEventDelegate

Callback indicating a cancel event.

HoldCompletedEventDelegate

Callback indicating a hold completed event.

HoldStartedEventDelegate

Callback indicating a hold started event.

ManipulationCanceledEventDelegate

Callback indicating a cancel event.

ManipulationCompletedEventDelegate

Callback indicating a completed event.

ManipulationStartedEventDelegate

Callback indicating a started event.

ManipulationUpdatedEventDelegate

Callback indicating a updated event.

NavigationCanceledEventDelegate

Callback indicating a cancel event.

NavigationCompletedEventDelegate

Callback indicating a completed event.

NavigationStartedEventDelegate

Callback indicating a started event.

NavigationUpdatedEventDelegate

Callback indicating a update event.

RecognitionEndedEventDelegate

Callback indicating the gesture event has completed.

RecognitionStartedEventDelegate

Callback indicating the gesture event has started.

TappedEventDelegate

Callback indicating a tap event.

Leave feedback

Description
Contains elds that are relevant when a user cancels a hold gesture.
Users should register with HoldCanceled.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that canceled the hold gesture.

sourcePose

Represents pose data of the input source, such as a hand or controller, when the gesture
occurred.

Leave feedback

Description
Contains elds that are relevant when a hold gesture completes.
Users should register with HoldCompleted.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that completed the hold gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a hold gesture starts.
Users should register with HoldStarted.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that started the hold gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Provides access to user input from hands, controllers, and system voice commands.

Static Properties
numSourceStates

(Read Only) The number of InteractionSourceState snapshots available for reading with
InteractionManager.GetCurrentReading.

Static Methods
GetCurrentReading

Get the current SourceState.

Events
InteractionSourceDetected

Occurs when a new hand, controller, or source of voice commands has
been detected.

InteractionSourceDetectedLegacy

Occurs when a new hand, controller, or source of voice commands has
been detected.

InteractionSourceLost

Occurs when a hand, controller, or source of voice commands is no
longer available.

InteractionSourceLostLegacy

Occurs when a hand, controller, or source of voice commands is no
longer available.

InteractionSourcePressed

Occurs when a hand or controller has entered the pressed state.

InteractionSourcePressedLegacy

Occurs when a hand or controller has entered the pressed state.

InteractionSourceReleased

Occurs when a hand or controller has exited the pressed state.

InteractionSourceReleasedLegacy

Occurs when a hand or controller has exited the pressed state.

InteractionSourceUpdated

Occurs when a hand or controller has experienced a change to its
SourceState.

InteractionSourceUpdatedLegacy

Occurs when a hand or controller has experienced a change to its
SourceState.

Delegates
SourceEventHandler

Callback to handle InteractionManager events.

Leave feedback

Description
Represents one detected instance of an interaction source (hand, controller, or user's voice) that can cause
interactions and gestures.
This object should be the same between events and polls from InteractionManager as well as in gesture events
from GestureRecognizer for the same interaction source. See also HoldCanceledEventArgs,
HoldCompletedEventArgs, HoldStartedEventArgs, ManipulationCanceledEventArgs,
ManipulationCompletedEventArgs, ManipulationStartedEventArgs, ManipulationUpdatedEventArgs,
NavigationCanceledEventArgs, NavigationCompletedEventArgs, NavigationStartedEventArgs,
NavigationUpdatedEventArgs, RecognitionEndedEventArgs, RecognitionStartedEventArgs, and TappedEventArgs.

Properties
handedness

Denotes which hand was used as the input source.

id

The identi er for the interaction source (hand, controller, or user's voice).

kind

Speci es the kind of an interaction source.

productId

Following the make and model nomenclature of cars, this equates to the model
number.

productVersion

Following the make and model nomenclature of cars, this would be a minor update to
the model.

supportsGrasp

This property returns true when the interaction source has at least one grasp button,
and false if otherwise.

supportsMenu

This property returns true when the interaction source has a menu button, and false if
otherwise.

supportsPointing

This property returns true if the interaction source has a separate pose for the pointer,
and false if otherwise.

supportsThumbstick

Returns true if the interaction source has a thumbstick, and false if otherwise.

supportsTouchpad

Returns true if the interaction source has a touchpad, and false if otherwise.

vendorId

All interaction sources developed by the same company will have the same vendor ID.

Leave feedback

Description
Contains elds that are relevent when an interaction source is detected.
To receive this information, subscribe to InteractionSourceDetected.

Properties
state

The current state of the reported interaction source that was just detected.

Leave feedback
Obsolete

Description
Represents the position and velocity of a hand or controller - this has been deprecated. Use
InteractionSourcePose instead.

Leave feedback

Description
Contains elds that are relevent when an interaction source is lost.
To receive this information, subscribe to InteractionSourceLost.

Properties
state

The current state of the reported interaction source that was just lost.

Leave feedback

Description
Pose data of the interaction source at the time of either the gesture or interaction.

Properties
positionAccuracy

The position-tracking accuracy of the interaction source.

Public Methods
TryGetAngularVelocity

Attempts to retrieve a Vector3 representing the current angular velocity of the
tracked node.

TryGetForward

Gets the forward vector of the interaction source, assuming rotation is valid.

TryGetPosition

Gets the position of the interaction source, assuming the backing data is valid.

TryGetRight

Gets the right vector of the interaction source, assuming rotation is valid.

TryGetRotation

Gets the rotation of the interaction source, assuming the backing data is valid.

TryGetUp

Gets the up vector of the interaction source, assuming rotation is valid.

TryGetVelocity

Gets the velocity of the interaction source, assuming the backing data is valid.

Leave feedback

Description
Contains elds that are relevent when an interaction source enters the pressed state for one of its buttons.
To receive this information, subscribe to InteractionSourcePressed.

Properties
pressType

Denotes the type of button that was just pressed.

state

The current state of the reported interaction source that just had one of its buttons enter
the pressed state.

Leave feedback

Description
Represents the set of properties available to explore the current state of a hand or controller.

Properties
sourceLossMitigationDirection

The direction you should suggest that the user move their hand if it is
nearing the edge of the detection area.

sourceLossRisk

Gets the risk that detection of the hand will be lost as a value from 0.0 to 1.0.

Leave feedback

Description
Contains elds that are relevent when an interaction source exits the pressed state for one of its buttons.
To receive this information, subscribe to InteractionSourceReleased.

Properties
pressType

Denotes the type of button that was just released.

state

The current state of the reported interaction source that just had one of its buttons exit
the pressed state.

Leave feedback

Description
Represents a snapshot of the state of a spatial interaction source (hand, voice or controller) at a given time.

Properties
anyPressed

True if the source is in the pressed state.

grasped

Whether the controller is grasped.

headPose

Head pose of the user at the time of the interaction.

menuPressed

Whether or not the menu button is pressed.

properties

Additional properties to explore the state of the interaction source.

selectPressed

Depending on the InteractionSourceType of the interaction source, this returning true
could represent a number of equivalent things: main button on a clicker, air-tap on a
hand, and the trigger on a motion controller. For hands, a select-press represents the
user's index nger in the down position. For motion controllers, a select-press
represents the controller's index- nger trigger (or primary face button, if no trigger)
being fully pressed. Note that a voice command of "Select" causes an instant press
and release, so you cannot poll for a voice press using this property - instead, you
must use GestureRecognizer and subscribe to the Tapped event, or subscribe to the
InteractionSourcePressed event from InteractionManager.

selectPressedAmount

Normalized amount ([0, 1]) representing how much select is pressed.

source

The interaction source that this state describes.

sourcePose

Pose data of the interaction source at the time of the interaction.

thumbstickPosition

Normalized coordinates for the position of a thumbstick.

thumbstickPressed

Whether or not the thumbstick is pressed.

touchpadPosition

Normalized coordinates for the position of a touchpad interaction.

touchpadPressed

Whether or not the touchpad is pressed, as if a button.

touchpadTouched

Whether or not the touchpad is touched.

Leave feedback

Description
Contains elds that are relevent when an interaction source updates.
To receive this information, subscribe to InteractionSourceUpdated.

Properties
state

The current state of the reported interaction source that just updated.

Leave feedback

Description
Contains elds that are relevant when a manipulation gesture is canceled.
To receive this information, you should register with ManipulationCanceled.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that canceled the manipulation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a manipulation gesture completes.
To receive this information, you should register with ManipulationCompleted.

Properties
cumulativeDelta

Total distance moved since the beginning of the manipulation gesture.

headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that completed the manipulation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds relevant when a manipulation gesture starts.
To receive this information, you should register with ManipulationStarted.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that started the manipulation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a manipulation gesture gets updated.
To receive this information, you should register with ManipulationUpdated.

Properties
cumulativeDelta

Total distance moved since the beginning of the manipulation gesture.

headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) being used for the manipulation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a navigation gesture is canceled.
To receive this information, you should register with NavigationCanceled.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that canceled the navigation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a navigation gesture completes.
To receive this information, you should register with NavigationCompleted.

Properties
headPose

Head pose of the user at the time of the gesture.

normalizedO set

The normalized o set, since the navigation gesture began, of the input within the unit
cube for the navigation gesture.

source

The InteractionSource (hand, controller, or user's voice) that completed the navigation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a navigation gesture starts.
To receive this information, you should register with NavigationStarted.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that started the navigation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a navigation gesture updates.
To receive this information, you should register with NavigationUpdated.

Properties
headPose

Head pose of the user at the time of the gesture.

normalizedO set

The normalized o set, since the navigation gesture began, of the input within the unit
cube for the navigation gesture.

source

The InteractionSource (hand, controller, or user's voice) being used for the navigation
gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when recognition of a gesture event ends.
To receive this information, you should register with RecognitionEnded.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that ended the gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when recognition of a gesture event begins.
To receive this information, you should register with RecognitionStarted.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that started the gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

Leave feedback

Description
Contains elds that are relevant when a tap gesture occurs.
To receive this information, you should register with Tapped.

Properties
headPose

Head pose of the user at the time of the gesture.

source

The InteractionSource (hand, controller, or user's voice) that initiated the tap gesture.

sourcePose

Pose data of the interaction source at the time of the gesture.

tapCount

The number of taps (1 for single-tap, 2 for double-tap).

Leave feedback

Description
This enumeration represents the set of gestures that may be recognized by GestureRecognizer.
GestureRecognizer performs only the minimal disambiguation between the set of gestures that you request. For
example, if you request just Tap, the user may hold their nger down as long as they like and a Tap will still occur
when the user releases their nger.

Properties
None

Disable support for gestures.

Tap

Enable support for the tap gesture.

DoubleTap

Enable support for the double-tap gesture.

Hold

Enable support for the hold gesture.

ManipulationTranslate

Enable support for the manipulation gesture which tracks changes to the hand's
position. This gesture is relative to the start position of the gesture and measures an
absolute movement through the world.

NavigationX

Enable support for the navigation gesture, in the horizontal axis.

NavigationY

Enable support for the navigation gesture, in the vertical axis.

NavigationZ

Enable support for the navigation gesture, in the depth axis.

NavigationRailsX

Enable support for the navigation gesture, in the horizontal axis using rails (guides).

NavigationRailsY

Enable support for the navigation gesture, in the vertical axis using rails (guides).

NavigationRailsZ

Enable support for the navigation gesture, in the depth axis using rails (guides).

Leave feedback

Description
Denotes which hand was used as the input source.

Leave feedback

Description
Speci es the kind of an interaction source.
This only enumerates sources of interactions, such as hand gestures and voice commands.

Properties
Other

The interaction source is of a kind not known in this version of the API.

Hand

The interaction source is one of the user's hands.

Voice

The interaction source is the user's speech.

Controller

The interaction source is of a kind not known in this version of the API.

Leave feedback

Description
Speci es which part of the controller to query pose information for.

Properties
Grip

The grip of the controller.

Pointer

The pointer of the controller.

Leave feedback

Description
Denotes the accuracy of tracking on the interaction source.

Properties
None

A position accuracy of None reports that there is no position accuracy, as the interaction
source unlocatable.

Approximate

A position accuracy of Approximate reports that you may not want to fully trust the
positions reported, as the position is inferred or synthesized in some way, such as the
controller leaving the sensors' eld of view and forcing the API to rely on the device's IMU
instead of visual tracking.

High

A position accuracy of High reports that you can fully trust the position, as the interaction
source is within the sensors' visual eld of view.

Leave feedback

Description
The type of button or controller feature pressed, if any.

Properties
Select

Depending on the InteractionSourceType of the interaction source, this could be a
number of equivalent things: main button on a blicker, air-tap on a hand, and the trigger
on a motion controller.

Menu

This button is marked with three horizontal lines, same as you would ne on an Xbox One
controller.

Grasp

These buttons are generally found on the side of the controller. Some hardware has more
than one grasp button.

Touchpad

A touchpad only counts as pressed when it's held down enough - otherwise, it's just
touched, and will give a reading of the position through
InteractionSourceState.touchpadPosition.

Thumbstick

Similar to the touchpad, moving the thumbstick won't count as pressing it - a press will
occur when pressing down on the thumbstick enough.

Leave feedback

Description
The storage object for persisted WorldAnchors.

Properties
anchorCount

(Read Only) Gets the number of persisted world anchors in this WorldAnchorStore.

Public Methods
Clear

Clears all persisted WorldAnchors.

Delete

Deletes a persisted WorldAnchor from the store.

Dispose

Cleans up the WorldAnchorStore and releases memory.

GetAllIds

Gets all of the identi ers of the currently persisted WorldAnchors.

Load

Loads a WorldAnchor from disk for given identi er and attaches it to the GameObject. If
the GameObject has a WorldAnchor, that WorldAnchor will be updated. If the anchor is
not found, null will be returned and the GameObject and any existing WorldAnchor
attached to it will not be modi ed.

Save

Saves the provided WorldAnchor with the provided identi er. If the identi er is already in
use, the method will return false.

Static Methods
GetAsync

Gets the WorldAnchorStore instance.

Delegates
GetAsyncDelegate

The handler for when getting the WorldAnchorStore from GetAsync.

Leave feedback

Description
A batch of WorldAnchors which can be exported and imported between apps.

Properties
anchorCount

(Read Only) Gets the number of world anchors in this WorldAnchorTransferBatch.

Public Methods
AddWorldAnchor

Adds a WorldAnchor to the batch with the speci ed identi er.

Dispose

Cleans up the WorldAnchorTransferBatch and releases memory.

GetAllIds

Gets all of the identi ers currently mapped in this WorldAnchorTransferBatch.

LockObject

Locks the provided GameObject to the world by loading and applying the WorldAnchor
from the TransferBatch for the provided id.

Static Methods
ExportAsync

Exports the input WorldAnchorTransferBatch into a byte array which can be passed to
WorldAnchorTransferBatch.ImportAsync to restore the original
WorldAnchorTransferBatch.

ImportAsync

Imports the provided bytes into a WorldAnchorTransferBatch.

Delegates
DeserializationCompleteDelegate

The handler for when deserialization has completed.

SerializationCompleteDelegate

The handler for when serialization is completed.

SerializationDataAvailableDelegate

The handler for when some data is available from serialization.

Leave feedback

Description
This enum represents the result of a WorldAnchorTransferBatch operation.

Properties
Succeeded

The operation has completed successfully.

NotSupported

The operation has failed because it was not supported.

AccessDenied

The operation has failed because access was denied. This occurs typically because the
transfer batch was not readable when deserializing or writable when serializing.

UnknownError

The operation has failed in an unexpected way.

Leave feedback

Description
When calling PhotoCapture.StartPhotoModeAsync, you must pass in a CameraParameters object that contains
the various settings that the web camera will use.

Properties
cameraResolutionHeight

A valid height resolution for use with the web camera.

cameraResolutionWidth

A valid width resolution for use with the web camera.

frameRate

The framerate at which to capture video. This is only for use with VideoCapture.

hologramOpacity

The opacity of captured holograms.

pixelFormat

The pixel format used to capture and record your image data.

Leave feedback

Description
Captures a photo from the web camera and stores it in memory or on disk.
Demonstrates how to take a photo using the PhotoCapture functionality and display it on a Unity GameObject.

using
using
using
using

UnityEngine;
System.Collections;
System.Linq;
UnityEngine.XR.WSA.WebCam;

public class PhotoCaptureExample : MonoBehaviour
{
PhotoCapture photoCaptureObject = null;
Texture2D targetTexture = null;

// Use this for initialization
void Start()
{
Resolution cameraResolution = PhotoCapture.SupportedResolutions.OrderByD
targetTexture = new Texture2D(cameraResolution.width, cameraResolution.h

// Create a PhotoCapture object
PhotoCapture.CreateAsync(false, delegate(PhotoCapture captureObject) {
photoCaptureObject = captureObject;
CameraParameters cameraParameters = new CameraParameters();
cameraParameters.hologramOpacity = 0.0f;
cameraParameters.cameraResolutionWidth = cameraResolution.width;
cameraParameters.cameraResolutionHeight = cameraResolution.height;
cameraParameters.pixelFormat = CapturePixelFormat.BGRA32;

// Activate the camera
photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate(Ph
// Take a picture
photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory);
});
});
}

void OnCapturedPhotoToMemory(PhotoCapture.PhotoCaptureResult result, PhotoCa
{
// Copy the raw image data into our target texture
photoCaptureFrame.UploadImageDataToTexture(targetTexture);

// Create a gameobject that we can apply our texture to
GameObject quad = GameObject.CreatePrimitive(PrimitiveType.Quad);
Renderer quadRenderer = quad.GetComponent() as Renderer;
quadRenderer.material = new Material(Shader.Find("Unlit/Texture"));

quad.transform.parent = this.transform;
quad.transform.localPosition = new Vector3(0.0f, 0.0f, 3.0f);

quadRenderer.material.SetTexture("_MainTex", targetTexture);

// Deactivate our camera
photoCaptureObject.StopPhotoModeAsync(OnStoppedPhotoMode);
}

void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result)
{
// Shutdown our photo capture resource
photoCaptureObject.Dispose();
photoCaptureObject = null;
}
}

Static Properties
SupportedResolutions

A list of all the supported device resolutions for taking pictures.

Public Methods
Dispose

Dispose must be called to shutdown the PhotoCapture instance.

GetUnsafePointerToVideoDeviceController

Provides a COM pointer to the native IVideoDeviceController.

StartPhotoModeAsync

Asynchronously starts photo mode.

StopPhotoModeAsync

Asynchronously stops photo mode.

TakePhotoAsync

Asynchronously captures a photo from the web camera and
saves it to disk.

Static Methods
CreateAsync

Asynchronously creates an instance of a PhotoCapture object that can be used to capture
photos.

Delegates
OnCapturedToDiskCallback

Called when a photo has been saved to the le system.

OnCapturedToMemoryCallback

Called when a photo has been captured to memory.

OnCaptureResourceCreatedCallback

Called when a PhotoCapture resource has been created.

OnPhotoModeStartedCallback

Called when photo mode has been started.

OnPhotoModeStoppedCallback

Called when photo mode has been stopped.

Leave feedback

Description
A data container that contains the result information of a photo capture operation.

Properties
hResult

The speci c HResult value.

resultType

A generic result that indicates whether or not the PhotoCapture operation succeeded.

success

Indicates whether or not the operation was successful.

Leave feedback

Description
Contains the result of the capture request.
More generic error types may be added at a later time.

Properties
Success

Speci es that the desired operation was successful.

UnknownError

Speci es that an unknown error occurred.

Leave feedback

Description
Contains information captured from the web camera.
Information captured can include the image has well as spatial data.

Properties
dataLength

The length of the raw IMFMediaBu er which contains the image captured.

hasLocationData

Speci es whether or not spatial data was captured.

pixelFormat

The raw image data pixel format.

Public Methods
CopyRawImageDataIntoBu er

Will copy the raw IMFMediaBu er image data into a byte list.

Dispose

Disposes the PhotoCaptureFrame and any resources it uses.

GetUnsafePointerToBu er

Provides a COM pointer to the native IMFMediaBu er that contains the
image data.

TryGetCameraToWorldMatrix

This method will return the camera to world matrix at the time the photo
was captured if location data if available.

TryGetProjectionMatrix

This method will return the projection matrix at the time the photo was
captured if location data if available.

UploadImageDataToTexture

This method will copy the captured image data into a user supplied texture
for use in Unity.

Leave feedback

Description
Records a video from the web camera directly to disk.
The nal video recording will be stored on the le system in the MP4 format.
The example below records a 5 second video to the le system.

using
using
using
using

UnityEngine;
System.Collections;
System.Linq;
UnityEngine.XR.WSA.WebCam;

public class VideoCaptureExample : MonoBehaviour
{
static readonly float MaxRecordingTime = 5.0f;

VideoCapture m_VideoCapture = null;
float m_stopRecordingTimer = float.MaxValue;

// Use this for initialization
void Start()
{
StartVideoCaptureTest();
}

void Update()
{
if (m_VideoCapture == null || !m_VideoCapture.IsRecording)
{
return;
}

if (Time.time > m_stopRecordingTimer)
{
m_VideoCapture.StopRecordingAsync(OnStoppedRecordingVideo);
}
}

void StartVideoCaptureTest()
{
Resolution cameraResolution = VideoCapture.SupportedResolutions.OrderByD
Debug.Log(cameraResolution);

float cameraFramerate = VideoCapture.GetSupportedFrameRatesForResolution
Debug.Log(cameraFramerate);

VideoCapture.CreateAsync(false, delegate(VideoCapture videoCapture)
{
if (videoCapture != null)
{
m_VideoCapture = videoCapture;
Debug.Log("Created VideoCapture Instance!");

CameraParameters cameraParameters = new CameraParameters();
cameraParameters.hologramOpacity = 0.0f;
cameraParameters.frameRate = cameraFramerate;
cameraParameters.cameraResolutionWidth = cameraResolution.width;
cameraParameters.cameraResolutionHeight = cameraResolution.heigh
cameraParameters.pixelFormat = CapturePixelFormat.BGRA32;

m_VideoCapture.StartVideoModeAsync(cameraParameters,
VideoCapture.AudioState.ApplicationAndMicAudio,
OnStartedVideoCaptureMode);
}
else
{
Debug.LogError("Failed to create VideoCapture Instance!");
}
});
}

void OnStartedVideoCaptureMode(VideoCapture.VideoCaptureResult result)
{
Debug.Log("Started Video Capture Mode!");
string timeStamp = Time.time.ToString().Replace(".", "").Replace(":", ""
string filename = string.Format("TestVideo_{0}.mp4", timeStamp);
string filepath = System.IO.Path.Combine(Application.persistentDataPath,

filepath = filepath.Replace("/", @"\");
m_VideoCapture.StartRecordingAsync(filepath, OnStartedRecordingVideo);
}

void OnStoppedVideoCaptureMode(VideoCapture.VideoCaptureResult result)
{
Debug.Log("Stopped Video Capture Mode!");
}

void OnStartedRecordingVideo(VideoCapture.VideoCaptureResult result)
{
Debug.Log("Started Recording Video!");
m_stopRecordingTimer = Time.time + MaxRecordingTime;
}

void OnStoppedRecordingVideo(VideoCapture.VideoCaptureResult result)
{
Debug.Log("Stopped Recording Video!");
m_VideoCapture.StopVideoModeAsync(OnStoppedVideoCaptureMode);
}
}

Static Properties
SupportedResolutions

A list of all the supported device resolutions for recording videos.

Properties
IsRecording

Indicates whether or not the VideoCapture instance is currently recording video.

Public Methods
Dispose

Dispose must be called to shutdown the PhotoCapture instance.

GetUnsafePointerToVideoDeviceController

Provides a COM pointer to the native IVideoDeviceController.

StartRecordingAsync

Asynchronously records a video from the web camera to the le
system.

StartVideoModeAsync

Asynchronously starts video mode.

StopRecordingAsync

Asynchronously stops recording a video from the web camera to
the le system.

StopVideoModeAsync

Asynchronously stops video mode.

Static Methods
CreateAsync

Asynchronously creates an instance of a VideoCapture object that
can be used to record videos from the web camera to disk.

GetSupportedFrameRatesForResolution

Returns the supported frame rates at which a video can be
recorded given a resolution.

Delegates
OnStartedRecordingVideoCallback

Called when the web camera begins recording the video.

OnStoppedRecordingVideoCallback

Called when the video recording has been saved to the le
system.

OnVideoCaptureResourceCreatedCallback

Called when a VideoCapture resource has been created.

OnVideoModeStartedCallback

Called when video mode has been started.

OnVideoModeStoppedCallback

Called when video mode has been stopped.

Leave feedback

Description
A data container that contains the result information of a video recording operation.

Properties
hResult

The speci c HResult value.

resultType

A generic result that indicates whether or not the VideoCapture operation succeeded.

success

Indicates whether or not the operation was successful.

Leave feedback

Description
Speci es what audio sources should be recorded while recording the video.

Properties
MicAudio

Only include the mic audio in the video recording.

ApplicationAudio

Only include the application audio in the video recording.

ApplicationAndMicAudio

Include both the application audio as well as the mic audio in the video recording.

None

Do not include any audio in the video recording.

Leave feedback

Description
Contains the result of the capture request.

Properties
Success

Speci es that the desired operation was successful.

UnknownError

Speci es that an unknown error occurred.

Leave feedback

Description
Contains general information about the current state of the web camera.

Static Properties
Mode

Speci es what mode the Web Camera is currently in.

Leave feedback

Description
The encoded image or video pixel format to use for PhotoCapture and VideoCapture.

Properties
BGRA32

8 bits per channel (blue, green, red, and alpha).

NV12

8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling.

JPEG

Encode photo in JPEG format.

PNG

Portable Network Graphics Format.

Leave feedback

Description
Image Encoding Format.
The image encoding format that should be used when saving the texture to disk.

Properties
PNG

PNG Encoding.

JPG

JPEG Encoding.

Leave feedback

Description
Describes the active mode of the Web Camera resource.
The Web Camera resource can only be in one mode at any given time.

Properties
None

Resource is not in use.

PhotoMode

Resource is in Photo Mode.

VideoMode

Resource is in Video Mode.

Leave feedback

Description
he Holographic Remoting interface allows you to connect an application to a remote holographic device, and
stream data between the application and that device.

// Connnect to remote holographic device

using
using
using
using

System.Collections;
UnityEngine;
UnityEngine.XR;
UnityEngine.XR.WSA;

public class ExampleClass : MonoBehaviour
{
private string IP;

private bool connected;

public void Connect()
{
if (HolographicRemoting.ConnectionState != HolographicStreamerConnection
{
HolographicRemoting.Connect(IP);
}
}

void Update()
{
if (!connected && HolographicRemoting.ConnectionState == HolographicStre
{
connected = true;

StartCoroutine(LoadDevice("WindowsMR"));
}
}

IEnumerator LoadDevice(string newDevice)
{
XRSettings.LoadDeviceByName(newDevice);
yield return null;
XRSettings.enabled = true;
}
}

Static Properties
ConnectionState

Whether the app is displaying protected content.

Leave feedback

Description
The Holographic Settings contain functions which e ect the performance and presentation of Holograms on
Windows Holographic platforms.

Static Properties
IsContentProtectionEnabled

Whether the app is displaying protected content.

IsDisplayOpaque

This method returns whether or not the display associated with the main
camera reports as opaque.

ReprojectionMode

The kind of reprojection the app is requesting to stabilize its holographic
rendering relative to the user's head motion.

Static Methods
SetFocusPointForFrame

Sets a point in 3d space that is the focal point of the Scene for the user for this
frame. This helps improve the visual delity of content around this point. This must
be set every frame.

Leave feedback

Description
Represents the kind of reprojection an app is requesting to stabilize its holographic rendering relative to the
user's head motion.

Properties
PositionAndOrientation

The image should be stabilized for changes to both the user's head position and
orientation. This is best for world-locked content that should remain physically
stationary as the user walks around.

OrientationOnly

The image should be stabilized only for changes to the user's head orientation,
ignoring positional changes. This is best for body-locked content that should tag
along with the user as they walk around, such as 360-degree video.

Disabled

The image should not be stabilized for the user's head motion, instead remaining
xed in the display. This is generally discouraged, as it is only comfortable for users
when used sparingly, such as when the only visible content is a small cursor.

Leave feedback

Description
SurfaceData is a container struct used for requesting baked spatial mapping data and receiving that data once
baked.

Properties
bakeCollider

Set this eld to true when requesting data to bake collider data. This eld will be set
to true when receiving baked data if it was requested. Setting this eld to true
requires that a valid outputCollider is also speci ed.

id

This is the ID for the surface to be baked or the surface that was baked and being
returned to the user.

outputAnchor

This WorldAnchor is used to lock the surface into place relative to real world
objects. It will be lled in when calling RequestMeshAsync to generate data for a
surface and returned with the SurfaceDataReadyDelegate.

outputCollider

This MeshCollider will receive the baked physics mesh prepared by the system
when requesting baked surface data through RequestMeshAsync. The MeshCollider
is returned in the SurfaceDataReadyDelegate for those users requiring advanced
work ows.

outputMesh

This MeshFilter will receive the baked mesh prepared by the system when
requesting baked surface data. The MeshFilter is returned in the
SurfaceDataReadyDelegate for those users requiring advanced work ows.

trianglesPerCubicMeter

This value controls the basic resolution of baked mesh data and is returned with the
SurfaceDataReadyDelegate. The device will deliver up to this number of triangles
per cubic meter.

Constructors
SurfaceData

Constructor for conveniently lling out a SurfaceData struct.

Leave feedback

Description
SurfaceId is a structure wrapping the unique ID used to denote Surfaces. SurfaceIds are provided through the
onSurfaceChanged callback in Update and returned after a RequestMeshAsync call has completed. SurfaceIds are
guaranteed to be unique though Surfaces are sometimes replaced with a new Surface in the same location with a
di erent ID.

Properties
handle

The actual integer ID referring to a single surface.

Leave feedback

Description
SurfaceObserver is the main API portal for spatial mapping functionality in Unity.
Users should create an SurfaceObserver, call Update to generate SurfaceChanged events, call GetMeshAsync for
those surfaces that are interesting, and call Dispose when nished with the object.

Constructors
SurfaceObserver

Basic constructor for SurfaceObserver.

Public Methods
Dispose

Call Dispose when the SurfaceObserver is no longer needed. This will ensure
that the object is cleaned up appropriately but will not a ect any Meshes,
components, or objects returned by RequestMeshAsync.

RequestMeshAsync

Call RequestMeshAsync to start the process of baking mesh data for the
speci ed surface. This data may take several frames to create. Baked data will
be delivered through the speci ed SurfaceDataReadyDelegate. This method
will throw ArgumentNullExcpetion and ArgumentException if parameters
speci ed in the dataRequest are invalid.

SetVolumeAsAxisAlignedBox

This method sets the observation volume as an axis aligned box at the
requested location. Successive calls can be used to reshape the observation
volume and/or to move it in the Scene as needed. Extents are the distance
from the center of the box to its edges along each axis.

SetVolumeAsFrustum

This method sets the observation volume as a frustum at the requested
location. Successive calls can be used to reshape the observation volume
and/or to move it in the Scene as needed.

SetVolumeAsOrientedBox

This method sets the observation volume as an oriented box at the requested
location. Successive calls can be used to reshape the observation volume
and/or to move it in the Scene as needed. Extents are the distance from the
center of the box to its edges along each axis.

SetVolumeAsSphere

This method sets the observation volume as a sphere at the requested
location. Successive calls can be used to reshape the observation volume
and/or to move it in the Scene as needed.

Update

Update generates SurfaceChanged events which are propagated through the
speci ed callback. If no callback is speci ed, the system will throw an
ArgumentNullException. Generated callbacks are synchronous with this call.

Scenes containing multiple SurfaceObservers should consider using di erent
callbacks so that events can be properly routed.

Delegates
SurfaceChangedDelegate

The SurfaceChanged delegate handles SurfaceChanged events as generated by
calling Update on a SurfaceObserver. Applications can use the bounds,
changeType, and updateTime to selectively generate mesh data for the set of
known surfaces.

SurfaceDataReadyDelegate

The SurfaceDataReadyDelegate handles events generated when the engine has
completed generating a mesh. Mesh generation is requested through
GetMeshAsync and may take many frames to complete.

Leave feedback

Description
The WorldAnchor component allows a GameObject's position to be locked in physical space.
For example, a cube arranged on top of a physical desk with a WorldAnchor applied will remain xed even as an
observer walks around the room. This overrides all manipulation of the GameObject's position and orientation.
To move the GameObject, rst remove the WorldAnchor and manipulate the Transform normally.
While it is generally recommended to use Destroy instead of DestroyImmediate, it's best to call DestroyImmediate
on WorldAnchor objects. Doing so will let you manipulate the Transform of the GameObject including adding a
new WorldAnchor.

Properties
isLocated

Returns true if this WorldAnchor is located (read only). A return of false typically indicates
a loss of tracking.

Public Methods
GetNativeSpatialAnchorPtr

Retrieve a native pointer to the Windows.Perception.Spatial.SpatialAnchor COM
object. This function calls IUnknown::AddRef on the pointer before returning it.
The pointer must be released by calling IUnknown::Release.

SetNativeSpatialAnchorPtr

Assigns the Windows.Perception.Spatial.SpatialAnchor COM pointer maintained
by this WorldAnchor.

Events
OnTrackingChanged

OnTrackingChanged noti es listeners when this object's tracking state changes.

Delegates
OnTrackingChangedDelegate

Event that is red when this object's tracking state changes.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
This class represents the state of the real world tracking system.

Static Properties
state

The current state of the world tracking systems.

Static Methods
GetNativeISpatialCoordinateSystemPtr

Return the native pointer to
Windows::Perception::Spatial::ISpatialCoordinateSystem which was
retrieved from an
Windows::Perception::Spatial::ISpatialStationaryFrameOfReference
object underlying the Unity World Origin.

Events
OnPositionalLocatorStateChanged

Event red when the world tracking systems state has changed.

Delegates
OnPositionalLocatorStateChangedDelegate

Callback on when the world tracking systems state has changed.

Leave feedback

Description
Enum indicating the reason why connection to remote device has failed.

Properties
None

No failure.

Unknown

Couldn't identify the reason why connection failed.

Unreachable

Remove device is not reachable.

HandshakeFailed

Handskahe failed while traying to establish connection with remote device.

ProtocolVersionMismatch

Protocol used by the app does not match remoting app running on remote
device.

ConnectionLost

Enum indicating the reason why remote connection failed.

Leave feedback

Description
Current state of the holographis streamer remote connection.

Properties
Disconnected

Indicates app being currently disconnected from any other remote device.

Connecting

Indicates app trying to connect to remote device.

Connected

Indicates app being connected to remote device.

Leave feedback

Description
Indicates the lifecycle state of the device's spatial location system.
This is the tracking state for the device. It lets your application know whether position and orientation in the
user's surroundings are available from the device.

Properties
Unavailable

The device's spatial location system is not available.

OrientationOnly

The device is reporting its orientation and has not been asked to report its position in the
user's surroundings.

Activating

The device is reporting its orientation and is preparing to locate its position in the user's
surroundings.

Active

The device is reporting its orientation and position in the user's surroundings.

Inhibited

The device is reporting its orientation but cannot locate its position in the user's
surroundings due to external factors like poor lighting conditions.

Leave feedback

Description
Enumeration of the di erent types of SurfaceChange events.

Properties
Added

Surface was Added.

Updated

Surface was updated.

Removed

Surface was removed.

Leave feedback

Description
Class used to override a camera's default background rendering path to instead render a given Texture and/or
Material. This will typically be used with images from the color camera for rendering the AR background on
mobile devices.

Properties
backgroundMaterial

The Material used for AR rendering.

backgroundTexture

An optional Texture used for AR rendering. If this property is not set then the texture
set in ARBackgroundRenderer.backgroundMaterial as "_MainTex" is used.

camera

An optional Camera whose background rendering will be overridden by this class. If
this property is not set then the main Camera in the Scene is used.

mode

When set to ARRenderMode.StandardBackground (default) the camera is not
overridden to display the background image. Setting this property to
ARRenderMode.MaterialAsBackground will render the texture speci ed by
ARBackgroundRenderer.backgroundMaterial and or
ARBackgroundRenderer.backgroundTexture as the background.

Protected Methods
DisableARBackgroundRendering

Disables AR background rendering. This method is called internally but can
be overridden by users who wish to subclass ARBackgroundRenderer to
customize handling of AR background rendering.

Events
backgroundRendererChanged

Called when any of the public properties of this class have been changed.

Leave feedback

Description
A collection of methods and properties for interacting with the XR tracking system.

Static Properties
disablePositionalTracking

Disables positional tracking in XR. This takes e ect the next time the head pose is
sampled. If set to true the camera only tracks headset rotation state.

Static Methods
GetLocalPosition

Gets the position of a speci c node.

GetLocalRotation

Gets the rotation of a speci c node.

GetNodeName

Accepts the unique identi er for a tracked node and returns a friendly name for it.

GetNodeStates

Describes all currently connected XRNodes and provides available tracking states for each.

Recenter

Center tracking to the current position and orientation of the HMD.

Events
nodeAdded

Called when a tracked node is added to the underlying XR system.

nodeRemoved

Called when a tracked node is removed from the underlying XR system.

trackingAcquired

Called when a tracked node begins reporting tracking information.

trackingLost

Called when a tracked node stops reporting tracking information.

Leave feedback

Description
Contains all functionality related to a XR device.

Static Properties
fovZoomFactor

Zooms the XR projection.

isPresent

Successfully detected a XR device in working order.

model

Speci c model of loaded XR device.

refreshRate

Refresh rate of the display in Hertz.

trackingOriginMode

Returns the devices TrackingOriginType.

userPresence

Indicates whether the user is present and interacting with the device.

Static Methods
DisableAutoXRCameraTracking

Sets whether the camera passed in the rst parameter is controlled
implicitly by the XR Device

GetNativePtr

This method returns an IntPtr representing the native pointer to the XR
device if one is available, otherwise the value will be IntPtr.Zero.

GetTrackingSpaceType

Returns the device's current TrackingSpaceType. This value determines how
the camera is positioned relative to its starting position. For more, see the
section "Understanding the camera" in VROverview.

SetTrackingSpaceType

Sets the device's current TrackingSpaceType. Returns true on success.
Returns false if the given TrackingSpaceType is not supported or the device
fails to switch.

Events
deviceLoaded

Subscribe a delegate to this event to get noti ed when an XRDevice is successfully loaded.

Leave feedback

Description
Describes the state of a node tracked by a XR system. .

Properties
acceleration

Sets the vector representing the current acceleration of the tracked node.

angularAcceleration

Sets the vector representing the current angular acceleration of the tracked node.

angularVelocity

Sets the vector representing the current angular velocity of the tracked node.

nodeType

The type of the tracked node as speci ed in XRNode.

position

Sets the vector representing the current position of the tracked node.

rotation

Sets the quaternion representing the current rotation of the tracked node.

tracked

Set to true if the node is presently being tracked by the underlying XR system, and false
if the node is not presently being tracked by the underlying XR system.

uniqueID

The unique identi er of the tracked node.

velocity

Sets the vector representing the current velocity of the tracked node.

Public Methods
TryGetAcceleration

Attempt to retrieve a vector representing the current acceleration of the tracked
node.

TryGetAngularAcceleration

Attempt to retrieve a Vector3 representing the current angular acceleration of
the tracked node.

TryGetAngularVelocity

Attempt to retrieve a Vector3 representing the current angular velocity of the
tracked node.

TryGetPosition

Attempt to retrieve a vector representing the current position of the tracked
node.

TryGetRotation

Attempt to retrieve a quaternion representing the current rotation of the tracked
node.

TryGetVelocity

Attempt to retrieve a vector representing the current velocity of the tracked
node.

Leave feedback

Description
Global XR related settings.

Static Properties
enabled

Globally enables or disables XR for the application.

eyeTextureDesc

Fetch the eye texture RenderTextureDescriptor from the active stereo device.

eyeTextureHeight

The current height of an eye texture for the loaded device.

eyeTextureResolutionScale

Controls the actual size of eye textures as a multiplier of the device's default
resolution.

eyeTextureWidth

The current width of an eye texture for the loaded device.

gameViewRenderMode

Sets the render mode for the XR device. The render mode controls how the view
of the XR device renders in the Game view and in the main window on a host PC.

isDeviceActive

Read-only value that can be used to determine if the XR device is active.

loadedDeviceName

Type of XR device that is currently loaded.

occlusionMaskScale

A scale applied to the standard occulsion mask for each platform.

renderViewportScale

Controls how much of the allocated eye texture should be used for rendering.

showDeviceView

This property has been deprecated. Use XRSettings.gameViewRenderMode
instead.

stereoRenderingMode

The stereo rendering mode that is currently in use.

supportedDevices

Returns a list of supported XR devices that were included at build time.

useOcclusionMesh

Speci es whether or not the occlusion mesh should be used when rendering.
Enabled by default.

Static Methods
LoadDeviceByName

Loads the requested device at the beginning of the next frame.

Leave feedback

Description
Timing and other statistics from the XR subsystem.
Some XR SDKs provide access to additional timing and other statistics. These can be used by games and
applications for pro ling and dynamic performance adjustments. For example, modifying
XRSettings.eyeTextureResolutionScale or XRSettings.renderViewportScale during runtime can improve
performance. This class exposes a set of information that can be optionally reported by SDKs. Make sure to use
the return values of any methods to know whether the data is being reported by the SDK or not.

Static Methods
TryGetDroppedFrameCount

Retrieves the number of dropped frames reported by the XR SDK.

TryGetFramePresentCount

Retrieves the number of times the current frame has been drawn to the device
as reported by the XR SDK.

TryGetGPUTimeLastFrame

Retrieves the time spent by the GPU last frame, in seconds, as reported by the
XR SDK.

Leave feedback

Description
Enumeration describing the AR rendering mode used with ARBackgroundRenderer.

Properties
StandardBackground

The standard background is rendered. (Skybox, Solid Color, etc.)

MaterialAsBackground

The material associated with ARBackgroundRenderer is being rendered as the
background.

Leave feedback

Description
Enumeration of available modes for XR rendering in the Game view or in the main window on a host PC. XR
rendering only occurs when the Unity Editor is in Play Mode.

Properties
LeftEye

Renders the left eye of the XR device in the Game View window or in main window on a
host PC.

RightEye

Renders the right eye of the XR device in the Game View window or in main window on a
host PC.

BothEyes

Renders both eyes of the XR device side-by-side in the Game view or in the main window
on a host PC.

OcclusionMesh

Renders both eyes of the XR device, and the occlusion mesh, side-by-side in the Game
view or in the main window on a host PC.

Leave feedback

Description
Represents the size of physical space available for XR.

Properties
Stationary

Represents a small space where movement may be constrained or positional tracking is
unavailable.

RoomScale

Represents a space large enough for free movement.

Leave feedback

Description
Represents the current user presence state detected by the device.
See Also: XRDevice.userPresence.

Properties
Unsupported

The device does not support detecting user presence.

NotPresent

The device does not detect that the user is present.

Present

The device detects that the user is present.

Unknown

The device is currently in a state where it cannot determine user presence.

Leave feedback

Description
Enumeration of XR nodes which can be updated by XR input or sent haptic data.
Note: The types GameController, TrackingReference, and HardwareTracker are considered non-singleton nodes,
as there can be many of each available. As a result, InputTracking.GetLocalPosition, and
InputTracking.GetLocalRotation will not work with those values. Please use InputTracking.GetNodeStates instead.
Note: Only XR nodes with valid haptic devices as endpoints can be sent haptic data.

Properties
LeftEye

Node representing the left eye.

RightEye

Node representing the right eye.

CenterEye

Node representing a point between the left and right eyes.

Head

Node representing the user's head.

LeftHand

Node representing the left hand.

RightHand

Node representing the right hand.

GameController

Represents a tracked game Controller not associated with a speci c hand.

TrackingReference

Represents a stationary physical device that can be used as a point of reference in the
tracked area.

HardwareTracker

Represents a physical device that provides tracking data for objects to which it is
attached.

Leave feedback

Description
Structure describing acceleration status of the device.

Properties
acceleration

Value of acceleration.

deltaTime

Amount of time passed since last accelerometer measurement.

Leave feedback

Description
Parent class for all joints that have anchor points.
See Also: DistanceJoint2D class, HingeJoint2D class, SliderJoint2D class, SpringJoint2D class, WheelJoint2D class.

Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie, the object
without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
AndroidInput provides support for o -screen touch input, such as a touchpad.

Static Properties
secondaryTouchEnabled

Property indicating whether the system provides secondary touch input.

secondaryTouchHeight

Property indicating the height of the secondary touchpad.

secondaryTouchWidth

Property indicating the width of the secondary touchpad.

touchCountSecondary

Number of secondary touches. Guaranteed not to change throughout the frame.
(Read Only).

Static Methods
GetSecondaryTouch

Returns object representing status of a speci c touch on a secondary touchpad (Does
not allocate temporary variables).

Leave feedback

Description
AndroidJavaClass is the Unity representation of a generic instance of java.lang.Class.

Constructors
AndroidJavaClass

Construct an AndroidJavaClass from the class name.

Inherited Members
Public Methods
Call

Calls a Java method on an object (non-static).

CallStatic

Call a static Java method on a class.

Dispose

IDisposable callback.

Get

Get the value of a eld in an object (non-static).

GetRawClass

Retrieves the raw jclass pointer to the Java class.Note: Using raw JNI functions requires
advanced knowledge of the Android Java Native Interface (JNI). Please take note.

GetRawObject

Retrieves the raw jobject pointer to the Java object.Note: Using raw JNI functions requires
advanced knowledge of the Android Java Native Interface (JNI). Please take note.

GetStatic

Get the value of a static eld in an object type.

Set

Set the value of a eld in an object (non-static).

SetStatic

Set the value of a static eld in an object type.

Leave feedback

Description
AndroidJavaObject is the Unity representation of a generic instance of java.lang.Object.
It can be used as type-less interface to an instance of any Java class.

Constructors
AndroidJavaObject

Construct an AndroidJavaObject based on the name of the class.

Public Methods
Call

Calls a Java method on an object (non-static).

CallStatic

Call a static Java method on a class.

Dispose

IDisposable callback.

Get

Get the value of a eld in an object (non-static).

GetRawClass

Retrieves the raw jclass pointer to the Java class.Note: Using raw JNI functions requires
advanced knowledge of the Android Java Native Interface (JNI). Please take note.

GetRawObject

Retrieves the raw jobject pointer to the Java object.Note: Using raw JNI functions requires
advanced knowledge of the Android Java Native Interface (JNI). Please take note.

GetStatic

Get the value of a static eld in an object type.

Set

Set the value of a eld in an object (non-static).

SetStatic

Set the value of a static eld in an object type.

Leave feedback

Description
This class can be used to implement any java interface. Any java vm method invocation matching the interface on
the proxy object will automatically be passed to the c# implementation.

// Opens an android date picker dialog and grabs the result using a callback.
using UnityEngine;
using System;

class ExampleClass : MonoBehaviour
{
private static DateTime selectedDate = DateTime.Now;

class DateCallback : AndroidJavaProxy
{
public DateCallback() : base("android.app.DatePickerDialog$OnDateSetList
void onDateSet(AndroidJavaObject view, int year, int monthOfYear, int da
{
selectedDate = new DateTime(year, monthOfYear + 1, dayOfMonth);
}
}

void OnGUI()
{
if (GUI.Button(new Rect(15, 15, 450, 75), string.Format("{0:yyyy-MM-dd}"
{
AndroidJavaClass activity = new AndroidJavaClass("com.unity3d.player
activity.Call("runOnUiThread", new AndroidJavaRunnable(() =>
{
new AndroidJavaObject("android.app.DatePickerDialog", activity,
}));
}
}
}

Properties
javaInterface

Java interface implemented by the proxy.

Constructors
AndroidJavaProxy

Public Methods
equals

The equivalent of the java.lang.Object equals() method.

hashCode

The equivalent of the java.lang.Object hashCode() method.

Invoke

Called by the java vm whenever a method is invoked on the java proxy interface. You can
override this to run special code on method invokation, or you can leave the
implementation as is, and leave the default behavior which is to look for c# methods
matching the signature of the java method.

toString

The equivalent of the java.lang.Object toString() method.

Leave feedback

Description
'Raw' JNI interface to Android Dalvik (Java) VM from Mono (CS/JS).
Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take
note.

Static Methods
AllocObject

Allocates a new Java object without invoking any of the constructors for the object.

AttachCurrentThread

Attaches the current thread to a Java (Dalvik) VM.

CallBooleanMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallByteMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallCharMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallDoubleMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallFloatMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallIntMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallLongMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallObjectMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallShortMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallStaticBooleanMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticByteMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticCharMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticDoubleMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticFloatMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticIntMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticLongMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticObjectMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticShortMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticStringMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStaticVoidMethod

Invokes a static method on a Java object, according to the speci ed methodID,
optionally passing an array of arguments (args) to the method.

CallStringMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

CallVoidMethod

Calls an instance (nonstatic) Java method de ned by methodID, optionally passing
an array of arguments (args) to the method.

DeleteGlobalRef

Deletes the global reference pointed to by obj.

DeleteLocalRef

Deletes the local reference pointed to by obj.

DetachCurrentThread

Detaches the current thread from a Java (Dalvik) VM.

EnsureLocalCapacity

Ensures that at least a given number of local references can be created in the
current thread.

ExceptionClear

Clears any exception that is currently being thrown.

ExceptionDescribe

Prints an exception and a backtrace of the stack to the logcat

ExceptionOccurred

Determines if an exception is being thrown.

FatalError

Raises a fatal error and does not expect the VM to recover. This function does not
return.

FindClass

This function loads a locally-de ned class.

FromBooleanArray

Convert a Java array of boolean to a managed array of System.Boolean.

FromByteArray

Convert a Java array of byte to a managed array of System.Byte.

FromCharArray

Convert a Java array of char to a managed array of System.Char.

FromDoubleArray

Convert a Java array of double to a managed array of System.Double.

FromFloatArray

Convert a Java array of oat to a managed array of System.Single.

FromIntArray

Convert a Java array of int to a managed array of System.Int32.

FromLongArray

Convert a Java array of long to a managed array of System.Int64.

FromObjectArray

Convert a Java array of java.lang.Object to a managed array of System.IntPtr,
representing Java objects.

FromRe ectedField

Converts a java.lang.re ect.Field to a eld ID.

FromRe ectedMethod

Converts a java.lang.re ect.Method or java.lang.re ect.Constructor object to a
method ID.

FromShortArray

Convert a Java array of short to a managed array of System.Int16.

GetArrayLength

Returns the number of elements in the array.

GetBooleanArrayElement

Returns the value of one element of a primitive array.

GetBooleanField

This function returns the value of an instance (nonstatic) eld of an object.

GetByteArrayElement

Returns the value of one element of a primitive array.

GetByteField

This function returns the value of an instance (nonstatic) eld of an object.

GetCharArrayElement

Returns the value of one element of a primitive array.

GetCharField

This function returns the value of an instance (nonstatic) eld of an object.

GetDoubleArrayElement

Returns the value of one element of a primitive array.

GetDoubleField

This function returns the value of an instance (nonstatic) eld of an object.

GetFieldID

Returns the eld ID for an instance (nonstatic) eld of a class.

GetFloatArrayElement

Returns the value of one element of a primitive array.

GetFloatField

This function returns the value of an instance (nonstatic) eld of an object.

GetIntArrayElement

Returns the value of one element of a primitive array.

GetIntField

This function returns the value of an instance (nonstatic) eld of an object.

GetLongArrayElement

Returns the value of one element of a primitive array.

GetLongField

This function returns the value of an instance (nonstatic) eld of an object.

GetMethodID

Returns the method ID for an instance (nonstatic) method of a class or interface.

GetObjectArrayElement

Returns an element of an Object array.

GetObjectClass

Returns the class of an object.

GetObjectField

This function returns the value of an instance (nonstatic) eld of an object.

GetShortArrayElement

Returns the value of one element of a primitive array.

GetShortField

This function returns the value of an instance (nonstatic) eld of an object.

GetStaticBooleanField

This function returns the value of a static eld of an object.

GetStaticByteField

This function returns the value of a static eld of an object.

GetStaticCharField

This function returns the value of a static eld of an object.

GetStaticDoubleField

This function returns the value of a static eld of an object.

GetStaticFieldID

Returns the eld ID for a static eld of a class.

GetStaticFloatField

This function returns the value of a static eld of an object.

GetStaticIntField

This function returns the value of a static eld of an object.

GetStaticLongField

This function returns the value of a static eld of an object.

GetStaticMethodID

Returns the method ID for a static method of a class.

GetStaticObjectField

This function returns the value of a static eld of an object.

GetStaticShortField

This function returns the value of a static eld of an object.

GetStaticStringField

This function returns the value of a static eld of an object.

GetStringField

This function returns the value of an instance (nonstatic) eld of an object.

GetStringUTFChars

Returns a managed string object representing the string in modi ed UTF-8
encoding.

GetStringUTFLength

Returns the length in bytes of the modi ed UTF-8 representation of a string.

GetSuperclass

If clazz represents any class other than the class Object, then this function returns
the object that represents the superclass of the class speci ed by clazz.

GetVersion

Returns the version of the native method interface.

IsAssignableFrom

Determines whether an object of clazz1 can be safely cast to clazz2.

IsInstanceOf

Tests whether an object is an instance of a class.

IsSameObject

Tests whether two references refer to the same Java object.

NewBooleanArray

Construct a new primitive array object.

NewByteArray

Construct a new primitive array object.

NewCharArray

Construct a new primitive array object.

NewDoubleArray

Construct a new primitive array object.

NewFloatArray

Construct a new primitive array object.

NewGlobalRef

Creates a new global reference to the object referred to by the obj argument.

NewIntArray

Construct a new primitive array object.

NewLocalRef

Creates a new local reference that refers to the same object as obj.

NewLongArray

Construct a new primitive array object.

NewObject

Constructs a new Java object. The method ID indicates which constructor method
to invoke. This ID must be obtained by calling GetMethodID() with  as the
method name and void (V) as the return type.

NewObjectArray

Constructs a new array holding objects in class clazz. All elements are initially set
to obj.

NewShortArray

Construct a new primitive array object.

NewStringUTF

Constructs a new java.lang.String object from an array of characters in modi ed
UTF-8 encoding.

PopLocalFrame

Pops o the current local reference frame, frees all the local references, and
returns a local reference in the previous local reference frame for the given result
object.

PushLocalFrame

Creates a new local reference frame, in which at least a given number of local
references can be created.

SetBooleanArrayElement

Sets the value of one element in a primitive array.

SetBooleanField

This function sets the value of an instance (nonstatic) eld of an object.

SetByteArrayElement

Sets the value of one element in a primitive array.

SetByteField

This function sets the value of an instance (nonstatic) eld of an object.

SetCharArrayElement

Sets the value of one element in a primitive array.

SetCharField

This function sets the value of an instance (nonstatic) eld of an object.

SetDoubleArrayElement

Sets the value of one element in a primitive array.

SetDoubleField

This function sets the value of an instance (nonstatic) eld of an object.

SetFloatArrayElement

Sets the value of one element in a primitive array.

SetFloatField

This function sets the value of an instance (nonstatic) eld of an object.

SetIntArrayElement

Sets the value of one element in a primitive array.

SetIntField

This function sets the value of an instance (nonstatic) eld of an object.

SetLongArrayElement

Sets the value of one element in a primitive array.

SetLongField

This function sets the value of an instance (nonstatic) eld of an object.

SetObjectArrayElement

Sets an element of an Object array.

SetObjectField

This function sets the value of an instance (nonstatic) eld of an object.

SetShortArrayElement

Sets the value of one element in a primitive array.

SetShortField

This function sets the value of an instance (nonstatic) eld of an object.

SetStaticBooleanField

This function ets the value of a static eld of an object.

SetStaticByteField

This function ets the value of a static eld of an object.

SetStaticCharField

This function ets the value of a static eld of an object.

SetStaticDoubleField

This function ets the value of a static eld of an object.

SetStaticFloatField

This function ets the value of a static eld of an object.

SetStaticIntField

This function ets the value of a static eld of an object.

SetStaticLongField

This function ets the value of a static eld of an object.

SetStaticObjectField

This function ets the value of a static eld of an object.

SetStaticShortField

This function ets the value of a static eld of an object.

SetStaticStringField

This function ets the value of a static eld of an object.

SetStringField

This function sets the value of an instance (nonstatic) eld of an object.

Throw

Causes a java.lang.Throwable object to be thrown.

ThrowNew

Constructs an exception object from the speci ed class with the message
speci ed by message and causes that exception to be thrown.

ToBooleanArray

Convert a managed array of System.Boolean to a Java array of boolean.

ToByteArray

Convert a managed array of System.Byte to a Java array of byte.

ToCharArray

Convert a managed array of System.Char to a Java array of char.

ToDoubleArray

Convert a managed array of System.Double to a Java array of double.

ToFloatArray

Convert a managed array of System.Single to a Java array of oat.

ToIntArray

Convert a managed array of System.Int32 to a Java array of int.

ToLongArray

Convert a managed array of System.Int64 to a Java array of long.

ToObjectArray

Convert a managed array of System.IntPtr, representing Java objects, to a Java
array of java.lang.Object.

ToRe ectedField

Converts a eld ID derived from cls to a java.lang.re ect.Field object.

ToRe ectedMethod

Converts a method ID derived from clazz to a java.lang.re ect.Method or
java.lang.re ect.Constructor object.

ToShortArray

Convert a managed array of System.Int16 to a Java array of short.

Leave feedback

Description
Helper interface for JNI interaction; signature creation and method lookups.
Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI). Please take
note.

Static Properties
debug

Set debug to true to log calls through the AndroidJNIHelper.

Static Methods
ConvertFromJNIArray

Creates a managed array from a Java array.

ConvertToJNIArray

Creates a Java array from a managed array.

CreateJavaProxy

Creates a java proxy object which connects to the supplied proxy implementation.

CreateJavaRunnable

Creates a UnityJavaRunnable object (implements java.lang.Runnable).

CreateJNIArgArray

Creates the parameter array to be used as argument list when invoking Java code
through CallMethod() in AndroidJNI.

DeleteJNIArgArray

Deletes any local jni references previously allocated by CreateJNIArgArray().

GetConstructorID

Scans a particular Java class for a constructor method matching a signature.

GetFieldID

Scans a particular Java class for a eld matching a name and a signature.

GetMethodID

Scans a particular Java class for a method matching a name and a signature.

GetSignature

Creates the JNI signature string for particular object type.

Leave feedback
SWITCH TO MANUAL

Description
The animation component is used to play back animations.
You can assign animation clips to the animation component and control playback from your script. The animation
system in Unity is weight-based and supports Animation Blending, Additive animations, Animation Mixing, Layers
and full control over all aspects of playback.
For an overview of animation scripting in Unity please read this introduction.
AnimationState can be used to change the layer of an animation, modify playback speed, and for direct control
over blending and mixing.
Also Animation supports enumerators. Looping through all AnimationStates is performed like this:

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public Animation anim;

void Start()
{
anim = GetComponent();
foreach (AnimationState state in anim)
{
state.speed = 0.5F;
}
}
}

See Also: An overview of animation scripting in Unity is here.

Properties
animatePhysics

When turned on, animations will be executed in the physics loop. This is only useful in
conjunction with kinematic rigidbodies.

clip

The default animation.

cullingType

Controls culling of this Animation component.

isPlaying

Is an animation currently being played?

localBounds

AABB of this Animation animation component in local space.

playAutomatically

Should the default animation clip (the Animation.clip property) automatically start playing
on startup?

this[string]

Returns the animation state named name.

wrapMode

How should time beyond the playback range of the clip be treated?

Public Methods
AddClip

Adds a clip to the animation with name newName.

Blend

Blends the animation named animation towards targetWeight over the next time
seconds.

CrossFade

Fades the animation with name animation in over a period of time seconds and fades
other animations out.

CrossFadeQueued

Cross fades an animation after previous animations has nished playing.

GetClipCount

Get the number of clips currently assigned to this animation.

IsPlaying

Is the animation named name playing?

Play

Plays an animation without blending.

PlayQueued

Plays an animation after previous animations has nished playing.

RemoveClip

Remove clip from the animation list.

Rewind

Rewinds the animation named name.

Sample

Samples animations at the current state.

Stop

Stops all playing animations that were started with this Animation.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Stores keyframe based animations.
AnimationClip is used by Animation to play back animations.

Properties
empty

Returns true if the animation clip has no curves and no events.

events

Animation Events for this animation clip.

frameRate

Frame rate at which keyframes are sampled. (Read Only)

hasGenericRootTransform

Returns true if the Animation has animation on the root transform.

hasMotionCurves

Returns true if the AnimationClip has root motion curves.

hasMotionFloatCurves

Returns true if the AnimationClip has editor curves for its root motion.

hasRootCurves

Returns true if the AnimationClip has root Curves.

humanMotion

Returns true if the animation contains curve that drives a humanoid rig.

legacy

Set to true if the AnimationClip will be used with the Legacy Animation
component ( instead of the Animator ).

length

Animation length in seconds. (Read Only)

localBounds

AABB of this Animation Clip in local space of Animation component that it is
attached too.

wrapMode

Sets the default wrap mode used in the animation state.

Constructors
AnimationClip

Creates a new animation clip.

Public Methods
AddEvent

Adds an animation event to the clip.

ClearCurves

Clears all curves from the clip.

EnsureQuaternionContinuity

Realigns quaternion keys to ensure shortest interpolation paths.

SampleAnimation

Samples an animation at a given time for any animated properties.

SetCurve

Assigns the curve to animate a speci c property.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Obsolete

Description
This class de nes a pair of clips used by AnimatorOverrideController.
Each original clip from the controller can be overriden with another clip.

Leave feedback

Description
Store a collection of Keyframes that can be evaluated over time.

Properties
keys

All keys de ned in the animation curve.

length

The number of keys in the curve. (Read Only)

postWrapMode

The behaviour of the animation after the last keyframe.

preWrapMode

The behaviour of the animation before the rst keyframe.

this[int]

Retrieves the key at index. (Read Only)

Constructors
AnimationCurve

Creates an animation curve from an arbitrary number of keyframes.

Public Methods
AddKey

Add a new key to the curve.

Evaluate

Evaluate the curve at time.

MoveKey

Removes the keyframe at index and inserts key.

RemoveKey

Removes a key.

SmoothTangents

Smooth the in and out tangents of the keyframe at index.

Static Methods
Constant

Creates a constant "curve" starting at timeStart, ending at timeEnd and with the value
value.

EaseInOut

Creates an ease-in and out curve starting at timeStart, valueStart and ending at timeEnd,
valueEnd.

Linear

A straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd.

Leave feedback

Description
AnimationEvent lets you call a script function similar to SendMessage as part of playing back an animation.
Animation events support functions that take zero or one parameter. The parameter can be a oat, an int, a
string, an object reference, or an AnimationEvent.

// Animation Event example
// Small example that can be called on each specified frame.
// The code is executed once per animation loop.

using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour
{
public void PrintEvent()
{
Debug.Log("PrintEvent");
}
}

A more detailed example below shows a more complex way of creating an animation. In this script example the
Animator component is accessed and a Clip from it obtained. (This clip was set up in the Animation window.)
The clip lasts for 2 seconds. An AnimationEvent is created, and has parameters set. The parameters include the
function PrintEvent() which will handle the event. The event is then added to the clip. This all happens in
Start(). Once the game has launched the event is called after 1.3s and then repeats every 2s.

// Add an Animation Event to a GameObject that has an Animator
using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour
{
public void Start()
{
// existing components on the GameObject
AnimationClip clip;

Animator anim;

// new event created
AnimationEvent evt;
evt = new AnimationEvent();

// put some parameters on the AnimationEvent
// - call the function called PrintEvent()
// - the animation on this object lasts 2 seconds
//
and the new animation created here is
//
set up to happen 1.3s into the animation
evt.intParameter = 12345;
evt.time = 1.3f;
evt.functionName = "PrintEvent";

// get the animation clip and add the AnimationEvent
anim = GetComponent();
clip = anim.runtimeAnimatorController.animationClips[0];
clip.AddEvent(evt);
}

// the function to be called as an event
public void PrintEvent(int i)
{
print("PrintEvent: " + i + " called at: " + Time.time);
}
}

Properties
animationState

The animation state that red this event (Read Only).

animatorClipInfo

The animator clip info related to this event (Read Only).

animatorStateInfo

The animator state info related to this event (Read Only).

oatParameter

Float parameter that is stored in the event and will be sent to the function.

functionName

The name of the function that will be called.

intParameter

Int parameter that is stored in the event and will be sent to the function.

isFiredByAnimator

Returns true if this Animation event has been red by an Animator component.

isFiredByLegacy

Returns true if this Animation event has been red by an Animation component.

messageOptions

Function call options.

objectReferenceParameter

Object reference parameter that is stored in the event and will be sent to the
function.

stringParameter

String parameter that is stored in the event and will be sent to the function.

time

The time at which the event will be red o .

Constructors
AnimationEvent

Creates a new animation event.

Leave feedback
Obsolete

Description
Information about what animation clips is played and its weight.

Leave feedback

Description
The AnimationState gives full control over animation blending.
In most cases the Animation interface is su cient and easier to use. Use the AnimationState if you need full
control over the animation blending any playback process.
The AnimationState interface allows you to modify speed, weight, time and layers while any animation is playing.
You can also setup animation mixing and wrapMode.
The Animation.

Properties
blendMode

Which blend mode should be used?

clip

The clip that is being played by this animation state.

enabled

Enables / disables the animation.

length

The length of the animation clip in seconds.

name

The name of the animation.

normalizedSpeed

The normalized playback speed.

normalizedTime

The normalized time of the animation.

speed

The playback speed of the animation. 1 is normal playback speed.

time

The current time of the animation.

weight

The weight of animation.

wrapMode

Wrapping mode of the animation.

Public Methods
AddMixingTransform

Adds a transform which should be animated. This allows you to reduce the
number of animations you have to create.

RemoveMixingTransform

Removes a transform which should be animated.

Leave feedback
SWITCH TO MANUAL

Description
Interface to control the Mecanim animation system.

Properties
angularVelocity

Gets the avatar angular velocity for the last evaluated frame.

applyRootMotion

Should root motion be applied?

avatar

Gets/Sets the current Avatar.

bodyPosition

The position of the body center of mass.

bodyRotation

The rotation of the body center of mass.

cullingMode

Controls culling of this Animator component.

deltaPosition

Gets the avatar delta position for the last evaluated frame.

deltaRotation

Gets the avatar delta rotation for the last evaluated frame.

feetPivotActive

Blends pivot point between body center of mass and feet pivot.

reEvents

Sets whether the Animator sends events of type AnimationEvent.

gravityWeight

The current gravity weight based on current animations that are
played.

hasBoundPlayables

Returns true if Animator has any playables assigned to it.

hasRootMotion

Returns true if the current rig has root motion.

hasTransformHierarchy

Returns true if the object has a transform hierarchy.

humanScale

Returns the scale of the current Avatar for a humanoid rig, (1 by
default if the rig is generic).

isHuman

Returns true if the current rig is humanoid, false if it is generic.

isInitialized

Returns whether the animator is initialized successfully.

isMatchingTarget

If automatic matching is active.

isOptimizable

Returns true if the current rig is optimizable with
AnimatorUtility.OptimizeTransformHierarchy.

keepAnimatorControllerStateOnDisable

Controls the behaviour of the Animator component when a

GameObject is disabled.
layerCount

Returns the number of layers in the controller.

layersA ectMassCenter

Additional layers a ects the center of mass.

leftFeetBottomHeight

Get left foot bottom height.

parameterCount

Returns the number of parameters in the controller.

parameters

The AnimatorControllerParameter list used by the animator. (Read
Only)

pivotPosition

Get the current position of the pivot.

pivotWeight

Gets the pivot weight.

playableGraph

The PlayableGraph created by the Animator.

playbackTime

Sets the playback position in the recording bu er.

recorderMode

Gets the mode of the Animator recorder.

recorderStartTime

Start time of the rst frame of the bu er relative to the frame at
which StartRecording was called.

recorderStopTime

End time of the recorded clip relative to when StartRecording was
called.

rightFeetBottomHeight

Get right foot bottom height.

rootPosition

The root position, the position of the game object.

rootRotation

The root rotation, the rotation of the game object.

runtimeAnimatorController

The runtime representation of AnimatorController that controls the
Animator.

speed

The playback speed of the Animator. 1 is normal playback speed.

stabilizeFeet

Automatic stabilization of feet during transition and blending.

targetPosition

Returns the position of the target speci ed by SetTarget.

targetRotation

Returns the rotation of the target speci ed by SetTarget.

updateMode

Speci es the update mode of the Animator.

velocity

Gets the avatar velocity for the last evaluated frame.

Public Methods
ApplyBuiltinRootMotion

Apply the default Root Motion.

CrossFade

Creates a crossfade from the current state to any other state using
normalized times.

CrossFadeInFixedTime

Creates a crossfade from the current state to any other state using times
in seconds.

GetAnimatorTransitionInfo

Returns an AnimatorTransitionInfo with the informations on the current
transition.

GetBehaviour

Returns the rst StateMachineBehaviour that matches type T or is
derived from T. Returns null if none are found.

GetBehaviours

Returns all StateMachineBehaviour that match type T or are derived from
T. Returns null if none are found.

GetBoneTransform

Returns Transform mapped to this human bone id.

GetBool

Returns the value of the given boolean parameter.

GetCurrentAnimatorClipInfo

Returns an array of all the AnimatorClipInfo in the current state of the
given layer.

GetCurrentAnimatorClipInfoCount

Returns the number of AnimatorClipInfo in the current state.

GetCurrentAnimatorStateInfo

Returns an AnimatorStateInfo with the information on the current state.

GetFloat

Returns the value of the given oat parameter.

GetIKHintPosition

Gets the position of an IK hint.

GetIKHintPositionWeight

Gets the translative weight of an IK Hint (0 = at the original animation
before IK, 1 = at the hint).

GetIKPosition

Gets the position of an IK goal.

GetIKPositionWeight

Gets the translative weight of an IK goal (0 = at the original animation
before IK, 1 = at the goal).

GetIKRotation

Gets the rotation of an IK goal.

GetIKRotationWeight

Gets the rotational weight of an IK goal (0 = rotation before IK, 1 =
rotation at the IK goal).

GetInteger

Returns the value of the given integer parameter.

GetLayerIndex

Returns the index of the layer with the given name.

GetLayerName

Returns the layer name.

GetLayerWeight

Returns the weight of the layer at the speci ed index.

GetNextAnimatorClipInfo

Returns an array of all the AnimatorClipInfo in the next state of the given
layer.

GetNextAnimatorClipInfoCount

Returns the number of AnimatorClipInfo in the next state.

GetNextAnimatorStateInfo

Returns an AnimatorStateInfo with the information on the next state.

GetParameter

See AnimatorController.parameters.

HasState

Returns true if the state exists in this layer, false otherwise.

InterruptMatchTarget

Interrupts the automatic target matching.

IsInTransition

Returns true if there is a transition on the given layer, false otherwise.

IsParameterControlledByCurve

Returns true if the parameter is controlled by a curve, false otherwise.

MatchTarget

Automatically adjust the GameObject position and rotation.

Play

Plays a state.

PlayInFixedTime

Plays a state.

Rebind

Rebind all the animated properties and mesh data with the Animator.

ResetTrigger

Resets the value of the given trigger parameter.

SetBoneLocalRotation

Sets local rotation of a human bone during a IK pass.

SetBool

Sets the value of the given boolean parameter.

SetFloat

Send oat values to the Animator to a ect transitions.

SetIKHintPosition

Sets the position of an IK hint.

SetIKHintPositionWeight

Sets the translative weight of an IK hint (0 = at the original animation
before IK, 1 = at the hint).

SetIKPosition

Sets the position of an IK goal.

SetIKPositionWeight

Sets the translative weight of an IK goal (0 = at the original animation
before IK, 1 = at the goal).

SetIKRotation

Sets the rotation of an IK goal.

SetIKRotationWeight

Sets the rotational weight of an IK goal (0 = rotation before IK, 1 =
rotation at the IK goal).

SetInteger

Sets the value of the given integer parameter.

SetLayerWeight

Sets the weight of the layer at the given index.

SetLookAtPosition

Sets the look at position.

SetLookAtWeight

Set look at weights.

SetTarget

Sets an AvatarTarget and a targetNormalizedTime for the current state.

SetTrigger

Sets the value of the given trigger parameter.

StartPlayback

Sets the animator in playback mode.

StartRecording

Sets the animator in recording mode, and allocates a circular bu er of
size frameCount.

StopPlayback

Stops the animator playback mode. When playback stops, the avatar
resumes getting control from game logic.

StopRecording

Stops animator record mode.

Update

Evaluates the animator based on deltaTime.

WriteDefaultValues

Forces a write of the default values stored in the animator.

Static Methods
StringToHash

Generates an parameter id from a string.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Information about clip being played and blended by the Animator.
See Also: Animator.GetCurrentAnimatorClipInfo and Animator.GetNextAnimatorClipInfo.

//Create a GameObject and attach an Animator component (Click the Add Component
//Attach this script to the GameObject

//This script outputs the current clip from the Animator to the console
using UnityEngine;

public class AnimationClipInfoClipExample : MonoBehaviour
{
Animator m_Animator;
AnimatorClipInfo[] m_AnimatorClipInfo;

// Use this for initialization
void Start()
{
//Fetch the Animator component from the GameObject
m_Animator = GetComponent();
//Get the animator clip information from the Animator Controller
m_AnimatorClipInfo = m_Animator.GetCurrentAnimatorClipInfo(0);
//Output the name of the starting clip
Debug.Log("Starting clip : " + m_AnimatorClipInfo[0].clip);
}
}

Properties
clip

Returns the animation clip played by the Animator.

weight

Returns the blending weight used by the Animator to blend this clip.

Leave feedback

Description
Used to communicate between scripting and the controller. Some parameters can be set in scripting and used by
the controller, while other parameters are based on Custom Curves in Animation Clips and can be sampled using
the scripting API.

Properties
defaultBool

The default bool value for the parameter.

defaultFloat

The default oat value for the parameter.

defaultInt

The default int value for the parameter.

name

The name of the parameter.

nameHash

Returns the hash of the parameter based on its name.

type

The type of the parameter.

Leave feedback

Description
Interface to control Animator Override Controller.
Animator Override Controller is used to override Animation Clips from a controller to specialize animations for a
given Avatar. Swapping Animator.runtimeAnimatorController with an AnimatorOverrideController based on the
same AnimatorController at runtime doesn't reset state machine's current state.
There are three ways to use the Animator Override Controller.
1. Create an Animator Override Controller in the Editor.
2. Change one Animation Clip per frame at runtime (Basic use case).
In this case the indexer operator AnimatorOverrideController.this[string] could be used, but be careful as each
call will trigger a reallocation of the animator's clip bindings.

using UnityEngine;

public class SwapWeapon : MonoBehaviour
{
public AnimationClip[] weaponAnimationClip;

protected Animator animator;
protected AnimatorOverrideController animatorOverrideController;

protected int weaponIndex;

public void Start()
{
animator = GetComponent();
weaponIndex = 0;

animatorOverrideController = new AnimatorOverrideController(animator.run
animator.runtimeAnimatorController = animatorOverrideController;
}

public void Update()
{
if (Input.GetButtonDown("NextWeapon"))

{
weaponIndex = (weaponIndex + 1) % weaponAnimationClip.Length;
animatorOverrideController["shot"] = weaponAnimationClip[weaponIndex
}
}
}

3. Changing many Animation Clips per frame at runtime (Advanced use case).
The AnimatorOverrideController.ApplyOverrides method is well suited for this case as it reduce the number of
animator's clips bindings reallocation to only one per call.

using UnityEngine;
using System.Collections.Generic;

public class AnimationClipOverrides : List x.Key.name.Equals(name)).Value; }
set
{
int index = this.FindIndex(x => x.Key.name.Equals(name));
if (index != -1)
this[index] = new KeyValuePair(thi
}
}
}

public class Weapon
{
public AnimationClip
public AnimationClip
public AnimationClip
public AnimationClip
}

singleAttack;
comboAttack;
dashAttack;
smashAttack;

public class SwapWeapon : MonoBehaviour
{

public Weapon[] weapons;

protected Animator animator;
protected AnimatorOverrideController animatorOverrideController;

protected int weaponIndex;

protected AnimationClipOverrides clipOverrides;
public void Start()
{
animator = GetComponent();
weaponIndex = 0;

animatorOverrideController = new AnimatorOverrideController(animator.run
animator.runtimeAnimatorController = animatorOverrideController;

clipOverrides = new AnimationClipOverrides(animatorOverrideController.ov
animatorOverrideController.GetOverrides(clipOverrides);
}

public void Update()
{
if (Input.GetButtonDown("NextWeapon"))
{
weaponIndex = (weaponIndex + 1) % weapons.Length;
clipOverrides["SingleAttack"] = weapons[weaponIndex].singleAttack;
clipOverrides["ComboAttack"] = weapons[weaponIndex].comboAttack;
clipOverrides["DashAttack"] = weapons[weaponIndex].dashAttack;
clipOverrides["SmashAttack"] = weapons[weaponIndex].smashAttack;
animatorOverrideController.ApplyOverrides(clipOverrides);
}
}
}

Properties
overridesCount

Returns the count of overrides.

runtimeAnimatorController

The Runtime Animator Controller that the Animator Override Controller

overrides.
this[string]

Returns either the overriding Animation Clip if set or the original Animation Clip
named name.

Constructors
AnimatorOverrideController

Creates an empty Animator Override Controller.

Public Methods
ApplyOverrides

Applies the list of overrides on this Animator Override Controller.

GetOverrides

Gets the list of Animation Clip overrides currently de ned in this Animator Override
Controller.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

animationClips

Retrieves all AnimationClip used by the controller.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Information about the current or next state.

Properties
fullPathHash

The full path hash for this state.

length

Current duration of the state.

loop

Is the state looping.

normalizedTime

Normalized time of the State.

shortNameHash

The hash is generated using Animator.StringToHash. The hash does not include the name
of the parent layer.

speed

The playback speed of the animation. 1 is the normal playback speed.

speedMultiplier

The speed multiplier for this state.

tagHash

The Tag of the State.

Public Methods
IsName

Does name match the name of the active state in the statemachine?

IsTag

Does tag match the tag of the active state in the statemachine.

Leave feedback

Description
Information about the current transition.

Properties
anyState

Returns true if the transition is from an AnyState node, or from Animator.CrossFade.

duration

Duration of the transition.

durationUnit

The unit of the transition duration.

fullPathHash

The hash name of the Transition.

nameHash

The simpli ed name of the Transition.

normalizedTime

Normalized time of the Transition.

userNameHash

The user-speci ed name of the Transition.

Public Methods
IsName

Does name match the name of the active Transition.

IsUserName

Does userName match the name of the active Transition.

Leave feedback

Description
Various utilities for animator manipulation.

Static Methods
DeoptimizeTransformHierarchy

This function will recreate all transform hierarchy under GameObject.

OptimizeTransformHierarchy

This function will remove all transform hierarchy under GameObject, the
animator will write directly transform matrices into the skin mesh matrices
saving alot of CPU cycles.

Leave feedback

Description
Access to application run-time data.
This class contains static methods for looking up information about and controlling the run-time data.

Static Properties
absoluteURL

The URL of the document (what is shown in a browser's address bar) for WebGL
(Read Only).

backgroundLoadingPriority

Priority of background loading thread.

buildGUID

Returns a GUID for this build (Read Only).

cloudProjectId

A unique cloud project identi er. It is unique for every project (Read Only).

companyName

Return application company name (Read Only).

consoleLogPath

Returns the path to the console log le, or an empty string if the current
platform does not support log les.

dataPath

Contains the path to the game data folder (Read Only).

genuine

Returns false if application is altered in any way after it was built.

genuineCheckAvailable

Returns true if application integrity can be con rmed.

identi er

Returns application identi er at runtime. On Apple platforms this is the
'bundleIdenti er' saved in the info.plist le, on Android it's the 'package' from
the AndroidManifest.xml.

installerName

Returns the name of the store or package that installed the application (Read
Only).

installMode

Returns application install mode (Read Only).

internetReachability

Returns the type of Internet reachability currently possible on the device.

isBatchMode

Returns true when Unity is launched with the -batchmode ag from the
command line (Read Only).

isConsolePlatform

Is the current Runtime platform a known console platform.

isEditor

Are we running inside the Unity editor? (Read Only)

isFocused

Whether the player currently has focus. Read-only.

isMobilePlatform

Is the current Runtime platform a known mobile platform.

isPlaying

Returns true when called in any kind of built Player, or when called in the Editor
in Play Mode (Read Only).

persistentDataPath

Contains the path to a persistent data directory (Read Only).

platform

Returns the platform the game is running on (Read Only).

productName

Returns application product name (Read Only).

runInBackground

Should the player be running when the application is in the background?

sandboxType

Returns application running in sandbox (Read Only).

streamingAssetsPath

Contains the path to the StreamingAssets folder (Read Only).

systemLanguage

The language the user's operating system is running in.

targetFrameRate

Instructs game to try to render at a speci ed frame rate.

temporaryCachePath

Contains the path to a temporary data / cache directory (Read Only).

unityVersion

The version of the Unity runtime used to play the content.

version

Returns application version number (Read Only).

Static Methods
CanStreamedLevelBeLoaded

Can the streamed level be loaded?

GetBuildTags

Returns an array of feature tags in use for this build.

GetStackTraceLogType

Get stack trace logging options. The default value is
StackTraceLogType.ScriptOnly.

HasProLicense

Is Unity activated with the Pro license?

HasUserAuthorization

Check if the user has authorized use of the webcam or microphone in
the Web Player.

IsPlaying

Returns true if the given object is part of the playing world either in any
kind of built Player or in Play Mode.

OpenURL

Opens the url in a browser.

Quit

Quits the player application.

RequestAdvertisingIdenti erAsync

Request advertising ID for iOS, Android and Windows Store.

RequestUserAuthorization

Request authorization to use the webcam or microphone on iOS.

SetBuildTags

Set an array of feature tags for this build.

SetStackTraceLogType

Set stack trace logging options. The default value is

StackTraceLogType.ScriptOnly.
Unload

Unloads the Unity runtime.

Events
logMessageReceived

Event that is red if a log message is received.

logMessageReceivedThreaded

Event that is red if a log message is received.

lowMemory

This event occurs when an iOS or Android device noti es of low memory
while the app is running in the foreground. You can release non-critical
assets from memory (such as, textures or audio clips) in response to this in
order to avoid the app being terminated. You can also load smaller versions
of such assets. Furthermore, you should serialize any transient data to
permanent storage to avoid data loss if the app is terminated.This event
corresponds to the following callbacks on the di erent platforms: - iOS:
[UIApplicationDelegate applicationDidReceiveMemoryWarning] - Android:
onLowMemory() and onTrimMemory(level ==
TRIM_MEMORY_RUNNING_CRITICAL)Here is an example of handling the
callback:

onBeforeRender

Delegate method used to register for "Just Before Render" input updates for
VR devices.

quitting

Unity raises this event when the player application is qutting.

wantsToQuit

Unity raises this event when the player application wants to quit.

Delegates
AdvertisingIdenti erCallback

Delegate method for fetching advertising ID.

LogCallback

Use this delegate type with Application.logMessageReceived or
Application.logMessageReceivedThreaded to monitor what gets logged.

LowMemoryCallback

This is the delegate function when a mobile device noti es of low memory.

Leave feedback
SWITCH TO MANUAL

Description
Applies forces within an area.
When the source Collider2D is a trigger, the e ector will apply forces whenever the target Collider2D overlaps the
source. When the source Collider isn't a trigger, the e ector will apply forces whenever the target Collider2D is in
contact with the source only.
This e ector is designed primarily to work with source Collider2D that are set as triggers so that target Collider2D
can overlap the de ned area.

Properties
angularDrag

The angular drag to apply to rigid-bodies.

drag

The linear drag to apply to rigid-bodies.

forceAngle

The angle of the force to be applied.

forceMagnitude

The magnitude of the force to be applied.

forceTarget

The target for where the e ector applies any force.

forceVariation

The variation of the magnitude of the force to be applied.

useGlobalAngle

Should the forceAngle use global space?

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
AssetBundles let you stream additional assets via the UnityWebRequest class and instantiate them at runtime.
AssetBundles are created via BuildPipeline.BuildAssetBundle.
Note that bundles are not compatible between platforms. A bundle built for any of the standalone platforms can
only be loaded on that platform but not others. Further example, a bundle built for iOS is not compatible with
Android and vice versa. One di erence is shaders which are di erent between devices, as are textures.
See Also: UnityWebRequestAssetBundle.GetAssetBundle, Loading Resources at Runtime,
BuildPipeline.BuildAssetBundle.

using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class SampleBehaviour : MonoBehaviour
{
IEnumerator Start()
{
var uwr = UnityWebRequestAssetBundle.GetAssetBundle("http://myserver/myB
yield return uwr.SendWebRequest();

// Get an asset from the bundle and instantiate it.
AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);
var loadAsset = bundle.LoadAssetAsync("Assets/Players/MainPl
yield return loadAsset;

Instantiate(loadAsset.asset);
}
}

Properties
isStreamedSceneAssetBundle

Public Methods

Return true if the AssetBundle is a streamed Scene AssetBundle.

Contains

Check if an AssetBundle contains a speci c object.

GetAllAssetNames

Return all asset names in the AssetBundle.

GetAllScenePaths

Return all the Scene asset paths (paths to *.unity assets) in the AssetBundle.

LoadAllAssets

Loads all assets contained in the asset bundle that inherit from type.

LoadAllAssetsAsync

Loads all assets contained in the asset bundle asynchronously.

LoadAsset

Loads asset with name from the bundle.

LoadAssetAsync

Asynchronously loads asset with name from the bundle.

LoadAssetWithSubAssets

Loads asset and sub assets with name from the bundle.

LoadAssetWithSubAssetsAsync

Loads asset with sub assets with name from the bundle asynchronously.

Unload

Unloads all assets in the bundle.

Static Methods
GetAllLoadedAssetBundles

To use when you need to get a list of all the currently loaded Asset Bundles.

LoadFromFile

Synchronously loads an AssetBundle from a le on disk.

LoadFromFileAsync

Asynchronously loads an AssetBundle from a le on disk.

LoadFromMemory

Synchronously create an AssetBundle from a memory region.

LoadFromMemoryAsync

Asynchronously create an AssetBundle from a memory region.

LoadFromStream

Synchronously loads an AssetBundle from a managed Stream.

LoadFromStreamAsync

Asynchronously loads an AssetBundle from a managed Stream.

RecompressAssetBundleAsync

Asynchronously recompress a downloaded/stored AssetBundle from one
BuildCompression to another.

UnloadAllAssetBundles

Unloads all currently loaded Asset Bundles.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Asynchronous create request for an AssetBundle.
See Also: AssetBundle.CreateFromMemory, AsyncOperation.

Properties
assetBundle

Asset object being loaded (Read Only).

Inherited Members
Properties
allowSceneActivation

Allow Scenes to be activated as soon as it is ready.

isDone

Has the operation nished? (Read Only)

priority

Priority lets you tweak in which order async operation calls will be performed.

progress

What's the operation's progress. (Read Only)

Events
completed

Event that is invoked upon operation completion. An event handler that is registered in
the same frame as the call that creates it will be invoked next frame, even if the operation
is able to complete synchronously. If a handler is registered after the operation has
completed and has already invoked the complete event, the handler will be called
synchronously.

Leave feedback

Description
Manifest for all the AssetBundles in the build.

Public Methods
GetAllAssetBundles

Get all the AssetBundles in the manifest.

GetAllAssetBundlesWithVariant

Get all the AssetBundles with variant in the manifest.

GetAllDependencies

Get all the dependent AssetBundles for the given AssetBundle.

GetAssetBundleHash

Get the hash for the given AssetBundle.

GetDirectDependencies

Get the direct dependent AssetBundles for the given AssetBundle.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Asynchronous load request from an AssetBundle.
See Also: AsyncOperation.

Properties
allAssets

Asset objects with sub assets being loaded. (Read Only)

asset

Asset object being loaded (Read Only).

Inherited Members
Properties
allowSceneActivation

Allow Scenes to be activated as soon as it is ready.

isDone

Has the operation nished? (Read Only)

priority

Priority lets you tweak in which order async operation calls will be performed.

progress

What's the operation's progress. (Read Only)

Events
completed

Event that is invoked upon operation completion. An event handler that is registered in
the same frame as the call that creates it will be invoked next frame, even if the operation
is able to complete synchronously. If a handler is registered after the operation has
completed and has already invoked the complete event, the handler will be called
synchronously.

Leave feedback

Description
Asynchronous operation coroutine.
You can yield until asynchronous operation continues, or manually check whether it's done (isDone) or progress
(progress).
See Also: SceneManager.LoadSceneAsync, AssetBundle.LoadAssetAsync, Resources.LoadAsync.

Properties
allowSceneActivation

Allow Scenes to be activated as soon as it is ready.

isDone

Has the operation nished? (Read Only)

priority

Priority lets you tweak in which order async operation calls will be performed.

progress

What's the operation's progress. (Read Only)

Events
completed

Event that is invoked upon operation completion. An event handler that is registered in
the same frame as the call that creates it will be invoked next frame, even if the operation
is able to complete synchronously. If a handler is registered after the operation has
completed and has already invoked the complete event, the handler will be called
synchronously.

Inherited Members

Leave feedback
SWITCH TO MANUAL

Description
The Audio Chorus Filter takes an Audio Clip and processes it creating a chorus e ect.
The chorus e ect modulates the original sound by a sinusoid low frequency oscillator (LFO). The output sounds
like there are multiple sources emitting the same sound with slight variations (resembling a choir).
See Also: Audio Chorus Filter information.

Properties
delay

Chorus delay in ms. 0.1 to 100.0. Default = 40.0 ms.

depth

Chorus modulation depth. 0.0 to 1.0. Default = 0.03.

dryMix

Volume of original signal to pass to output. 0.0 to 1.0. Default = 0.5.

rate

Chorus modulation rate in hz. 0.0 to 20.0. Default = 0.8 hz.

wetMix1

Volume of 1st chorus tap. 0.0 to 1.0. Default = 0.5.

wetMix2

Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the rst tap. 0.0 to 1.0.
Default = 0.5.

wetMix3

Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap. 0.0 to
1.0. Default = 0.5.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A container for audio data.
An AudioClip stores the audio le either compressed as ogg vorbis or uncompressed. AudioClips are referenced
and used by AudioSources to play sounds.
See Also: AudioClip component in the Components Reference.

Properties
ambisonic

Returns true if this audio clip is ambisonic (read-only).

channels

The number of channels in the audio clip. (Read Only)

frequency

The sample frequency of the clip in Hertz. (Read Only)

length

The length of the audio clip in seconds. (Read Only)

loadInBackground

Corresponding to the "Load In Background" ag in the inspector, when this ag is set, the
loading will happen delayed without blocking the main thread.

loadState

Returns the current load state of the audio data associated with an AudioClip.

loadType

The load type of the clip (read-only).

preloadAudioData

Preloads audio data of the clip when the clip asset is loaded. When this ag is o , scripts
have to call AudioClip.LoadAudioData() to load the data before the clip can be played.
Properties like length, channels and format are available before the audio data has been
loaded.

samples

The length of the audio clip in samples. (Read Only)

Public Methods
GetData

Fills an array with sample data from the clip.

LoadAudioData

Loads the audio data of a clip. Clips that have "Preload Audio Data" set will load the audio
data automatically.

SetData

Set sample data in a clip.

UnloadAudioData

Unloads the audio data associated with the clip. This works only for AudioClips that are
based on actual sound le assets.

Static Methods
Create

Creates a user AudioClip with a name and with the given length in samples, channels and
frequency.

Delegates
PCMReaderCallback

Delegate called each time AudioClip reads data.

PCMSetPositionCallback

Delegate called each time AudioClip changes read position.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Speci es the current properties or desired properties to be set for the audio system.
See AudioSettings.Reset for an example.

Properties
dspBu erSize

The length of the DSP bu er in samples determining the latency of sounds by the audio
output device.

numRealVoices

The current maximum number of simultaneously audible sounds in the game.

numVirtualVoices

The maximum number of managed sounds in the game. Beyond this limit sounds will
simply stop playing.

sampleRate

The current sample rate of the audio output device used.

speakerMode

The current speaker mode used by the audio output device.

Leave feedback
SWITCH TO MANUAL

Description
The Audio Distortion Filter distorts the sound from an AudioSource or sounds reaching the AudioListener.
See Also: Audio Distortion Filter information.

Properties
distortionLevel

Distortion value. 0.0 to 1.0. Default = 0.5.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The Audio Echo Filter repeats a sound after a given Delay, attenuating the repetitions based on the Decay Ratio.
See Also: Audio Echo Filter information.

Properties
decayRatio

Echo decay per delay. 0 to 1. 1.0 = No decay, 0.0 = total decay (i.e. simple 1 line delay).
Default = 0.5.

delay

Echo delay in ms. 10 to 5000. Default = 500.

dryMix

Volume of original signal to pass to output. 0.0 to 1.0. Default = 1.0.

wetMix

Volume of echo signal to pass to output. 0.0 to 1.0. Default = 1.0.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The Audio High Pass Filter passes high frequencies of an AudioSource, and cuts o signals with frequencies lower
than the Cuto Frequency.
See Also: Audio High Pass Filter information.

Properties
cuto Frequency

Highpass cuto frequency in hz. 10.0 to 22000.0. Default = 5000.0.

highpassResonanceQ

Determines how much the lter's self-resonance isdampened.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Representation of a listener in 3D space.
This class implements a microphone-like device. It records the sounds around it and plays that through the
player's speakers. You can only have one listener in a Scene.
See Also: AudioSource, AudioListener component in the Components Reference.

Static Properties
pause

The paused state of the audio system.

volume

Controls the game sound volume (0.0 to 1.0).

Properties
velocityUpdateMode

This lets you set whether the Audio Listener should be updated in the xed or dynamic
update.

Static Methods
GetOutputData

Provides a block of the listener (master)'s output data.

GetSpectrumData

Provides a block of the listener (master)'s spectrum data.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The Audio Low Pass Filter passes low frequencies of an AudioSource or all sounds reaching an AudioListener,
while removing frequencies higher than the Cuto Frequency.
See Also: Audio Low Pass Filter information.

Properties
customCuto Curve

Returns or sets the current custom frequency cuto curve.

cuto Frequency

Lowpass cuto frequency in hz. 10.0 to 22000.0. Default = 5000.0.

lowpassResonanceQ

Determines how much the lter's self-resonance is dampened.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Allow recording the main output of the game or speci c groups in the AudioMixer.

Static Methods
GetSampleCountForCaptureFrame

Returns the number of samples available since the last time
AudioRenderer.Render was called. This is dependent on the frame
capture rate.

Render

Performs the recording of the main output as well as any optional mixer
groups that have been registered via
AudioRenderer.AddMixerGroupSink.

Start

Enters audio recording mode. After this Unity will output silence until
AudioRenderer.Stop is called.

Stop

Exits audio recording mode. After this audio output will be audible again.

Leave feedback
SWITCH TO MANUAL

Description
The Audio Reverb Filter takes an Audio Clip and distorts it to create a custom reverb e ect.
See Also: Audio Reverb Filter information.

Properties
decayHFRatio

Decay HF Ratio : High-frequency to low-frequency decay time ratio. Ranges from 0.1 to
2.0. Default is 0.5.

decayTime

Reverberation decay time at low-frequencies in seconds. Ranges from 0.1 to 20.0. Default
is 1.0.

density

Reverberation density (modal density) in percent. Ranges from 0.0 to 100.0. Default is
100.0.

di usion

Reverberation di usion (echo density) in percent. Ranges from 0.0 to 100.0. Default is
100.0.

dryLevel

Mix level of dry signal in output in mB. Ranges from -10000.0 to 0.0. Default is 0.

hfReference

Reference high frequency in Hz. Ranges from 1000.0 to 20000.0. Default is 5000.0.

lfReference

Reference low-frequency in Hz. Ranges from 20.0 to 1000.0. Default is 250.0.

re ectionsDelay

Late reverberation level relative to room e ect in mB. Ranges from -10000.0 to 2000.0.
Default is 0.0.

re ectionsLevel

Early re ections level relative to room e ect in mB. Ranges from -10000.0 to 1000.0.
Default is -10000.0.

reverbDelay

Late reverberation delay time relative to rst re ection in seconds. Ranges from 0.0 to 0.1.
Default is 0.04.

reverbLevel

Late reverberation level relative to room e ect in mB. Ranges from -10000.0 to 2000.0.
Default is 0.0.

reverbPreset

Set/Get reverb preset properties.

room

Room e ect level at low frequencies in mB. Ranges from -10000.0 to 0.0. Default is 0.0.

roomHF

Room e ect high-frequency level re. low frequency level in mB. Ranges from -10000.0 to
0.0. Default is 0.0.

roomLF

Room e ect low-frequency level in mB. Ranges from -10000.0 to 0.0. Default is 0.0.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Reverb Zones are used when you want to create location based ambient e ects in the Scene.
As the Audio Listener moves into a Reverb Zone, the ambient e ect associated with the zone is gradually applied.
At the max distance there is no e ect and at the min distance the e ect is fully applied. For example you can
gradually change your character's footsteps sounds and create the feeling like you where entering into a cavern,
going trough a room, swimming underwater, etc.
You can always mix reverb zones to have combined e ects. For more info check Reverb Zones in the manual.

Properties
decayHFRatio

High-frequency to mid-frequency decay time ratio.

decayTime

Reverberation decay time at mid frequencies.

density

Value that controls the modal density in the late reverberation decay.

di usion

Value that controls the echo density in the late reverberation decay.

HFReference

Reference high frequency (hz).

LFReference

Reference low frequency (hz).

maxDistance

The distance from the centerpoint that the reverb will not have any e ect. Default = 15.0.

minDistance

The distance from the centerpoint that the reverb will have full e ect at. Default = 10.0.

re ections

Early re ections level relative to room e ect.

re ectionsDelay

Initial re ection delay time.

reverb

Late reverberation level relative to room e ect.

reverbDelay

Late reverberation delay time relative to initial re ection.

reverbPreset

Set/Get reverb preset properties.

room

Room e ect level (at mid frequencies).

roomHF

Relative room e ect level at high frequencies.

roomLF

Relative room e ect level at low frequencies.

Inherited Members

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Controls the global audio settings from script.
Setup speaker output and format.

Static Properties
driverCapabilities

Returns the speaker mode capability of the current audio driver. (Read Only)

dspTime

Returns the current time of the audio system.

outputSampleRate

Get the mixer's current output rate.

speakerMode

Gets the current speaker mode. Default is 2 channel stereo.

Static Methods
GetCon guration

Returns the current con guration of the audio device and system. The values in
the struct may then be modi ed and reapplied via AudioSettings.Reset.

GetDSPBu erSize

Get the mixer's bu er size in samples.

GetSpatializerPluginName

Returns the name of the spatializer selected on the currently-running platform.

GetSpatializerPluginNames

Returns an array with the names of all the available spatializer plugins.

Reset

Performs a change of the device con guration. In response to this the
AudioSettings.OnAudioCon gurationChanged delegate is invoked with the
argument deviceWasChanged=false. It cannot be guaranteed that the exact
settings speci ed can be used, but the an attempt is made to use the closest
match supported by the system.

SetSpatializerPluginName

Sets the spatializer plugin for all platform groups. If a null or empty string is
passed in, the existing spatializer plugin will be cleared.

Events
OnAudioCon gurationChanged

A delegate called whenever the global audio settings are changed, either by
AudioSettings.Reset or by an external factor such as the OS control panel
changing the sample rate or because the default output device was
changed, for example when plugging in an HDMI monitor or a USB headset.

Delegates
AudioCon gurationChangeHandler

A delegate called whenever the global audio settings are changed, either
by AudioSettings.Reset or by an external device change such as the OS
control panel changing the sample rate or because the default output
device was changed, for example when plugging in an HDMI monitor or
a USB headset.

Leave feedback
SWITCH TO MANUAL

Description
A representation of audio sources in 3D.
An AudioSource is attached to a GameObject for playing back sounds in a 3D environment. In order to play 3D
sounds you also need to have a AudioListener. The audio listener is normally attached to the camera you want to
use. Whether sounds are played in 3D or 2D is determined by AudioImporter settings.
You can play a single audio clip using Play, Pause and Stop. You can also adjust its volume while playing using the
volume property, or seek using time. Multiple sounds can be played on one AudioSource using PlayOneShot. You
can play a clip at a static position in 3D space using PlayClipAtPoint.
See Also: AudioListener, AudioClip, AudioSource component.

//This script allows you to toggle music to play and stop.
//Assign an AudioSource to a GameObject and attach an Audio Clip in the Audio So

using UnityEngine;

public class Example : MonoBehaviour
{
AudioSource m_MyAudioSource;

//Play the music
bool m_Play;
//Detect when you use the toggle, ensures music isn’t played multiple times
bool m_ToggleChange;

void Start()
{
//Fetch the AudioSource from the GameObject
m_MyAudioSource = GetComponent();
//Ensure the toggle is set to true for the music to play at start-up
m_Play = true;
}

void Update()
{
//Check to see if you just set the toggle to positive
if (m_Play == true && m_ToggleChange == true)
{
//Play the audio you attach to the AudioSource component
m_MyAudioSource.Play();
//Ensure audio doesn’t play more than once
m_ToggleChange = false;
}
//Check if you just set the toggle to false
if (m_Play == false && m_ToggleChange == true)
{
//Stop the audio
m_MyAudioSource.Stop();
//Ensure audio doesn’t play more than once
m_ToggleChange = false;
}
}

void OnGUI()
{
//Switch this toggle to activate and deactivate the parent GameObject
m_Play = GUI.Toggle(new Rect(10, 10, 100, 30), m_Play, "Play Music");

//Detect if there is a change with the toggle
if (GUI.changed)
{
//Change to true to show that there was just a change in the toggle
m_ToggleChange = true;
}
}
}

Properties
bypassE ects

Bypass e ects (Applied from lter components or global listener lters).

bypassListenerE ects

When set global e ects on the AudioListener will not be applied to the audio signal
generated by the AudioSource. Does not apply if the AudioSource is playing into a
mixer group.

bypassReverbZones

When set doesn't route the signal from an AudioSource into the global reverb

associated with reverb zones.
clip

The default AudioClip to play.

dopplerLevel

Sets the Doppler scale for this AudioSource.

ignoreListenerPause

Allows AudioSource to play even though AudioListener.pause is set to true. This is
useful for the menu element sounds or background music in pause menus.

ignoreListenerVolume

This makes the audio source not take into account the volume of the audio
listener.

isPlaying

Is the clip playing right now (Read Only)?

isVirtual

True if all sounds played by the AudioSource (main sound started by Play() or
playOnAwake as well as one-shots) are culled by the audio system.

loop

Is the audio clip looping?

maxDistance

(Logarithmic rollo ) MaxDistance is the distance a sound stops attenuating at.

minDistance

Within the Min distance the AudioSource will cease to grow louder in volume.

mute

Un- / Mutes the AudioSource. Mute sets the volume=0, Un-Mute restore the
original volume.

outputAudioMixerGroup

The target group to which the AudioSource should route its signal.

panStereo

Pans a playing sound in a stereo way (left or right). This only applies to sounds that
are Mono or Stereo.

pitch

The pitch of the audio source.

playOnAwake

If set to true, the audio source will automatically start playing on awake.

priority

Sets the priority of the AudioSource.

reverbZoneMix

The amount by which the signal from the AudioSource will be mixed into the global
reverb associated with the Reverb Zones.

rollo Mode

Sets/Gets how the AudioSource attenuates over distance.

spatialBlend

Sets how much this AudioSource is a ected by 3D spatialisation calculations
(attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D.

spatialize

Enables or disables spatialization.

spatializePostE ects

Determines if the spatializer e ect is inserted before or after the e ect lters.

spread

Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker
space.

time

Playback position in seconds.

timeSamples

Playback position in PCM samples.

velocityUpdateMode

Whether the Audio Source should be updated in the xed or dynamic update.

volume

The volume of the audio source (0.0 to 1.0).

Public Methods
GetAmbisonicDecoderFloat

Reads a user-de ned parameter of a custom ambisonic decoder e ect that is
attached to an AudioSource.

GetCustomCurve

Get the current custom curve for the given AudioSourceCurveType.

GetOutputData

Provides a block of the currently playing source's output data.

GetSpatializerFloat

Reads a user-de ned parameter of a custom spatializer e ect that is attached to
an AudioSource.

GetSpectrumData

Provides a block of the currently playing audio source's spectrum data.

Pause

Pauses playing the clip.

Play

Plays the clip.

PlayDelayed

Plays the clip with a delay speci ed in seconds. Users are advised to use this
function instead of the old Play(delay) function that took a delay speci ed in
samples relative to a reference rate of 44.1 kHz as an argument.

PlayOneShot

Plays an AudioClip, and scales the AudioSource volume by volumeScale.

PlayScheduled

Plays the clip at a speci c time on the absolute time-line that
AudioSettings.dspTime reads from.

SetAmbisonicDecoderFloat

Sets a user-de ned parameter of a custom ambisonic decoder e ect that is
attached to an AudioSource.

SetCustomCurve

Set the custom curve for the given AudioSourceCurveType.

SetScheduledEndTime

Changes the time at which a sound that has already been scheduled to play will
end. Notice that depending on the timing not all rescheduling requests can be
ful lled.

SetScheduledStartTime

Changes the time at which a sound that has already been scheduled to play will
start.

SetSpatializerFloat

Sets a user-de ned parameter of a custom spatializer e ect that is attached to
an AudioSource.

Stop

Stops playing the clip.

UnPause

Unpause the paused playback of this AudioSource.

Static Methods
PlayClipAtPoint

Plays an AudioClip at a given position in world space.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Avatar de nition.
See Also: Animator.avatar, AvatarBuilder.

Properties
isHuman

Return true if this avatar is a valid human avatar.

isValid

Return true if this avatar is a valid mecanim avatar. It can be a generic avatar or a human
avatar.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Class to build avatars from user scripts.
This class allows you to create custom avatars for your animated characters entirely via script, in a similar way to
what goes on behind the Scenes in the Unity Editor when you create an avatar from the model import inspector.

Static Methods
BuildGenericAvatar

Create a new generic avatar.

BuildHumanAvatar

Create a humanoid avatar.

Leave feedback
SWITCH TO MANUAL

Description
AvatarMask is used to mask out humanoid body parts and transforms.
They can be used when importing animation or in an animator controller layer.

Properties
transformCount

Number of transforms.

Constructors
AvatarMask

Creates a new AvatarMask.

Public Methods
AddTransformPath

Adds a transform path into the AvatarMask.

GetHumanoidBodyPartActive

Returns true if the humanoid body part at the given index is active.

GetTransformActive

Returns true if the transform at the given index is active.

GetTransformPath

Returns the path of the transform at the given index.

RemoveTransformPath

Removes a transform path from the AvatarMask.

SetHumanoidBodyPartActive

Sets the humanoid body part at the given index to active or not.

SetTransformActive

Sets the tranform at the given index to active or not.

SetTransformPath

Sets the path of the transform at the given index.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Behaviours are Components that can be enabled or disabled.
See Also: MonoBehaviour and Component.

Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
BillboardAsset describes how a billboard is rendered.
Billboards are a level-of-detail (LOD) method of drawing complicated 3D objects in a simpler manner if they are
further away. Because the object is further away, there is often less requirement to draw the object at full detail
due to its size on-screen and low likelihood of being a focal point in the Camera view. Instead, the object can be
pre-rendered to a texture, and this texture used on a very simple Camera-facing Mesh of at geometry (often
simply a quadrilateral) known as a billboard. At great distances an object does not signi cantly change its
orientation relative to the camera, so a billboard looks much like the object it represents from frame to frame,
without having to be redrawn from the model. The BillboardAsset class allows the creation of billboards that are
rendered from several directions, allowing a BillboardAsset to e ciently represent an object at low level of detail
from any approximately-horizontal viewpoint.
A BillboardAsset is usually created by importing SpeedTree assets. You can also create your own once you know
how the billboard is described.
SpeedTree billboard geometry is usually more complex than a plain quadrilateral. By using more vertices to cut
out the empty part of the billboard image, rendering performance can potentially be improved due to the
graphics system not having to draw as many redundant transparent pixels. You have access to the geometry data
via BillboardAsset.vertices and BillboardAsset.indices.
All vertices are considered in UV-space (see Fig. 1 below), because the geometry is due to be textured by the
billboard images. UV vertices are easily expanded to 3D-space vertices by knowing the billboard's width, height,
bottom, and what direction the billboard is currently facing. Assuming we have a billboard located at (0,0,0)
looking at negative Z axis, the 3D-space coordinates are calculated as:
X = (u - 0.5) * width
Y = v * height + bottom
Z=0

Figure 1: How UV vertices are expanded to 3D vertices
In order to display something similar to the real 3D mesh being billboarded, SpeedTree billboards select an
appropriate image from several pre-rendered images according to the current view direction. The images in
Figure 2 below are created by capturing the rendered image of the 3D tree at di erent view angles, evenly
distributed around the Y-axis. The rst image always starts at positive X axis direction (or 0° if you imagine a unit
circle from above).

Figure 2: How the eight billboard images are baked

All images should be atlased together in one single texture. Each image is represented as a Vector4 of {left u, top v,
width in u, height in v} in the atlas. You have access to all the images via BillboardAsset.imageTexCoords.
SpeedTree Modeler always exports a normal texture alongside the di use texture for even better approximation
of the lighting, and it shares the same atlas layout with the di use texutre.
Once the BillboardAsset is constructed, use BillboardRenderer to render it.

Properties
bottom

Height of the billboard that is below ground.

height

Height of the billboard.

imageCount

Number of pre-rendered images that can be switched when the billboard is viewed from
di erent angles.

indexCount

Number of indices in the billboard mesh.

material

The material used for rendering.

vertexCount

Number of vertices in the billboard mesh.

width

Width of the billboard.

Constructors
BillboardAsset

Constructs a new BillboardAsset.

Public Methods
GetImageTexCoords

Get the array of billboard image texture coordinate data.

GetIndices

Get the indices of the billboard mesh.

GetVertices

Get the vertices of the billboard mesh.

SetImageTexCoords

Set the array of billboard image texture coordinate data.

SetIndices

Set the indices of the billboard mesh.

SetVertices

Set the vertices of the billboard mesh.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Renders a billboard from a BillboardAsset.
BillboardRenderers that share the same BillboardAsset can be rendered in a batch if they are next to each other
in the order of rendering. The batching is always enabled regardless of whether dynamic batching is enabled or
not.
Due to the always-upright nature of a tree billboard, BillboardRenderer can only rotate around Y-axis.
See Also: BillboardAsset.

Properties
billboard

The BillboardAsset to render.

Constructors
BillboardRenderer

Constructor.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback
Obsolete

Description
The BitStream class represents seralized variables, packed into a stream.
Data can be serialized, transmitted, and then received by remote clients by using this class. See the Network View
component reference page for general information on network synchronization and the
Network.OnSerializeNetworkView function for more information.

Leave feedback

Description
Skinning bone weights of a vertex in the mesh.
Each vertex is skinned with up to four bones. All weights should sum up to one. Weights and bone indices should
be de ned in the order of decreasing weight. If a vertex is a ected by less than four bones, the remaining weights
should be zeroes.
See Also: Mesh.boneWeights variable.

Properties
boneIndex0

Index of rst bone.

boneIndex1

Index of second bone.

boneIndex2

Index of third bone.

boneIndex3

Index of fourth bone.

weight0

Skinning weight for rst bone.

weight1

Skinning weight for second bone.

weight2

Skinning weight for third bone.

weight3

Skinning weight for fourth bone.

Leave feedback

Description
Describes a single bounding sphere for use by a CullingGroup.

Properties
position

The position of the center of the BoundingSphere.

radius

The radius of the BoundingSphere.

Constructors
BoundingSphere

Initializes a BoundingSphere.

Leave feedback

Description
Represents an axis aligned bounding box.
An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some
object. Because the box is never rotated with respect to the axes, it can be de ned by just its center and extents,
or alternatively by min and max points.
Bounds is used by Collider.bounds, Mesh.bounds and Renderer.bounds.

Properties
center

The center of the bounding box.

extents

The extents of the Bounding Box. This is always half of the size of the Bounds.

max

The maximal point of the box. This is always equal to center+extents.

min

The minimal point of the box. This is always equal to center-extents.

size

The total size of the box. This is always twice as large as the extents.

Constructors
Bounds

Creates a new Bounds.

Public Methods
ClosestPoint

The closest point on the bounding box.

Contains

Is point contained in the bounding box?

Encapsulate

Grows the Bounds to include the point.

Expand

Expand the bounds by increasing its size by amount along each side.

IntersectRay

Does ray intersect this bounding box?

Intersects

Does another bounding box intersect with this bounding box?

SetMinMax

Sets the bounds to the min and max value of the box.

SqrDistance

The smallest squared distance between the point and this bounding box.

ToString

Returns a nicely formatted string for the bounds.

Leave feedback

Description
Represents an axis aligned bounding box with all values as integers.
An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some
object. As the box is never rotated with respect to the axes, it can be de ned by min and max points.

Properties
allPositionsWithin

A BoundsInt.PositionCollection that contains all positions within the BoundsInt.

center

The center of the bounding box.

max

The maximal point of the box.

min

The minimal point of the box.

position

The position of the bounding box.

size

The total size of the box.

x

X value of the minimal point of the box.

xMax

The maximal x point of the box.

xMin

The minimal x point of the box.

y

Y value of the minimal point of the box.

yMax

The maximal y point of the box.

yMin

The minimal y point of the box.

z

Z value of the minimal point of the box.

zMax

The maximal z point of the box.

zMin

The minimal z point of the box.

Public Methods
ClampToBounds

Clamps the position and size of this bounding box to the given bounds.

Contains

Is point contained in the bounding box?

SetMinMax

Sets the bounds to the min and max value of the box.

ToString

Returns a nicely formatted string for the bounds.

Leave feedback

Description
An iterator that allows you to iterate over all positions within the BoundsInt.

Properties
Current

Current position of the enumerator.

Public Methods
GetEnumerator

Returns this as an iterator that allows you to iterate over all positions within the
BoundsInt.

MoveNext

Moves the enumerator to the next position.

Reset

Resets this enumerator to its starting state.

Leave feedback
SWITCH TO MANUAL

Description
A box-shaped primitive collider.
See Also: SphereCollider, CapsuleCollider, PhysicMaterial, Rigidbody.

Properties
center

The center of the box, measured in the object's local space.

size

The size of the box, measured in the object's local space.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback
SWITCH TO MANUAL

Description
Collider for 2D physics representing an axis-aligned rectangle.
See Also: CircleCollider2D, PolygonCollider2D, EdgeCollider2D.

Properties
autoTiling

Determines whether the BoxCollider2D's shape is automatically updated based on a
SpriteRenderer's tiling properties.

edgeRadius

Controls the radius of all edges created by the collider.

size

The width and height of the rectangle.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback
SWITCH TO MANUAL

Description
Applies forces to simulate buoyancy, uid- ow and uid drag.
When any Collider2D overlap the area de ned by the e ector, calculations are made to determine if they are
below the surfaceLevel. If they are not, no forces are applied. If they are then the e ector will apply buoyancy
forces in an attempt to move the Collider2D to the surfaceLevel i.e. they will oat.
This e ector is designed primarily to work with Collider2D that are set as triggers so that Collider2D can overlap
the de ned area and have buoyancy forces applied to them.

Properties
angularDrag

A force applied to slow angular movement of any Collider2D in contact with the e ector.

density

The density of the uid used to calculate the buoyancy forces.

owAngle

The angle of the force used to similate uid ow.

owMagnitude

The magnitude of the force used to similate uid ow.

owVariation

The random variation of the force used to similate uid ow.

linearDrag

A force applied to slow linear movement of any Collider2D in contact with the e ector.

surfaceLevel

De nes an arbitrary horizontal line that represents the uid surface level.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Data structure for cache. Please refer to See Also:Caching.AddCache for more information.

Properties
expirationDelay

The number of seconds that an AssetBundle may remain unused in the
cache before it is automatically deleted.

index

Returns the index of the cache in the cache list.

maximumAvailableStorageSpace

Allows you to specify the total number of bytes that can be allocated for
the cache.

path

Returns the path of the cache.

readOnly

Returns true if the cache is readonly.

ready

Returns true if the cache is ready.

spaceFree

Returns the number of currently unused bytes in the cache.

spaceOccupied

Returns the used disk space in bytes.

valid

Returns true if the cache is valid.

Public Methods
ClearCache

Removes all cached content in the cache that has been cached by the current application.

Leave feedback

Description
Data structure for downloading AssetBundles to a customized cache path. See
Also:UnityWebRequestAssetBundle.GetAssetBundle for more information.

Properties
hash

Hash128 which is used as the version of the AssetBundle.

name

AssetBundle name which is used as the customized cache path.

Leave feedback

Description
The Caching class lets you manage cached AssetBundles, downloaded using
UnityWebRequestAssetBundle.GetAssetBundle().
See Also: DownloadHandlerAssetBundle.

using
using
using
using
using
using

System.Collections;
UnityEngine;
System.IO;
System;
UnityEngine.Networking;
System.Collections.Generic;

public class Example : MonoBehaviour
{
IEnumerator DownloadAndCacheAssetBundle(string uri, string manifestBundlePat
{
//Load the manifest
AssetBundle manifestBundle = AssetBundle.LoadFromFile(manifestBundlePath
AssetBundleManifest manifest = manifestBundle.LoadAsset listOfCachedVersions = new List();
Caching.GetCachedVersions(bundle.name, listOfCachedVersions);

if (!AssetBundleContainsAssetIWantToLoad(bundle))
//Or any condition
{
//If our criteria wasn't met, we can remove the new cache and revert
Caching.currentCacheForWriting = Caching.GetCacheAt(Caching.cacheCou
Caching.RemoveCache(newCache);

for (int i = listOfCachedVersions.Count - 1; i > 0; i--)
{
//Load a different bundle from a different cache
request = UnityWebRequestAssetBundle.GetAssetBundle(uri, listOfC
yield return request.SendWebRequest();
bundle = DownloadHandlerAssetBundle.GetContent(request);

//Check and see if the newly loaded bundle from the cache meets
if (AssetBundleContainsAssetIWantToLoad(bundle))
break;
}
}
else
{
//This is if we only want to keep 5 local caches at any time
if (Caching.cacheCount > 5)
Caching.RemoveCache(Caching.GetCacheAt(1));
//Removes the ol
}
}

bool AssetBundleContainsAssetIWantToLoad(AssetBundle bundle)
{
return (bundle.LoadAsset("MyAsset") != null);
}

//this cou

}

If you wanted to store up to 5 cached versions of the same bundle and use the previous caches in the event your
most recent cache becomes invalid or the downloaded Asset Bundle has a problem, you could set that up like
this.

using
using
using
using
using

System.Collections;
System.Collections.Generic;
UnityEngine;
UnityEngine.Networking;
System.IO;

public class Example2 : MonoBehaviour
{
public static class CacheWithPriority
{
public enum ResolutionType
{
High,
Medium,
Low,
}
static readonly Dictionary ResolutionCaches = new

public static void InitResolutionCaches()
{
string highResPath = "HighRes";
string medResPath = "MedRes";
string lowResPath = Application.streamingAssetsPath;

//Create cache paths
Directory.CreateDirectory(highResPath);
Directory.CreateDirectory(medResPath);

//Create the caches and add them to a Dictionary
ResolutionCaches.Add(ResolutionType.High, Caching.AddCache(highResPa
ResolutionCaches.Add(ResolutionType.Medium, Caching.AddCache(medResP
ResolutionCaches.Add(ResolutionType.Low, Caching.AddCache(lowResPath
}

public static void PrioritizeCacheForLoading(ResolutionType resolutionTo
{
//Move cache to the start of the queue
Caching.MoveCacheBefore(ResolutionCaches[resolutionToPrioritize], Ca
}

public static void SetResolutionCacheForWriting(ResolutionType resolutio
{
Caching.currentCacheForWriting = ResolutionCaches[resolutionToWriteT
}
}

AssetBundle currentTextureAssetBundle;
IEnumerator RearrangeCacheOrderExample(string manifestBundlePath)
{
CacheWithPriority.InitResolutionCaches();

//Load the manifest
AssetBundle manifestBundle = AssetBundle.LoadFromFile(manifestBundlePath
AssetBundleManifest manifest = manifestBundle.LoadAsset();

myCanvas = myGO.GetComponent();
myCanvas.renderMode = RenderMode.ScreenSpaceOverlay;
myGO.AddComponent();
myGO.AddComponent();

// Text

myText = new GameObject();
myText.transform.parent = myGO.transform;
myText.name = "wibble";

text = myText.AddComponent();
text.font = (Font)Resources.Load("MyFont");
text.text = "wobble";
text.fontSize = 100;

// Text position
rectTransform = text.GetComponent();
rectTransform.localPosition = new Vector3(0, 0, 0);
rectTransform.sizeDelta = new Vector2(400, 200);
}
}

Properties
additionalShaderChannels

Get or set the mask of additional shader channels to be used when creating the
Canvas mesh.

cachedSortingLayerValue

Cached calculated value based upon SortingLayerID.

isRootCanvas

Is this the root Canvas?

normalizedSortingGridSize

The normalized grid size that the canvas will split the renderable area into.

overridePixelPerfect

Allows for nested canvases to override pixelPerfect settings inherited from
parent canvases.

overrideSorting

Override the sorting of canvas.

pixelPerfect

Force elements in the canvas to be aligned with pixels. Only applies with
renderMode is Screen Space.

pixelRect

Get the render rect for the Canvas.

planeDistance

How far away from the camera is the Canvas generated.

referencePixelsPerUnit

The number of pixels per unit that is considered the default.

renderMode

Is the Canvas in World or Overlay mode?

renderOrder

The render order in which the canvas is being emitted to the Scene. (Read Only)

rootCanvas

Returns the Canvas closest to root, by checking through each parent and
returning the last canvas found. If no other canvas is found then the canvas will

return itself.
scaleFactor

Used to scale the entire canvas, while still making it t the screen. Only applies
with renderMode is Screen Space.

sortingLayerID

Unique ID of the Canvas' sorting layer.

sortingLayerName

Name of the Canvas' sorting layer.

sortingOrder

Canvas' order within a sorting layer.

targetDisplay

For Overlay mode, display index on which the UI canvas will appear.

worldCamera

Camera used for sizing the Canvas when in Screen Space - Camera. Also used as
the Camera that events will be sent through for a World Space [[Canvas].

Static Methods
ForceUpdateCanvases

Force all canvases to update their content.

GetDefaultCanvasMaterial

Returns the default material that can be used for rendering normal
elements on the Canvas.

GetETC1SupportedCanvasMaterial

Gets or generates the ETC1 Material.

Events
willRenderCanvases

Event that is called just before Canvas rendering happens.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:ICanvasRaycastFilter
SWITCH TO MANUAL

Description
A Canvas placable element that can be used to modify children Alpha, Raycasting, Enabled state.
A canvas group can be used to modify the state of children elements.
An example of this would be a window which fades in over time, by modifying the alpha value of the group the
children elements well be a ected. The result alpha will be the multiplied result of any nested groups, multiplied
with the canvas elements alpha.
Canvas Groups can also be con gured to not block raycasts (anything on the group will not be considerered for
graphic raycasting), and whether elements are interactable.

Properties
alpha

Set the alpha of the group.

blocksRaycasts

Does this group block raycasting (allow collision).

ignoreParentGroups

Should the group ignore parent groups?

interactable

Is the group interactable (are the elements beneath the group enabled).

Public Methods
IsRaycastLocationValid

Returns true if the Group allows raycasts.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A component that will render to the screen after all normal rendering has completed when attached to a Canvas.
Designed for GUI application.
See Also:Canvas.

Properties
absoluteDepth

Depth of the renderer relative to the root canvas.

cull

Indicates whether geometry emitted by this renderer is ignored.

cullTransparentMesh

Indicates whether geometry emitted by this renderer can be ignored when the vertex
color alpha is close to zero for every vertex of the mesh.

hasMoved

True if any change has occured that would invalidate the positions of generated
geometry.

hasPopInstruction

Enable 'render stack' pop draw call.

hasRectClipping

True if rect clipping has been enabled on this renderer. See Also:
CanvasRenderer.EnableRectClipping, CanvasRenderer.DisableRectClipping.

materialCount

The number of materials usable by this renderer.

popMaterialCount

The number of materials usable by this renderer. Used internally for masking.

relativeDepth

Depth of the renderer realative to the parent canvas.

Public Methods
Clear

Remove all cached vertices.

DisableRectClipping

Disables rectangle clipping for this CanvasRenderer.

EnableRectClipping

Enables rect clipping on the CanvasRendered. Geometry outside of the speci ed rect
will be clipped (not rendered).

GetAlpha

Get the current alpha of the renderer.

GetColor

Get the current color of the renderer.

GetInheritedAlpha

Get the nal inherited alpha calculated by including all the parent alphas from included
parent CanvasGroups.

GetMaterial

Gets the current Material assigned to the CanvasRenderer.

GetPopMaterial

Gets the current Material assigned to the CanvasRenderer. Used internally for masking.

SetAlpha

Set the alpha of the renderer. Will be multiplied with the UIVertex alpha and the Canvas
alpha.

SetAlphaTexture

The Alpha Texture that will be passed to the Shader under the _AlphaTex property.

SetColor

Set the color of the renderer. Will be multiplied with the UIVertex color and the Canvas
color.

SetMaterial

Set the material for the canvas renderer. If a texture is speci ed then it will be used as
the 'MainTex' instead of the material's 'MainTex'. See Also:
CanvasRenderer.SetMaterialCount, CanvasRenderer.SetTexture.

SetMesh

Sets the Mesh used by this renderer.

SetPopMaterial

Set the material for the canvas renderer. Used internally for masking.

SetTexture

Sets the texture used by this renderer's material.

Static Methods
AddUIVertexStream

Take the Vertex steam and split it corrisponding arrays (positions, colors, uv0s, uv1s,
normals and tangents).

CreateUIVertexStream

Convert a set of vertex components into a stream of UIVertex.

SplitUIVertexStreams

Given a list of UIVertex, split the stream into it's component types.

Events
onRequestRebuild

(Editor Only) Event that gets red whenever the data in the CanvasRenderer gets
invalidated and needs to be rebuilt.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A capsule-shaped primitive collider.
Capsules are cylinders with a half-sphere at each end.
See Also: BoxCollider, SphereCollider, PhysicMaterial, Rigidbody.

Properties
center

The center of the capsule, measured in the object's local space.

direction

The direction of the capsule.

height

The height of the capsule measured in the object's local space.

radius

The radius of the sphere, measured in the object's local space.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback
SWITCH TO MANUAL

Description
A capsule-shaped primitive collider.
Capsules are boxes with a semi-circle at each end.

Properties
direction

The direction that the capsule sides can extend.

size

The width and height of the capsule area.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game

object and on every ancestor of the behaviour.
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback
SWITCH TO MANUAL

Description
A CharacterController allows you to easily do movement constrained by collisions without having to deal with a
rigidbody.
A CharacterController is not a ected by forces and will only move when you call the Move function. It will then
carry out the movement but be constrained by collisions.
See Also: Character Controller component and Character animation examples

Properties
center

The center of the character's capsule relative to the transform's position.

collisionFlags

What part of the capsule collided with the environment during the last
CharacterController.Move call.

detectCollisions

Determines whether other rigidbodies or character controllers collide with this
character controller (by default this is always enabled).

enableOverlapRecovery

Enables or disables overlap recovery. Enables or disables overlap recovery. Used to
depenetrate character controllers from static objects when an overlap is detected.

height

The height of the character's capsule.

isGrounded

Was the CharacterController touching the ground during the last move?

minMoveDistance

Gets or sets the minimum move distance of the character controller.

radius

The radius of the character's capsule.

skinWidth

The character's collision skin width.

slopeLimit

The character controllers slope limit in degrees.

stepO set

The character controllers step o set in meters.

velocity

The current relative velocity of the Character (see notes).

Public Methods
Move

A more complex move function taking absolute movement deltas.

SimpleMove

Moves the character with speed.

Messages
OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback

Description
Speci cation for how to render a character from the font texture. See Font.characterInfo.
See Also: Example at Font.RequestCharactersInTexture.

Properties
advance

The horizontal distance, rounded to the nearest integer, from the origin of this character
to the origin of the next character.

bearing

The horizontal distance from the origin of this glyph to the begining of the glyph image.

glyphHeight

The height of the glyph image.

glyphWidth

The width of the glyph image.

index

Unicode value of the character.

maxX

The maximum extend of the glyph image in the x-axis.

maxY

The maximum extend of the glyph image in the y-axis.

minX

The minium extend of the glyph image in the x-axis.

minY

The minimum extend of the glyph image in the y-axis.

size

The size of the character or 0 if it is the default font size.

style

The style of the character.

uvBottomLeft

The uv coordinate matching the bottom left of the glyph image in the font texture.

uvBottomRight

The uv coordinate matching the bottom right of the glyph image in the font texture.

uvTopLeft

The uv coordinate matching the top left of the glyph image in the font texture.

uvTopRight

The uv coordinate matching the top right of the glyph image in the font texture.

Leave feedback
SWITCH TO MANUAL

Description
Character Joints are mainly used for Ragdoll e ects.
They are an extended ball-socket joint which allows you to limit the joint on each axis.

Properties
enableProjection

Brings violated constraints back into alignment even when the solver fails.

highTwistLimit

The upper limit around the primary axis of the character joint.

lowTwistLimit

The lower limit around the primary axis of the character joint.

projectionAngle

Set the angular tolerance threshold (in degrees) for projection.

projectionDistance

Set the linear tolerance threshold for projection.

swing1Limit

The angular limit of rotation (in degrees) around the primary axis of the character joint.

swing2Limit

The angular limit of rotation (in degrees) around the primary axis of the character joint.

swingAxis

The secondary axis around which the joint can rotate.

swingLimitSpring

The con guration of the spring attached to the swing limits of the joint.

twistLimitSpring

The con guration of the spring attached to the twist limits of the joint.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Leave feedback
SWITCH TO MANUAL

Description
Collider for 2D physics representing an circle.
See Also: BoxCollider class, PolygonCollider2D class.

Properties
radius

Radius of the circle.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback
SWITCH TO MANUAL

Description
The Cloth class provides an interface to cloth simulation physics.

Properties
bendingSti ness

Bending sti ness of the cloth.

capsuleColliders

An array of CapsuleColliders which this Cloth instance should collide with.

clothSolverFrequency

Number of cloth solver iterations per second.

coe cients

The cloth skinning coe cients used to set up how the cloth interacts with the
skinned mesh.

collisionMassScale

How much to increase mass of colliding particles.

damping

Damp cloth motion.

enableContinuousCollision

Enable continuous collision to improve collision stability.

enabled

Is this cloth enabled?

externalAcceleration

A constant, external acceleration applied to the cloth.

friction

The friction of the cloth when colliding with the character.

normals

The current normals of the cloth object.

randomAcceleration

A random, external acceleration applied to the cloth.

selfCollisionDistance

Minimum distance at which two cloth particles repel each other (default: 0.0).

selfCollisionSti ness

Self-collision sti ness de nes how strong the separating impulse should be for
colliding particles.

sleepThreshold

Cloth's sleep threshold.

sphereColliders

An array of ClothSphereColliderPairs which this Cloth instance should collide
with.

sti nessFrequency

Sets the sti ness frequency parameter.

stretchingSti ness

Stretching sti ness of the cloth.

useGravity

Should gravity a ect the cloth simulation?

useTethers

Use Tether Anchors.

useVirtualParticles

Add one virtual particle per triangle to improve collision stability.

vertices

The current vertex positions of the cloth object.

worldAccelerationScale

How much world-space acceleration of the character will a ect cloth vertices.

worldVelocityScale

How much world-space movement of the character will a ect cloth vertices.

Public Methods
ClearTransformMotion

Clear the pending transform changes from a ecting the cloth simulation.

GetSelfAndInterCollisionIndices

Get list of particles to be used for self and inter collision.

GetVirtualParticleIndices

Get list of indices to be used when generating virtual particles.

GetVirtualParticleWeights

Get weights to be used when generating virtual particles for cloth.

SetEnabledFading

Fade the cloth simulation in or out.

SetSelfAndInterCollisionIndices

This allows you to set the cloth indices used for self and inter collision.

SetVirtualParticleIndices

Set indices to use when generating virtual particles.

SetVirtualParticleWeights

Sets weights to be used when generating virtual particles for cloth.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if

it doesn't.
GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The ClothSkinningCoe cient struct is used to set up how a Cloth component is allowed to move with respect to
the SkinnedMeshRenderer it is attached to.
This is set using the Cloth.coe cients property on the Cloth component, which is a per-vertex array of
ClothSkinningCoe cient structs. Typically, you will not set these values from code, but instead, set them up in the
editor which shows up when you look at the Cloth component in the inspector.

Properties
collisionSphereDistance

De nition of a sphere a vertex is not allowed to enter. This allows collision against
the animated cloth.

maxDistance

Distance a vertex is allowed to travel from the skinned mesh vertex position.

Leave feedback

Description
A pair of SphereColliders used to de ne shapes for Cloth objects to collide against.
A ClothSphereColliderPair can contain either a single valid SphereCollider instance (with the second one being
null), or a pair of two SphereColliders. In the former cases the ClothSphereColliderPair just represents a single
SphereCollider for the cloth to collide against. In the latter case, it represents a conic capsule shape de ned by the
two spheres, and the cone connecting the two. Conic capsule shapes are useful for modelling limbs of a
character.
Select the cloth object to see a visualization of Cloth colliders shapes in the Scene view.

Properties
rst
second

The rst SphereCollider of a ClothSphereColliderPair.
The second SphereCollider of a ClothSphereColliderPair.

Constructors
ClothSphereColliderPair

Creates a ClothSphereColliderPair. If only one SphereCollider is given, the
ClothSphereColliderPair will de ne a simple sphere. If two SphereColliders are
given, the ClothSphereColliderPair de nes a conic capsule shape, composed of the
two spheres and the cone connecting the two.

Leave feedback

Description
Interface for reading and writing inputs in a Unity Cluster.
ClusterInput provides access to VRPN devices by connecting to a VRPN server. It also provides access to writeable
inputs. All inputs managed by ClusterInput will be replicated to the rest of the connected slaves in the cluster.
Using ClusterInput is much like using the traditional Input system in Unity.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
void Update()
{
// Buttons and Axis provide a single value.
bool buttonValue = ClusterInput.GetButton("button1");
float axisValue = ClusterInput.GetAxis("axis1");

// A tracker provides 2 values, rotation and position.
Vector3 position = ClusterInput.GetTrackerPosition("tracker1");
Quaternion rotation = ClusterInput.GetTrackerRotation("tracker1");

if (ClusterNetwork.isMasterOfCluster)
{
float axisValueCustom = MyCustomDevicePlugin.GetValue("myaxis");
ClusterInput.SetAxis("customAxis", axisValueCustom);
}
}
}

Static Methods
AddInput

Add a new VRPN input entry.

CheckConnectionToServer

Check the connection status of the device to the VRPN server it connected to.

EditInput

Edit an input entry which added via ClusterInput.AddInput.

GetAxis

Returns the axis value as a continous oat.

GetButton

Returns the binary value of a button.

GetTrackerPosition

Return the position of a tracker as a Vector3.

GetTrackerRotation

Returns the rotation of a tracker as a Quaternion.

SetAxis

Sets the axis value for this input. Only works for input typed Custom.

SetButton

Sets the button value for this input. Only works for input typed Custom.

SetTrackerPosition

Sets the tracker position for this input. Only works for input typed Custom.

SetTrackerRotation

Sets the tracker rotation for this input. Only works for input typed Custom.

Leave feedback

Description
A helper class that contains static method to inquire status of Unity Cluster.

Static Properties
isDisconnected

Check whether the current instance is disconnected from the cluster network.

isMasterOfCluster

Check whether the current instance is a master node in the cluster network.

nodeIndex

To acquire or set the node index of the current machine from the cluster network.

Leave feedback

Description
A base class of all colliders.
See Also: BoxCollider, SphereCollider, CapsuleCollider, MeshCollider, PhysicMaterial, Rigidbody.
If the object with the Collider needs to be moved during gameplay then you should also attach a Rigidbody
component to the object. The Rigidbody can be set to be kinematic if you don't want the object to have physical
interaction with other objects.

Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Parent class for collider types used with 2D gameplay.
See Also: BoxCollider2D, CircleCollider2D, PolygonCollider2D, EdgeCollider2D.

Properties
attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring the collider
itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider itself.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Represents the separation or overlap of two Collider2D.
The ColliderDistance2D primarily de nes a point on the exterior of each Collider2D along with the distance
between those two points. The distance between them can be positive indicating that the Collider2D are
separated (not overlapped), zero indicating that they are touching (but not overlapped) or negative indicating that
they are overlapped.
A normal is provided that is a normalized vector that points from pointB to pointA. This vector, when scaled with
the distance, provide a vector that can be used to move the Collider2D so that they are no longer overlapped (if
the distance is negative) or so they are touching (if the distance is positive).
A common use-case for this is solving overlaps between two Collider2D, particularly when attached to a
Rigidbody2D set to be RigidbodyType2D.Kinematic.
See Also: Physics2D.Distance, Collider2D.Distance and Rigidbody2D.Distance.

Properties
distance

Gets the distance between two colliders.

isOverlapped

Gets whether the distance represents an overlap or not.

isValid

Gets whether the distance is valid or not.

normal

A normalized vector that points from pointB to pointA.

pointA

A point on a Collider2D that is a speci c distance away from pointB.

pointB

A point on a Collider2D that is a speci c distance away from pointA.

Leave feedback

Description
Describes a collision.
Collision information is passed to Collider.OnCollisionEnter, Collider.OnCollisionStay and Collider.OnCollisionExit
events. See Also: ContactPoint.

Properties
collider

The Collider we hit (Read Only).

contacts

The contact points generated by the physics engine.

gameObject

The GameObject whose collider you are colliding with. (Read Only).

impulse

The total impulse applied to this contact pair to resolve the collision.

relativeVelocity

The relative linear velocity of the two colliding objects (Read Only).

rigidbody

The Rigidbody we hit (Read Only). This is null if the object we hit is a collider with no
rigidbody attached.

transform

The Transform of the object we hit (Read Only).

Leave feedback

Description
Collision details returned by 2D physics callback functions.
The collisions details are returned by MonoBehaviour.OnCollisionEnter2D, MonoBehaviour.OnCollisionStay2D
and MonoBehaviour.OnCollisionExit2D callbacks. It details which Collider2D and Rigidbody2D pairs are involved
in the collision as well as contact points where the Collider2D meet.

Properties
collider

The incoming Collider2D involved in the collision with the otherCollider.

contactCount

Gets the number of contacts for this collision.

contacts

The speci c points of contact with the incoming Collider2D. You should avoid using this as
it produces memory garbage. Use GetContact or GetContacts instead.

enabled

Indicates whether the collision response or reaction is enabled or disabled.

gameObject

The incoming GameObject involved in the collision.

otherCollider

The other Collider2D involved in the collision with the collider.

otherRigidbody

The other Rigidbody2D involved in the collision with the rigidbody.

relativeVelocity

The relative linear velocity of the two colliding objects (Read Only).

rigidbody

The incoming Rigidbody2D involved in the collision with the otherRigidbody.

transform

The Transform of the incoming object involved in the collision.

Public Methods
GetContact

Gets the contact point at the speci ed index.

GetContacts

Retrieves all contact points in for contacts between collider and otherCollider.

Leave feedback

Description
Representation of RGBA colors.
This structure is used throughout Unity to pass colors around. Each color component is a oating point value with
a range from 0 to 1.
Components (r,g,b) de ne a color in RGB color space. Alpha component (a) de nes transparency - alpha of one is
completely opaque, alpha of zero is completely transparent.

Static Properties
black

Solid black. RGBA is (0, 0, 0, 1).

blue

Solid blue. RGBA is (0, 0, 1, 1).

clear

Completely transparent. RGBA is (0, 0, 0, 0).

cyan

Cyan. RGBA is (0, 1, 1, 1).

gray

Gray. RGBA is (0.5, 0.5, 0.5, 1).

green

Solid green. RGBA is (0, 1, 0, 1).

grey

English spelling for gray. RGBA is the same (0.5, 0.5, 0.5, 1).

magenta

Magenta. RGBA is (1, 0, 1, 1).

red

Solid red. RGBA is (1, 0, 0, 1).

white

Solid white. RGBA is (1, 1, 1, 1).

yellow

Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at!

Properties
a

Alpha component of the color (0 is transparent, 1 is opaque).

b

Blue component of the color.

g

Green component of the color.

gamma

A version of the color that has had the gamma curve applied.

grayscale

The grayscale value of the color. (Read Only)

linear

A linear value of an sRGB color.

maxColorComponent

Returns the maximum color component value: Max(r,g,b).

r

Red component of the color.

this[int]

Access the r, g, b,a components using [0], [1], [2], [3] respectively.

Constructors
Color

Constructs a new Color with given r,g,b,a components.

Public Methods
ToString

Returns a nicely formatted string of this color.

Static Methods
HSVToRGB

Creates an RGB colour from HSV input.

Lerp

Linearly interpolates between colors a and b by t.

LerpUnclamped

Linearly interpolates between colors a and b by t.

RGBToHSV

Calculates the hue, saturation and value of an RGB input color.

Operators
Color

Colors can be implicitly converted to and from Vector4.

operator -

Subtracts color b from color a. Each component is subtracted separately.

operator *

Multiplies two colors together. Each component is multiplied separately.

operator /

Divides color a by the oat b. Each color component is scaled separately.

operator +

Adds two colors together. Each component is added separately.

Vector4

Colors can be implicitly converted to and from Vector4.

Leave feedback

Description
Representation of RGBA colors in 32 bit format.
Each color component is a byte value with a range from 0 to 255.
Components (r,g,b) de ne a color in RGB color space. Alpha component (a) de nes transparency - alpha of 255 is
completely opaque, alpha of zero is completely transparent.

Properties
a

Alpha component of the color.

b

Blue component of the color.

g

Green component of the color.

r

Red component of the color.

Constructors
Color32

Constructs a new Color32 with given r, g, b, a components.

Public Methods
ToString

Returns a nicely formatted string of this color.

Static Methods
Lerp

Linearly interpolates between colors a and b by t.

LerpUnclamped

Linearly interpolates between colors a and b by t.

Operators
Color

Color32 can be implicitly converted to and from Color.

Color32

Color32 can be implicitly converted to and from Color.

Leave feedback

Description
A collection of common color functions.

Static Methods
ToHtmlStringRGB

Returns the color as a hexadecimal string in the format "RRGGBB".

ToHtmlStringRGBA

Returns the color as a hexadecimal string in the format "RRGGBBAA".

TryParseHtmlString

Attempts to convert a html color string.

Leave feedback

Description
Struct used to describe meshes to be combined using Mesh.CombineMeshes.

Properties
lightmapScaleO set

The baked lightmap UV scale and o set applied to the Mesh.

mesh

Mesh to combine.

realtimeLightmapScaleO set

The realtime lightmap UV scale and o set applied to the Mesh.

subMeshIndex

Sub-Mesh index of the Mesh.

transform

Matrix to transform the Mesh with before combining.

Leave feedback

Description
Interface into compass functionality.

Properties
enabled

Used to enable or disable compass. Note, that if you want Input.compass.trueHeading
property to contain a valid value, you must also enable location updates by calling
Input.location.Start().

headingAccuracy

Accuracy of heading reading in degrees.

magneticHeading

The heading in degrees relative to the magnetic North Pole. (Read Only)

rawVector

The raw geomagnetic data measured in microteslas. (Read Only)

timestamp

Timestamp (in seconds since 1970) when the heading was last time updated. (Read Only)

trueHeading

The heading in degrees relative to the geographic North Pole. (Read Only)

Leave feedback

Description
Base class for everything attached to GameObjects.
Note that your code will never directly create a Component. Instead, you write script code, and attach the script to
a GameObject. See Also: ScriptableObject as a way to create scripts that do not attach to any GameObject.

Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

Inherited Members
Properties

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A Collider that can merge other Colliders together.
A CompositeCollider2D merges other Colliders together when their Collider2D.usedByComposite is set to true.
When a Collider is used by a Composite Collider, the Editor will ignore and not show the
Collider2D.sharedMaterial, Collider2D.isTrigger & Collider2D.usedByComposite properties. The same properties
on the CompositeCollider2D will be used instead. You should set these properties on the Composite Collider
instead to merge all Colliders into the Composite Collider.
Composite Colliders can only merge BoxCollider2D and PolygonCollider2D.

Properties
edgeRadius

Controls the radius of all edges created by the Collider.

generationType

Speci es when to generate the Composite Collider geometry.

geometryType

Speci es the type of geometry the Composite Collider should generate.

pathCount

The number of paths in the Collider.

pointCount

Gets the total number of points in all the paths within the Collider.

vertexDistance

Controls the minimum distance allowed between generated vertices.

Public Methods
GenerateGeometry

Regenerates the Composite Collider geometry.

GetPath

Gets a path from the Collider by its index.

GetPathPointCount

Gets the number of points in the speci ed path from the Collider by its index.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider

itself.
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback
SWITCH TO MANUAL

Description
Speci es when to generate the Composite Collider geometry.
Controls when the Composite Collider geometry is updated when a Collider used by a Composite Collider
changes.
See Also: CompositeCollider2D.generationType.

Properties
Synchronous

Sets the Composite Collider geometry to update synchronously immediately when a
Collider used by the Composite Collider changes.

Manual

Sets the Composite Collider geometry to not automatically update when a Collider used
by the Composite Collider changes.

Leave feedback
SWITCH TO MANUAL

Description
Speci es the type of geometry the Composite Collider generates.
See Also: CompositeCollider2D.geometryType.

Properties
Outlines

Sets the Composite Collider to generate closed outlines for the merged Collider geometry
consisting of only edges.

Polygons

Sets the Composite Collider to generate closed outlines for the merged Collider geometry
consisting of convex polygon shapes.

Leave feedback

Description
GPU data bu er, mostly for use with compute shaders.
ComputeShader programs often need arbitrary data to be read & written into memory bu ers. ComputeBu er
class is exactly for that - you can create & ll them from script code, and use them in compute shaders or regular
shaders.
Compute bu ers are always supported in compute shaders. Compute shader support can be queried runtime
using SystemInfo.supportsComputeShaders. See the Compute Shaders Manual page for more information about
platforms supporting compute shaders. In regular graphics shaders the compute bu er support requires
minimum shader model 4.5.
On the shader side, ComputeBu ers with default ComputeBu erType map to StructuredBuffer and
RWStructuredBuffer in HLSL.
See Also: ComputeShader class, Shader.SetGlobalBu er, Material.SetBu er, Compute Shaders overview.

Properties
count

Number of elements in the bu er (Read Only).

stride

Size of one element in the bu er (Read Only).

Constructors
ComputeBu er

Create a Compute Bu er.

Public Methods
GetData

Read data values from the bu er into an array. The array can only use blittable types.

GetNativeBu erPtr

Retrieve a native (underlying graphics API) pointer to the bu er.

IsValid

Returns true if this compute bu er is valid and false otherwise.

Release

Release a Compute Bu er.

SetCounterValue

Sets counter value of append/consume bu er.

SetData

Set the bu er with values from an array.

Static Methods

CopyCount

Copy counter value of append/consume bu er into another bu er.

Leave feedback
SWITCH TO MANUAL

Description
Compute Shader asset.
Compute shaders are programs that run on the GPU outside of the normal rendering pipeline. They correspond
to compute shader assets in the project (.compute les).
Compute shader support can be queried runtime using SystemInfo.supportsComputeShaders. See Compute
Shaders overview for more info about platforms supporting compute shaders.
See Also: ComputeBu er class, Compute Shaders overview.

Public Methods
Dispatch

Execute a compute shader.

DispatchIndirect

Execute a compute shader.

FindKernel

Find ComputeShader kernel index.

GetKernelThreadGroupSizes

Get kernel thread group sizes.

HasKernel

Checks whether a shader contains a given kernel.

SetBool

Set a bool parameter.

SetBu er

Sets an input or output compute bu er.

SetFloat

Set a oat parameter.

SetFloats

Set multiple consecutive oat parameters at once.

SetInt

Set an integer parameter.

SetInts

Set multiple consecutive integer parameters at once.

SetMatrix

Set a Matrix parameter.

SetMatrixArray

Set a Matrix array parameter.

SetTexture

Set a texture parameter.

SetTextureFromGlobal

Set a texture parameter from a global texture property.

SetVector

Set a vector parameter.

SetVectorArray

Set a vector array parameter.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The con gurable joint is an extremely exible joint giving you complete control over rotation and linear motion.
You can build all other joints with it and much more but it is also more complicated to setup. It gives you control
over motors, drives and joint limits for each rotation axis and and linear degree of freedom.

Properties
angularXDrive

De nition of how the joint's rotation will behave around its local X axis. Only used
if Rotation Drive Mode is Swing & Twist.

angularXLimitSpring

The con guration of the spring attached to the angular X limit of the joint.

angularXMotion

Allow rotation around the X axis to be Free, completely Locked, or Limited
according to Low and High Angular XLimit.

angularYLimit

Boundary de ning rotation restriction, based on delta from original rotation.

angularYMotion

Allow rotation around the Y axis to be Free, completely Locked, or Limited
according to Angular YLimit.

angularYZDrive

De nition of how the joint's rotation will behave around its local Y and Z axes. Only
used if Rotation Drive Mode is Swing & Twist.

angularYZLimitSpring

The con guration of the spring attached to the angular Y and angular Z limits of
the joint.

angularZLimit

Boundary de ning rotation restriction, based on delta from original rotation.

angularZMotion

Allow rotation around the Z axis to be Free, completely Locked, or Limited
according to Angular ZLimit.

con guredInWorldSpace

If enabled, all Target values will be calculated in world space instead of the object's
local space.

highAngularXLimit

Boundary de ning upper rotation restriction, based on delta from original
rotation.

linearLimit

Boundary de ning movement restriction, based on distance from the joint's origin.

linearLimitSpring

The con guration of the spring attached to the linear limit of the joint.

lowAngularXLimit

Boundary de ning lower rotation restriction, based on delta from original rotation.

projectionAngle

Set the angular tolerance threshold (in degrees) for projection.If the joint deviates
by more than this angle around its locked angular degrees of freedom, the solver

will move the bodies to close the angle.Setting a very small tolerance may result in
simulation jitter or other artifacts.Sometimes it is not possible to project (for
example when the joints form a cycle).
projectionDistance

Set the linear tolerance threshold for projection.If the joint separates by more than
this distance along its locked degrees of freedom, the solver will move the bodies
to close the distance.Setting a very small tolerance may result in simulation jitter or
other artifacts.Sometimes it is not possible to project (for example when the joints
form a cycle).

projectionMode

Brings violated constraints back into alignment even when the solver fails.
Projection is not a physical process and does not preserve momentum or respect
collision geometry. It is best avoided if practical, but can be useful in improving
simulation quality where joint separation results in unacceptable artifacts.

rotationDriveMode

Control the object's rotation with either X & YZ or Slerp Drive by itself.

secondaryAxis

The joint's secondary axis.

slerpDrive

De nition of how the joint's rotation will behave around all local axes. Only used if
Rotation Drive Mode is Slerp Only.

swapBodies

If enabled, the two connected rigidbodies will be swapped, as if the joint was
attached to the other body.

targetAngularVelocity

This is a Vector3. It de nes the desired angular velocity that the joint should rotate
into.

targetPosition

The desired position that the joint should move into.

targetRotation

This is a Quaternion. It de nes the desired rotation that the joint should rotate
into.

targetVelocity

The desired velocity that the joint should move along.

xDrive

De nition of how the joint's movement will behave along its local X axis.

xMotion

Allow movement along the X axis to be Free, completely Locked, or Limited
according to Linear Limit.

yDrive

De nition of how the joint's movement will behave along its local Y axis.

yMotion

Allow movement along the Y axis to be Free, completely Locked, or Limited
according to Linear Limit.

zDrive

De nition of how the joint's movement will behave along its local Z axis.

zMotion

Allow movement along the Z axis to be Free, completely Locked, or Limited
according to Linear Limit.

Inherited Members

Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Leave feedback
SWITCH TO MANUAL

Description
A force applied constantly.
This is a small physics utility class used to apply a continous force to an object.
Rigidbody.AddForce applies a force to the Rigidbody only for one frame, thus you have to keep calling the
function. ConstantForce on the other hand will apply the force every frame until you change the force or torque
to a new value.
See Also: Rigidbody.

Properties
force

The force applied to the rigidbody every frame.

relativeForce

The force - relative to the rigid bodies coordinate system - applied every frame.

relativeTorque

The torque - relative to the rigid bodies coordinate system - applied every frame.

torque

The torque applied to the rigidbody every frame.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game

object or any of its children.
CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Applies both linear and angular (torque) forces continuously to the rigidbody each physics update.
This is equivalent of calling Rigidbody2D.AddForce, Rigidbody2D.AddRelativeForce and Rigidbody2D.AddTorque
each physics update. See Also: Rigidbody2D.

Properties
force

The linear force applied to the rigidbody each physics update.

relativeForce

The linear force, relative to the rigid-body coordinate system, applied each physics
update.

torque

The torque applied to the rigidbody each physics update.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A set of parameters for ltering contact results.
Use a contact lter to precisely control which contact results get returned. This removes the need to lter the
results later, is faster, and more convenient.
For more information on using ContactFilter2D with casting, see: Physics2D.CircleCast, Physics2D.BoxCast,
Physics2D.CapsuleCast, Physics2D.Linecast, Physics2D.Raycast, Collider2D.Raycast, Collider2D.Cast and
Rigidbody2D.Cast.
For more information on using ContactFilter2D with overlapping areas, see: Physics2D.OverlapPoint,
Physics2D.OverlapCircle, Physics2D.OverlapBox, Physics2D.OverlapArea, Physics2D.OverlapCapsule,
Physics2D.OverlapCollider, Rigidbody2D.OverlapCollider and Collider2D.OverlapCollider.
For more information on using ContactFilter2D with contacts, see: Physics2D.GetContacts,
Collider2D.GetContacts, Rigidbody2D.GetContacts, Physics2D.IsTouching, Rigidbody2D.IsTouching and
Collider2D.IsTouching.

Properties
isFiltering

Given the current state of the contact lter, determine whether it would lter
anything.

layerMask

Sets the contact lter to lter the results that only include Collider2D on the layers
de ned by the layer mask.

maxDepth

Sets the contact lter to lter the results to only include Collider2D with a Z
coordinate (depth) less than this value.

maxNormalAngle

Sets the contact lter to lter the results to only include contacts with collision
normal angles that are less than this angle.

minDepth

Sets the contact lter to lter the results to only include Collider2D with a Z
coordinate (depth) greater than this value.

minNormalAngle

Sets the contact lter to lter the results to only include contacts with collision
normal angles that are greater than this angle.

useDepth

Sets the contact lter to lter the results by depth using minDepth and maxDepth.

useLayerMask

Sets the contact lter to lter results by layer mask.

useNormalAngle

Sets the contact lter to lter the results by the collision's normal angle using
minNormalAngle and maxNormalAngle.

useOutsideDepth

Sets the contact lter to lter within the minDepth and maxDepth range, or outside

that range.
useOutsideNormalAngle

Sets the contact lter to lter within the minNormalAngle and maxNormalAngle
range, or outside that range.

useTriggers

Sets to lter contact results based on trigger collider involvement.

Public Methods
ClearDepth

Turns o depth ltering by setting useDepth to false. The associated values of
minDepth and maxDepth are not changed.

ClearLayerMask

Turns o layer mask ltering by setting useLayerMask to false. The associated value
of layerMask is not changed.

ClearNormalAngle

Turns o normal angle ltering by setting useNormalAngle to false. The associated
values of minNormalAngle and maxNormalAngle are not changed.

IsFilteringDepth

Checks if the Transform for obj is within the depth range to be ltered.

IsFilteringLayerMask

Checks if the GameObject.layer for obj is included in the layerMask to be ltered.

IsFilteringNormalAngle

Checks if the angle of normal is within the normal angle range to be ltered.

IsFilteringTrigger

Checks if the collider is a trigger and should be ltered by the useTriggers to be
ltered.

NoFilter

Sets the contact lter to not lter any ContactPoint2D.

SetDepth

Sets the minDepth and maxDepth lter properties and turns on depth ltering by
setting useDepth to true.

SetLayerMask

Sets the layerMask lter property using the layerMask parameter provided and also
enables layer mask ltering by setting useLayerMask to true.

SetNormalAngle

Sets the minNormalAngle and maxNormalAngle lter properties and turns on
normal angle ltering by setting useNormalAngle to true.

Leave feedback

Description
Describes a contact point where the collision occurs.
Contact points are stored in Collision structure.
See Also: Collision, Collider.OnCollisionEnter, Collider.OnCollisionStay, Collider.OnCollisionExit.

Properties
normal

Normal of the contact point.

otherCollider

The other collider in contact at the point.

point

The point of contact.

separation

The distance between the colliders at the contact point.

thisCollider

The rst collider in contact at the point.

Leave feedback

Description
Details about a speci c point of contact involved in a 2D physics collision.
A contact point describes a point of intersection between two Collider2D. ContactPoint2D can only exist on
Collider2D that are not set to be triggers as triggers do not de ne contact points.
See Also: Collider2D.isTrigger, Physics2D.GetContacts, Rigidbody2D.GetContacts, Collider2D.GetContacts and
Collision2D.

Properties
collider

The incoming Collider2D involved in the collision with the otherCollider.

enabled

Indicates whether the collision response or reaction is enabled or disabled.

normal

Surface normal at the contact point.

normalImpulse

Gets the impulse force applied at the contact point along the ContactPoint2D.normal.

otherCollider

The other Collider2D involved in the collision with the collider.

otherRigidbody

The other Rigidbody2D involved in the collision with the rigidbody.

point

The point of contact between the two colliders in world space.

relativeVelocity

Gets the relative velocity of the two colliders at the contact point (Read Only).

rigidbody

The incoming Rigidbody2D involved in the collision with the otherRigidbody.

separation

Gets the distance between the colliders at the contact point.

tangentImpulse

Gets the impulse force applied at the contact point which is perpendicular to the
ContactPoint2D.normal.

Leave feedback

Description
ControllerColliderHit is used by CharacterController.OnControllerColliderHit to give detailed information about
the collision and how to deal with it.

Properties
collider

The collider that was hit by the controller.

controller

The controller that hit the collider.

gameObject

The game object that was hit by the controller.

moveDirection

The direction the CharacterController was moving in when the collision occured.

moveLength

How far the character has travelled until it hit the collider.

normal

The normal of the surface we collided with in world space.

point

The impact point in world space.

rigidbody

The rigidbody that was hit by the controller.

transform

The transform that was hit by the controller.

Leave feedback

Description
MonoBehaviour.StartCoroutine returns a Coroutine. Instances of this class are only used to reference these
coroutines, and do not hold any exposed properties or functions.
A coroutine is a function that can suspend its execution (yield) until the given YieldInstruction nishes.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
IEnumerator WaitAndPrint()
{
// suspend execution for 5 seconds
yield return new WaitForSeconds(5);
print("WaitAndPrint " + Time.time);
}

IEnumerator Start()
{
print("Starting " + Time.time);

// Start function WaitAndPrint as a coroutine
yield return StartCoroutine("WaitAndPrint");
print("Done " + Time.time);
}
}

This example shows a normal Start:

using UnityEngine;
using System.Collections;

// In this example we show how to invoke a coroutine and execute
// the function in parallel. Start does not need IEnumerator.

public class ExampleClass : MonoBehaviour
{
private IEnumerator coroutine;

void Start()
{
// - After 0 seconds, prints "Starting 0.0 seconds"
// - After 0 seconds, prints "Coroutine started"
// - After 2 seconds, prints "Coroutine ended: 2.0 seconds"
print("Starting " + Time.time + " seconds");

// Start function WaitAndPrint as a coroutine.

coroutine = WaitAndPrint(2.0f);
StartCoroutine(coroutine);

print("Coroutine started");
}

private IEnumerator WaitAndPrint(float waitTime)
{
yield return new WaitForSeconds(waitTime);
print("Coroutine ended: " + Time.time + " seconds");
}
}

Inherited Members

Leave feedback

Description
Holds data for a single application crash event and provides access to all gathered crash reports.
If compiled with appropriate settings, Unity will try to gather useful information, like location and thread stack
traces, when your application crashes. Upon the next application start, if the data gathering was successful, all
crash information will be accessible using this API.
To enable crash report generation, in iOS player settings set "Script Call Optimization" option to "Fast but no
Exceptions". After you build your Xcode project in Unity, open it and edit trampoline le: Classes/CrashReporter.h.
Change ENABLE_CUSTOM_CRASH_REPORTER de ne from 0 to 1. Note that the iOS Player Settings has a Crash
Reporting setting with an "Enable CrashReport API".
Note: this API currently is available only for iOS targets.
See Also: CrashReport.reports.

using UnityEngine;

// This example shows a list of crash reports (if available),
// and allows you to output crash data to console, or
// delete them.
public class Crashes : MonoBehaviour
{
void OnGUI()
{
var reports = CrashReport.reports;
GUILayout.Label("Crash reports:");
foreach (var r in reports)
{
GUILayout.BeginHorizontal();
GUILayout.Label("Crash: " + r.time);
if (GUILayout.Button("Log"))
{
Debug.Log(r.text);
}
if (GUILayout.Button("Remove"))
{
r.Remove();
}
GUILayout.EndHorizontal();

}
}
}

Static Properties
lastReport

Returns last crash report, or null if no reports are available.

reports

Returns all currently available reports in a new array.

Properties
text

Crash report data as formatted text.

time

Time, when the crash occured.

Public Methods
Remove

Remove report from available reports list.

Static Methods
RemoveAll

Remove all reports from available reports list.

Leave feedback
SWITCH TO MANUAL

Description
Class for handling cube maps, Use this to create or modify existing cube map assets.

Properties
format

The format of the pixel data in the texture (Read Only).

mipmapCount

How many mipmap levels are in this texture (Read Only).

Constructors
Cubemap

Create a new empty cubemap texture.

Public Methods
Apply

Actually apply all previous SetPixel and SetPixels changes.

GetPixel

Returns pixel color at coordinates (face, x, y).

GetPixels

Returns pixel colors of a cubemap face.

SetPixel

Sets pixel color at coordinates (face, x, y).

SetPixels

Sets pixel colors of a cubemap face.

SmoothEdges

Performs smoothing of near edge regions.

Static Methods
CreateExternalTexture

Creates a Unity cubemap out of externally created native cubemap object.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Class for handling Cubemap arrays.
Modern graphics APIs (e.g. D3D10.1 and later, OpenGL 4.0 and later, Metal on macOS, PS4) support "cubemap
arrays", which are arrays of same size & format cubemaps. From the shader side, they are treated as a single
resource, and sampling them needs an extra coordinate that indicates which array element to sample from.
Typically cubemap arrays are useful for implementing e cient re ection probe, lighting and shadowing systems
(all re ection/cookie/shadow cubemaps in a single array).
Cubemap arrays do not have an import pipeline for them, and must be created from code, either at runtime or in
editor scripts. Using Graphics.CopyTexture is useful for fast copying of pixel data from regular Cubemap textures
into elements of a cubemap array. From editor scripts, a common way of creating serialized cubemap array is to
create it, ll with data (either via Graphics.CopyTexture from regular cubemaps, or via SetPixels or SetPixels32)
and save it as an asset via AssetDatabase.CreateAsset.
Note that not all platforms and GPUs support cubemap arrays; for example none of the mobile APIs/GPUs
currently support them. Use SystemInfo.supportsCubemapArrayTextures to check.

Properties
cubemapCount

Number of cubemaps in the array (Read Only).

format

Texture format (Read Only).

Constructors
CubemapArray

Create a new cubemap array.

Public Methods
Apply

Actually apply all previous SetPixels changes.

GetPixels

Returns pixel colors of a single array slice/face.

GetPixels32

Returns pixel colors of a single array slice/face.

SetPixels

Set pixel colors for a single array slice/face.

SetPixels32

Set pixel colors for a single array slice/face.

Inherited Members

Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was

imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.
mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Describes a set of bounding spheres that should have their visibility and distances maintained.

Properties
enabled

Pauses culling group execution.

onStateChanged

Sets the callback that will be called when a sphere's visibility and/or distance state has
changed.

targetCamera

Locks the CullingGroup to a speci c camera.

Constructors
CullingGroup

Create a CullingGroup.

Public Methods
Dispose

Clean up all memory used by the CullingGroup immediately.

EraseSwapBack

Erase a given bounding sphere by moving the nal sphere on top of it.

GetDistance

Get the current distance band index of a given sphere.

IsVisible

Returns true if the bounding sphere at index is currently visible from any of the
contributing cameras.

QueryIndices

Retrieve the indices of spheres that have particular visibility and/or distance
states.

SetBoundingDistances

Set bounding distances for 'distance bands' the group should compute, as well
as options for how spheres falling into each distance band should be treated.

SetBoundingSphereCount

Sets the number of bounding spheres in the bounding spheres array that are
actually being used.

SetBoundingSpheres

Sets the array of bounding sphere de nitions that the CullingGroup should
compute culling for.

SetDistanceReferencePoint

Set the reference point from which distance bands are measured.

Delegates

StateChanged

This delegate is used for recieving a callback when a sphere's distance or visibility state
has changed.

Leave feedback

Description
Provides information about the current and previous states of one sphere in a CullingGroup.
See Also: CullingGroup.onStateChanged.

Properties
currentDistance

The current distance band index of the sphere, after the most recent culling pass.

hasBecomeInvisible

Did this sphere change from being visible to being invisible in the most recent culling
pass?

hasBecomeVisible

Did this sphere change from being invisible to being visible in the most recent culling
pass?

index

The index of the sphere that has changed.

isVisible

Was the sphere considered visible by the most recent culling pass?

previousDistance

The distance band index of the sphere before the most recent culling pass.

wasVisible

Was the sphere visible before the most recent culling pass?

Leave feedback

Description
Cursor API for setting the cursor (mouse pointer).
Supports hardware cursors on macOS, Windows and Linux. Falls back to software cursors on unsupported
platforms.
Windows Store Apps: Supports only one hardware cursor, set via PlayerSettings.defaultCursor, cursors created
at runtime using Cursor.SetCursor are treated as software cursors.
Textures used as cursors should be marked as such in their import settings.

Static Properties
lockState

Determines whether the hardware pointer is locked to the center of the view, constrained
to the window, or not constrained at all.

visible

Determines whether the hardware pointer is visible or not.

Static Methods
SetCursor

Sets the mouse cursor to the given texture.

Leave feedback
SWITCH TO MANUAL

Description
Custom Render Textures are an extension to Render Textures, enabling you to render directly to the Texture
using a Shader.
Custom Render Textures are an extension to Render Textures allowing you easily to update the texture with a
Shader and then use it in a regular Material. This is useful for implementing all kinds of complex simulations, for
instance: water caustics, ripple simulations for rain e ects, or splatting liquids against a wall. Also provided is a
scripting and Shader framework to help with more complicated con gurations like partial or multi-pass updates,
and varying update frequency.

Properties
cubemapFaceMask

Bit eld that allows to enable or disable update on each of the cubemap faces. Order
from least signi cant bit is +X, -X, +Y, -Y, +Z, -Z.

doubleBu ered

If true, the Custom Render Texture is double bu ered so that you can access it during
its own update. otherwise the Custom Render Texture will be not be double bu ered.

initializationColor

Color with which the Custom Render Texture is initialized. This parameter will be
ignored if an initializationMaterial is set.

initializationMaterial

Material with which the Custom Render Texture is initialized. Initialization texture and
color are ignored if this parameter is set.

initializationMode

Specify how the texture should be initialized.

initializationSource

Specify if the texture should be initialized with a Texture and a Color or a Material.

initializationTexture

Texture with which the Custom Render Texture is initialized (multiplied by the
initialization color). This parameter will be ignored if an initializationMaterial is set.

material

Material with which the content of the Custom Render Texture is updated.

shaderPass

Shader Pass used to update the Custom Render Texture.

updateMode

Specify how the texture should be updated.

updateZoneSpace

Space in which the update zones are expressed (Normalized or Pixel space).

wrapUpdateZones

If true, Update zones will wrap around the border of the Custom Render Texture.
Otherwise, Update zones will be clamped at the border of the Custom Render Texture.

Constructors

CustomRenderTexture

Create a new Custom Render Texture.

Public Methods
ClearUpdateZones

Clear all Update Zones.

GetUpdateZones

Returns the list of Update Zones.

Initialize

Triggers an initialization of the Custom Render Texture.

SetUpdateZones

Setup the list of Update Zones for the Custom Render Texture.

Update

Triggers the update of the Custom Render Texture.

Inherited Members
Static Properties
active

Currently active render texture.

currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

antiAliasing

The antialiasing level for the RenderTexture.

autoGenerateMips

Mipmap levels are generated automatically when this ag is set.

bindTextureMS

If true and antiAliasing is greater than 1, the render texture will not be resolved by
default. Use this if the render texture needs to be bound as a multisampled texture in
a shader.

colorBu er

Color bu er of the render texture (Read Only).

depth

The precision of the render texture's depth bu er in bits (0, 16, 24/32 are supported).

depthBu er

Depth/stencil bu er of the render texture (Read Only).

descriptor

This struct contains all the information required to create a RenderTexture. It can be
copied, cached, and reused to easily create RenderTextures that all share the same
properties.

dimension

Dimensionality (type) of the render texture.

enableRandomWrite

Enable random access write into this render texture on Shader Model 5.0 level
shaders.

format

The color format of the render texture.

height

The height of the render texture in pixels.

memorylessMode

The render texture memoryless mode property.

sRGB

Does this render texture use sRGB read/write conversions? (Read Only).

useDynamicScale

Is the render texture marked to be scaled by the Dynamic Resolution system.

useMipMap

Render texture has mipmaps when this ag is set.

volumeDepth

Volume extent of a 3D render texture or number of slices of array texture.

vrUsage

If this RenderTexture is a VR eye texture used in stereoscopic rendering, this property
decides what special rendering occurs, if any.

width

The width of the render texture in pixels.

anisoLevel

Anisotropic ltering level of the texture.

dimension
lterMode

Dimensionality (type) of the texture (Read Only).
Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

ConvertToEquirect

Converts the render texture to equirectangular format (both stereoscopic or
monoscopic equirect). The left eye will occupy the top half and the right eye will
occupy the bottom. The monoscopic version will occupy the whole texture.
Texture dimension must be of type TextureDimension.Cube.

Create

Actually creates the RenderTexture.

DiscardContents

Hint the GPU driver that the contents of the RenderTexture will not be used.

GenerateMips

Generate mipmap levels of a render texture.

GetNativeDepthBu erPtr

Retrieve a native (underlying graphics API) pointer to the depth bu er resource.

IsCreated

Is the render texture actually created?

MarkRestoreExpected

Indicate that there's a RenderTexture restore operation expected.

Release

Releases the RenderTexture.

ResolveAntiAliasedSurface

Force an antialiased render texture to be resolved.

SetGlobalShaderProperty

Assigns this RenderTexture as a global shader property named propertyName.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

GetTemporary

Allocate a temporary render texture.

ReleaseTemporary

Release a temporary texture allocated with GetTemporary.

SupportsStencil

Does a RenderTexture have stencil bu er?

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Structure describing an Update Zone.
UpdateZones are used when updating the full custom render texture is not required. They are de ned by a
position, a size and a rotation inside the surface of the texture. Multiple Update Zones can be set up in order to
update di erent parts of the texture at the same time. See Also: CustomRenderTexture.

Properties
needSwap

If true, and if the texture is double bu ered, a request is made to swap the bu ers
before the next update. Otherwise, the bu ers will not be swapped.

passIndex

Shader Pass used to update the Custom Render Texture for this Update Zone.

rotation

Rotation of the Update Zone.

updateZoneCenter

Position of the center of the Update Zone within the Custom Render Texture.

updateZoneSize

Size of the Update Zone.

Leave feedback

Description
Base class for custom yield instructions to suspend coroutines.
CustomYieldInstruction lets you implement custom yield instructions to suspend coroutine execution until an
event happens. Under the hood, custom yield instruction is just another running coroutine. To implement it,
inherit from CustomYieldInstruction class and override keepWaiting property. To keep coroutine suspended
return true. To let coroutine proceed with execution return false. keepWaiting property is queried each frame
after MonoBehaviour.Update and before MonoBehaviour.LateUpdate.
This class requires Unity 5.3 or later.
To keep coroutine suspended, return true. To let coroutine proceed with execution, return false.

// Example showing how a CustomYieldInstruction script file
// can be used. This waits for the left button to go up and then
// waits for the right button to go down.
using System.Collections;
using UnityEngine;

public class ExampleScript : MonoBehaviour
{
void Update()
{
if (Input.GetMouseButtonUp(0))
{
Debug.Log("Left mouse button up");
StartCoroutine(waitForMouseDown());
}
}

public IEnumerator waitForMouseDown()
{
yield return new WaitForMouseDown();
Debug.Log("Right mouse button pressed");
}
}

The following script implements the overridable version of keepWaiting. This c# implementation can be used by
JS. In this case make sure this c# script is in a folder such as Plugins so it is compiled before the JS script
example above.

using UnityEngine;

public class WaitForMouseDown : CustomYieldInstruction
{
public override bool keepWaiting
{
get
{
return !Input.GetMouseButtonDown(1);
}
}

public WaitForMouseDown()
{
Debug.Log("Waiting for Mouse right button down");
}
}

using System.Collections;
using UnityEngine;
using System;

// Implementation of WaitWhile yield instruction. This can be later used as:
// yield return new WaitWhile(() => Princess.isInCastle);
class WaitWhile1 : CustomYieldInstruction
{
Func m_Predicate;

public override bool keepWaiting { get { return m_Predicate(); } }

public WaitWhile1(Func predicate) { m_Predicate = predicate; }
}

To have more control and implement more complex yield instructions you can inherit directly from
System.Collections.IEnumerator class. In this case, implement MoveNext() method the same way you
would implement keepWaiting property. Additionally to that, you can also return an object in Current property,
that will be processed by Unity's coroutine scheduler after executing MoveNext() method. So for example if
Current returned another object inheriting from IEnumerator, then current enumerator would be suspended
until the returned one has completed.

using System;
using System.Collections;

// Same WaitWhile implemented by inheriting from IEnumerator.
class WaitWhile2 : IEnumerator
{
Func m_Predicate;

public object Current { get { return null; } }

public bool MoveNext() { return m_Predicate(); }

public void Reset() {}

public WaitWhile2(Func predicate) { m_Predicate = predicate; }
}

Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
Class containing methods to ease debugging while developing a game.

Static Properties
developerConsoleVisible

Reports whether the development console is visible. The development console
cannot be made to appear using:

isDebugBuild

In the Build Settings dialog there is a check box called "Development Build".

unityLogger

Get default debug logger.

Static Methods
Assert

Assert a condition and logs an error message to the Unity console on failure.

AssertFormat

Assert a condition and logs a formatted error message to the Unity console on
failure.

Break

Pauses the editor.

ClearDeveloperConsole

Clears errors from the developer console.

DrawLine

Draws a line between speci ed start and end points.

DrawRay

Draws a line from start to start + dir in world coordinates.

Log

Logs message to the Unity Console.

LogAssertion

A variant of Debug.Log that logs an assertion message to the console.

LogAssertionFormat

Logs a formatted assertion message to the Unity console.

LogError

A variant of Debug.Log that logs an error message to the console.

LogErrorFormat

Logs a formatted error message to the Unity console.

LogException

A variant of Debug.Log that logs an error message from an exception to the
console.

LogFormat

Logs a formatted message to the Unity Console.

LogWarning

A variant of Debug.Log that logs a warning message to the console.

LogWarningFormat

Logs a formatted warning message to the Unity Console.

Leave feedback

Description
Detail prototype used by the Terrain GameObject.

Properties
bendFactor

Bend factor of the detailPrototype.

dryColor

Color when the DetailPrototypes are "dry".

healthyColor

Color when the DetailPrototypes are "healthy".

maxHeight

Maximum height of the grass billboards (if render mode is GrassBillboard).

maxWidth

Maximum width of the grass billboards (if render mode is GrassBillboard).

minHeight

Minimum height of the grass billboards (if render mode is GrassBillboard).

minWidth

Minimum width of the grass billboards (if render mode is GrassBillboard).

noiseSpread

How spread out is the noise for the DetailPrototype.

prototype

GameObject used by the DetailPrototype.

prototypeTexture

Texture used by the DetailPrototype.

renderMode

Render mode for the DetailPrototype.

Leave feedback

Description
Provides access to a display / screen for rendering operations.
Multi-display rendering is available on PC (Windows/Mac/Linux), iOS and Android.
Use the Display class to operate on the displays themselves, and Camera.targetDisplay to set up cameras for
rendering to individual displays.
See Also: Camera.targetDisplay, Canvas.targetDisplay.

using UnityEngine;

public class Example : MonoBehaviour
{
Camera extCam;
Camera cam;

void Start()
{
// GUI is rendered with last camera.
// As we want it to end up in the main screen, make sure main camera is
extCam.depth = cam.depth - 1;

cam.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer)
extCam.enabled = false;
}

void Update()
{
if (Display.displays.Length > 1 && !extCam.enabled)
{
Display.displays[1].SetRenderingResolution(256, 256);
extCam.SetTargetBuffers(Display.displays[1].colorBuffer, Display.dis
}
extCam.enabled = Display.displays.Length > 1;
}
}

Static Properties
displays

The list of currently connected Displays. Contains at least one (main) display.

main

Main Display.

Properties
active

Gets the state of the display and returns true if the display is active and false if otherwise.

colorBu er

Color RenderBu er.

depthBu er

Depth RenderBu er.

renderingHeight

Vertical resolution that the display is rendering at.

renderingWidth

Horizontal resolution that the display is rendering at.

systemHeight

Vertical native display resolution.

systemWidth

Horizontal native display resolution.

Public Methods
Activate

Activate an external display. Eg. Secondary Monitors connected to the System.

SetParams

Set rendering size and position on screen (Windows only).

SetRenderingResolution

Sets rendering resolution for the display.

Static Methods
RelativeMouseAt

Query relative mouse coordinates.

Leave feedback
SWITCH TO MANUAL

Description
Joint that keeps two Rigidbody2D objects a xed distance apart.
Note that unlike the SpringJoint2D component, the distance separating the objects is truly xed and does not
allow for any stretching.
See Also: HingeJoint2D class, SliderJoint2D class, SpringJoint2D class.

Properties
autoCon gureDistance

Should the distance be calculated automatically?

distance

The distance separating the two ends of the joint.

maxDistanceOnly

Whether to maintain a maximum distance only or not. If not then the absolute
distance will be maintained instead.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
A component can be designed to drive a RectTransform. The DrivenRectTransformTracker struct is used to
specify which RectTransforms it is driving.
Driving a RectTransform means that the values of the driven RectTransform are controlled by that component.
These driven values cannot be edited in the Inspector (they are shown as disabled). They also won't be saved
when saving a Scene, which prevents undesired Scene le changes.
Whenever the component is changing values of driven RectTransforms, it should rst call the Clear method and
then use the Add method to add all RectTransforms it is driving. The Clear method should also be called in the
OnDisable callback of the component.

Public Methods
Add

Add a RectTransform to be driven.

Clear

Clear the list of RectTransforms being driven.

Static Methods
StartRecordingUndo

Resume recording undo of driven RectTransforms.

StopRecordingUndo

Stop recording undo actions from driven RectTransforms.

Leave feedback

Description
Allows to control the dynamic Global Illumination.
See Also: RendererExtensions.UpdateGIMaterials, TerrainExtensions.UpdateGIMaterials.

Static Properties
indirectScale

Allows for scaling the contribution coming from realtime & baked lightmaps.Note:
this value can be set in the Lighting Window UI and it is serialized, that is not the
case for other properties in this class.

isConverged

Is precomputed realtime Global Illumination output converged?

materialUpdateTimeSlice

The number of milliseconds that can be spent on material updates.

synchronousMode

When enabled, new dynamic Global Illumination output is shown in each frame.

updateThreshold

Threshold for limiting updates of realtime GI. The unit of measurement is
"percentage intensity change".

Static Methods
SetEmissive

Allows to set an emissive color for a given renderer quickly, without the need to render
the emissive input for the entire system.

SetEnvironmentData

Allows overriding the distant environment lighting for Realtime GI, without changing
the Skybox Material.

UpdateEnvironment

Schedules an update of the environment texture.

UpdateMaterials

Schedules an update of the albedo and emissive textures of a system that contains the
renderer or the terrain.

Leave feedback
SWITCH TO MANUAL

Description
Collider for 2D physics representing an arbitrary set of connected edges (lines) de ned by its vertices.
See Also: BoxCollider2D, CircleCollider2D, PolygonCollider2D.

Properties
edgeCount

Gets the number of edges.

edgeRadius

Controls the radius of all edges created by the collider.

pointCount

Gets the number of points.

points

Get or set the points de ning multiple continuous edges.

Public Methods
Reset

Reset to a single edge consisting of two points.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics

only).
OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback

Description
A base class for all 2D e ectors.

Properties
colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A UnityGUI event.
Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events.
For each event OnGUI is called in the scripts; so OnGUI is potentially called multiple times per frame.
Event.current corresponds to "current" event inside OnGUI call.
See Also: GUI Scripting Guide, EventType.

Static Properties
current

The current event that's being processed right now.

Properties
alt

Is Alt/Option key held down? (Read Only)

button

Which mouse button was pressed.

capsLock

Is Caps Lock on? (Read Only)

character

The character typed.

clickCount

How many consecutive mouse clicks have we received.

command

Is Command/Windows key held down? (Read Only)

commandName

The name of an ExecuteCommand or ValidateCommand Event.

control

Is Control key held down? (Read Only)

delta

The relative movement of the mouse compared to last event.

displayIndex

Index of display that the event belongs to.

functionKey

Is the current keypress a function key? (Read Only)

isKey

Is this event a keyboard event? (Read Only)

isMouse

Is this event a mouse event? (Read Only)

keyCode

The raw key code for keyboard events.

modi ers

Which modi er keys are held down.

mousePosition

The mouse position.

numeric

Is the current keypress on the numeric keyboard? (Read Only)

shift

Is Shift held down? (Read Only)

type

The type of event.

Public Methods
GetTypeForControl

Get a ltered event type for a given control ID.

Use

Use this event.

Static Methods
GetEventCount

Returns the current number of events that are stored in the event queue.

KeyboardEvent

Create a keyboard event.

PopEvent

Get the next queued [Event] from the event system.

Leave feedback

Description
An exception that will prevent all subsequent immediate mode GUI functions from evaluating for the remainder
of the GUI loop.
If you have exception handling in your GUI code, it should not catch this exception type, as Unity's immediate
mode GUI system relies on this exception to exit the current GUI loop properly in some cases.
If you need to exit the immediate mode GUI loop in your own code, you should call GUIUtility.ExitGUI rather than
throwing this exception directly.

Leave feedback

Description
Object that is used to resolve references to an ExposedReference eld.
This object is used by ExposedReference elds to resolve their values at runtime.
See also:
• FrameData – You can nd the ExposedPropertyResolver as a member of the FrameData structure you receive in
Playable.PrepareFrame
• ExposedReference – You pass the ExposedPropertyResolver to the Resolve method to get the value at runtime.

Leave feedback

Description
Creates a type whos value is resolvable at runtime.
ExposedReference is a generic type that can be used to create references to Scene objects and resolve their
actual values at runtime and by using a context object. This can be used by assets, such as a ScriptableObject or
PlayableAsset to create references to Scene objects.
The example below shows how a PlayableAsset can use exposed references to create references to a Scene
GameObject. This is an example that uses Timeline, so you may want to set up your GameObject in Timeline and
make an animation with your GameObject rst.

//Put both of these scripts in your Project, then go to your Timeline, click the
//Click on the track and choose a GameObject from your Scene in the "My Scene Ob

using UnityEngine;
using UnityEngine.Playables;

[System.Serializable]
public class ExposedReferenceExample : PlayableAsset
{
//This allows you to use GameObjects in your Scene
public ExposedReference m_MySceneObject;
//This variable allows you to decide the velocity of your GameObject
public Vector3 m_SceneObjectVelocity;

public override Playable CreatePlayable(PlayableGraph graph , GameObject my
{
//Get access to the Playable Behaviour script
TestExample playableBehaviour = new TestExample();
//Resolve the exposed reference on the Scene GameObject by returning the
playableBehaviour.m_MySceneObject = m_MySceneObject.Resolve(graph.GetRes

//Make the PlayableBehaviour velocity variable the same as the variable
playableBehaviour.m_SceneObjectVelocity = m_SceneObjectVelocity;

//Create a custom playable from this script using the Player Behaviour s
return ScriptPlayable.Create(graph, playableBehaviour);

}
}

Place this next script in your Project in the same folder as the above script. This script changes the behaviour of
the timeline by moving the Scene GameObject while the Playable Track is playing.

using
using

UnityEngine;
UnityEngine.Playables;

public class TestExample : PlayableBehaviour
{
public GameObject m_MySceneObject;
public Vector3 m_SceneObjectVelocity;

public override void PrepareFrame(Playable playable, FrameData frameData)
{
//If the Scene GameObject exists, move it continuously until the Playabl
if (m_MySceneObject != null)
//Move the GameObject using the velocity you set in your Playable Tr
m_MySceneObject.transform.Translate(m_SceneObjectVelocity);
}
}

Properties
defaultValue

The default value, in case the value cannot be resolved.

exposedName

The name of the ExposedReference.

Public Methods
Resolve

Gets the value of the reference by resolving it given the ExposedPropertyResolver context
object.

Leave feedback
SWITCH TO MANUAL

Description
The Fixed joint groups together 2 rigidbodies, making them stick together in their bound position.
See Also: CharacterJoint, HingeJoint, SpringJoint, Con gurableJoint.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Leave feedback
SWITCH TO MANUAL

Description
Connects two Rigidbody2D together at their anchor points using a con gurable spring.

Properties
dampingRatio

The amount by which the spring force is reduced in proportion to the movement speed.

frequency

The frequency at which the spring oscillates around the distance between the objects.

referenceAngle

The angle referenced between the two bodies used as the constraint for the joint.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback
SWITCH TO MANUAL

Description
A are asset. Read more about ares in the components reference.
The are class has no properties. It needs to be setup up in the inspector. You can reference ares and assign
them to a Light at runtime.
See Also: Flare assets, LensFlare class.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
FlareLayer component.
The FlareLayer is a lens are component to be used on cameras. It has no properties.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for font assets.
You can use this class to dynamically switch fonts on GUI texts or Text Meshes.
See Also: GUIText and TextMesh.

Properties
ascent

The ascent of the font.

characterInfo

Access an array of all characters contained in the font texture.

dynamic

Is the font a dynamic font.

fontSize

The default size of the font.

lineHeight

The line height of the font.

material

The material used for the font display.

Constructors
Font

Create a new Font.

Public Methods
GetCharacterInfo

Get rendering info for a speci c character.

HasCharacter

Does this font have a speci c character?

RequestCharactersInTexture

Request characters to be added to the font texture (dynamic fonts only).

Static Methods
CreateDynamicFontFromOSFont

Creates a Font object which lets you render a font installed on the user
machine.

GetMaxVertsForString

Returns the maximum number of verts that the text generator may return
for a given string.

GetOSInstalledFontNames

Get names of fonts installed on the machine.

Events
textureRebuilt

Set a function to be called when the dynamic font texture is rebuilt.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Struct containing basic FrameTimings and accompanying relevant data.

Properties
cpuFrameTime

The CPU time for a given frame, in ms.

cpuTimeFrameComplete

This is the CPU clock time at the point GPU nished rendering the frame and
interrupted the CPU.

cpuTimePresentCalled

This is the CPU clock time at the point Present was called for the current frame.

gpuFrameTime

The GPU time for a given frame, in ms.

heightScale

This was the height scale factor of the Dynamic Resolution system(if used) for the
given frame and the linked frame timings.

syncInterval

This was the vsync mode for the given frame and the linked frame timings.

widthScale

This was the width scale factor of the Dynamic Resolution system(if used) for the
given frame and the linked frame timings.

Leave feedback

Description
The FrameTimingManager allows the user to capture and access FrameTiming data for multple frames.

Static Methods
CaptureFrameTimings

This function triggers the FrameTimingManager to capture a snapshot of
FrameTiming's data, that can then be accessed by the user.

GetCpuTimerFrequency

This returns the frequency of CPU timer on the current platform, used to interpret
timing results. If the platform does not support returning this value it will return 0.

GetGpuTimerFrequency

This returns the frequency of GPU timer on the current platform, used to interpret
timing results. If the platform does not support returning this value it will return 0.

GetLatestTimings

Allows the user to access the currently captured FrameTimings.

GetVSyncsPerSecond

This returns the number of vsyncs per second on the current platform, used to
interpret timing results. If the platform does not support returning this value it will
return 0.

Leave feedback
SWITCH TO MANUAL

Description
Applies both force and torque to reduce both the linear and angular velocities to zero.
The joint constantly tries to reduce both the ::Rigidbody2D::velocity and ::Rigidbody2D::angularVelocity to zero.
Unlike contact friction which requires two colliders to be in contact, force and torque here are applied
continuously.
You can control both the maximum force using maxForce and maximum torque using maxTorque. Because you
can use very high force or torque limits, you can essentially reduce an objects movement to almost zero.
A typical usage for this joint might be to simulate top-down surface friction or to simulate sti rotation of an
object.

Properties
maxForce

The maximum force that can be generated when trying to maintain the friction joint
constraint.

maxTorque

The maximum torque that can be generated when trying to maintain the friction joint
constraint.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
This struct contains the view space coordinates of the near projection plane.

Properties
bottom

Position in view space of the bottom side of the near projection plane.

left

Position in view space of the left side of the near projection plane.

right

Position in view space of the right side of the near projection plane.

top

Position in view space of the top side of the near projection plane.

zFar

Z distance from the origin of view space to the far projection plane.

zNear

Z distance from the origin of view space to the near projection plane.

Leave feedback
SWITCH TO MANUAL

Description
Base class for all entities in Unity Scenes.
Note: Many variables in the GameObject class have been removed. To access, for example GameObject.renderer
in csharp use GetComponent() instead.
See Also: Component.

Properties
activeInHierarchy

De nes whether the GameObject is active in the Scene.

activeSelf

The local active state of this GameObject. (Read Only)

isStatic

Editor only API that speci es if a game object is static.

layer

The layer the game object is in.

scene

Scene that the GameObject is part of.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

Constructors
GameObject

Creates a new game object, named name.

Public Methods
AddComponent

Adds a component class named className to the game object.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

SetActive

Activates/Deactivates the GameObject.

Static Methods
CreatePrimitive

Creates a game object with a primitive mesh renderer and appropriate collider.

Find

Finds a GameObject by name and returns it.

FindGameObjectsWithTag

Returns a list of active GameObjects tagged tag. Returns empty array if no
GameObject was found.

FindWithTag

Returns one active GameObject tagged tag. Returns null if no GameObject was
found.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy

instead.
DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Utility class for common geometric functions.

Static Methods
CalculateBounds

Calculates a bounding box given an array of positions and a transformation
matrix.

CalculateFrustumPlanes

Calculates frustum planes.

TestPlanesAABB

Returns true if bounds are inside the plane array.

TryCreatePlaneFromPolygon

Creates a plane from a given list of vertices. Works for concave polygons and
polygons that have multiple aligned vertices.

Leave feedback

Description
Gizmos are used to give visual debugging or setup aids in the Scene view.
All gizmo drawing has to be done in either OnDrawGizmos or OnDrawGizmosSelected functions of the script.
OnDrawGizmos is called every frame. All gizmos rendered within OnDrawGizmos are pickable.
OnDrawGizmosSelected is called only if the object the script is attached to is selected.

Static Properties
color

Sets the color for the gizmos that will be drawn next.

matrix

Set the gizmo matrix used to draw all gizmos.

Static Methods
DrawCube

Draw a solid box with center and size.

DrawFrustum

Draw a camera frustum using the currently set Gizmos.matrix for it's location and
rotation.

DrawGUITexture

Draw a texture in the Scene.

DrawIcon

Draw an icon at a position in the Scene view.

DrawLine

Draws a line starting at from towards to.

DrawMesh

Draws a mesh.

DrawRay

Draws a ray starting at from to from + direction.

DrawSphere

Draws a solid sphere with center and radius.

DrawWireCube

Draw a wireframe box with center and size.

DrawWireMesh

Draws a wireframe mesh.

DrawWireSphere

Draws a wireframe sphere with center and radius.

Leave feedback

Description
Low-level graphics library.
Use this class to manipulate active transformation matrices, issue rendering commands similar to OpenGL's
immediate mode and do other low-level graphics tasks. Note that in almost all cases using Graphics.DrawMesh or
CommandBu er is more e cient than using immediate mode drawing.
GL immediate drawing functions use whatever is the "current material" set up right now (see Material.SetPass).
The material controls how the rendering is done (blending, textures, etc.), so unless you explicitly set it to
something before using GL draw functions, the material can happen to be anything. Also, if you call any other
drawing commands from inside GL drawing code, they can set material to something else, so make sure it's under
control as well.
GL drawing commands execute immediately. That means if you call them in Update(), they will be executed
before the camera is rendered (and the camera will most likely clear the screen, making the GL drawing not
visible).
The usual place to call GL drawing is most often in OnPostRender() from a script attached to a camera, or inside
an image e ect function (OnRenderImage).

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
// When added to an object, draws colored rays from the
// transform position.
public int lineCount = 100;
public float radius = 3.0f;

static Material lineMaterial;
static void CreateLineMaterial()
{
if (!lineMaterial)
{
// Unity has a built-in shader that is useful for drawing
// simple colored things.
Shader shader = Shader.Find("Hidden/Internal-Colored");
lineMaterial = new Material(shader);
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
// Turn on alpha blending

lineMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMod
lineMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMod
// Turn backface culling off
lineMaterial.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off
// Turn off depth writes
lineMaterial.SetInt("_ZWrite", 0);
}
}

// Will be called after all regular rendering is done
public void OnRenderObject()
{
CreateLineMaterial();
// Apply the line material
lineMaterial.SetPass(0);

GL.PushMatrix();
// Set transformation matrix for drawing to
// match our transform
GL.MultMatrix(transform.localToWorldMatrix);

// Draw lines
GL.Begin(GL.LINES);
for (int i = 0; i < lineCount; ++i)
{
float a = i / (float)lineCount;
float angle = a * Mathf.PI * 2;
// Vertex colors change from red to green
GL.Color(new Color(a, 1 - a, 0, 0.8F));
// One vertex at transform position
GL.Vertex3(0, 0, 0);
// Another vertex at edge of circle
GL.Vertex3(Mathf.Cos(angle) * radius, Mathf.Sin(angle) * radius, 0);
}
GL.End();
GL.PopMatrix();
}
}

Note: This class is almost always used when you need to draw a couple of lines or triangles, and don't want to
deal with meshes. If you want to avoid surprises the usage pattern is this:

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
void OnPostRender()
{
// Set your materials
GL.PushMatrix();
// yourMaterial.SetPass( );
// Draw your stuff
GL.PopMatrix();
}
}

Where at the "// Draw your stu " you should do SetPass() on some material previously declared, which will be
used for drawing. If you dont call SetPass, then you'll get basically a random material (whatever was used before)
which is not good. So do it.

Static Properties
invertCulling

Select whether to invert the backface culling (true) or not (false).

LINE_STRIP

Mode for Begin: draw line strip.

LINES

Mode for Begin: draw lines.

modelview

The current modelview matrix.

QUADS

Mode for Begin: draw quads.

sRGBWrite

Controls whether Linear-to-sRGB color conversion is performed while rendering.

TRIANGLE_STRIP

Mode for Begin: draw triangle strip.

TRIANGLES

Mode for Begin: draw triangles.

wireframe

Should rendering be done in wireframe?

Static Methods
Begin

Begin drawing 3D primitives.

Clear

Clear the current render bu er.

ClearWithSkybox

Clear the current render bu er with camera's skybox.

Color

Sets current vertex color.

End

End drawing 3D primitives.

Flush

Sends queued-up commands in the driver's command bu er to the GPU.

GetGPUProjectionMatrix

Compute GPU projection matrix from camera's projection matrix.

InvalidateState

Invalidate the internally cached render state.

IssuePluginEvent

Send a user-de ned event to a native code plugin.

LoadIdentity

Load the identity matrix to the current modelview matrix.

LoadOrtho

Helper function to set up an ortho perspective transform.

LoadPixelMatrix

Setup a matrix for pixel-correct rendering.

LoadProjectionMatrix

Load an arbitrary matrix to the current projection matrix.

MultiTexCoord

Sets current texture coordinate (v.x,v.y,v.z) to the actual texture unit.

MultiTexCoord2

Sets current texture coordinate (x,y) for the actual texture unit.

MultiTexCoord3

Sets current texture coordinate (x,y,z) to the actual texture unit.

MultMatrix

Sets the current modelview matrix to the one speci ed.

PopMatrix

Restores both projection and modelview matrices o the top of the matrix stack.

PushMatrix

Saves both projection and modelview matrices to the matrix stack.

RenderTargetBarrier

Resolves the render target for subsequent operations sampling from it.

TexCoord

Sets current texture coordinate (v.x,v.y,v.z) for all texture units.

TexCoord2

Sets current texture coordinate (x,y) for all texture units.

TexCoord3

Sets current texture coordinate (x,y,z) for all texture units.

Vertex

Submit a vertex.

Vertex3

Submit a vertex.

Viewport

Set the rendering viewport.

Leave feedback

Description
Gradient used for animating colors.
See Also: GradientColorKey, GradientAlphaKey.

using UnityEngine;

public class ExampleScript : MonoBehaviour
{
Gradient gradient;
GradientColorKey[] colorKey;
GradientAlphaKey[] alphaKey;

void Start()
{
gradient = new Gradient();

// Populate the color keys at the relative time 0 and 1 (0 and 100%)
colorKey = new GradientColorKey[2];
colorKey[0].color = Color.red;
colorKey[0].time = 0.0f;
colorKey[1].color = Color.blue;
colorKey[1].time = 1.0f;

// Populate the alpha keys at relative time 0 and 1
alphaKey = new GradientAlphaKey[2];
alphaKey[0].alpha = 1.0f;
alphaKey[0].time = 0.0f;
alphaKey[1].alpha = 0.0f;
alphaKey[1].time = 1.0f;

gradient.SetKeys(colorKey, alphaKey);

// What's the color at the relative time 0.25 (25 %) ?
Debug.Log(gradient.Evaluate(0.25f));

(0 and 100%)

}
}

Note that the alpha and colors keys will be automatically sorted by time value and that it is ensured to always
have a minimum of 2 color keys and 2 alpha keys.

Properties
alphaKeys

All alpha keys de ned in the gradient.

colorKeys

All color keys de ned in the gradient.

mode

Control how the gradient is evaluated.

Constructors
Gradient

Create a new Gradient object.

Public Methods
Evaluate

Calculate color at a given time.

SetKeys

Setup Gradient with an array of color keys and alpha keys.

Leave feedback

Description
Alpha key used by Gradient.
See Also: GradientColorKey, Gradient.

Properties
alpha

Alpha channel of key.

time

Time of the key (0 - 1).

Constructors
GradientAlphaKey

Gradient alpha key.

Leave feedback

Description
Color key used by Gradient.
See Also: GradientAlphaKey, Gradient.

Properties
color

Color of key.

time

Time of the key (0 - 1).

Constructors
GradientColorKey

Gradient color key.

Leave feedback

Description
Raw interface to Unity's drawing functions.
This is the high-level shortcut into the optimized mesh drawing functionality of Unity.

Static Properties
activeColorBu er

Currently active color bu er (Read Only).

activeColorGamut

Returns the currently active color gamut.

activeDepthBu er

Currently active depth/stencil bu er (Read Only).

activeTier

Graphics Tier classi cation for current device. Changing this value a ects any subsequently loaded shaders. Initially this value is autodetected from the hardware in use.

Static Methods
Blit

Copies source texture into destination render texture with a shader.

BlitMultiTap

Copies source texture into destination, for multi-tap shader.

ClearRandomWriteTargets

Clear random write targets for Shader Model 4.5 level pixel shaders.

ConvertTexture

This function provides an e cient way to convert between textures of di erent formats and dimensions. The destination texture format

CopyTexture

Copy texture contents.

CreateGPUFence

Creates a GPUFence which will be passed after the last Blit, Clear, Draw, Dispatch or Texture Copy command prior to this call has been co

DrawMesh

Draw a mesh.

DrawMeshInstanced

Draw the same mesh multiple times using GPU instancing.

DrawMeshInstancedIndirect

Draw the same mesh multiple times using GPU instancing.

DrawMeshNow

Draw a mesh immediately.

DrawProcedural

Draws a fully procedural geometry on the GPU.

DrawProceduralIndirect

Draws a fully procedural geometry on the GPU.

DrawTexture

Draw a texture in screen coordinates.

ExecuteCommandBu er

Execute a command bu er.

ExecuteCommandBu erAsync

Executes a command bu er on an async compute queue with the queue selected based on the ComputeQueueType parameter passed.
execution:CommandBu er.BeginSampleCommandBu er.CopyCounterValueCommandBu er.CopyTextureCommandBu er.CreateGPUF
of the commands within the bu er are guaranteed to be executed on the same queue. If the target platform does not support async com

SetRandomWriteTarget

Set random write target for Shader Model 4.5 level pixel shaders.

SetRenderTarget

Sets current render target.

WaitOnGPUFence

Instructs the GPU's processing of the graphics queue to wait until the given GPUFence is passed.

Leave feedback

Description
Grid is the base class for plotting a layout of uniformly spaced points and lines.
The Grid component stores dimensional data of the layout of the grid and provides helper functions to retrieve
information about the grid, such as the conversion between the cell location and local space location of items
within the grid.
The layout of the Grid component is in the XY plane with the origin of the grid always beginning at (0, 0) and the X
and Y coordinates of the grid only as positive values.
Implements the interface GridLayout.

Properties
cellGap

The size of the gap between each cell in the Grid.

cellLayout

The layout of the cells in the Grid.

cellSize

The size of each cell in the Grid.

cellSwizzle

The cell swizzle for the Grid.

Public Methods
GetCellCenterLocal

Get the logical center coordinate of a grid cell in local space.

GetCellCenterWorld

Get the logical center coordinate of a grid cell in world space.

Static Methods
InverseSwizzle

Does the inverse swizzle of the given position for given swizzle order.

Swizzle

Swizzles the given position with the given swizzle order.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a

game object.
tag

The tag of this game object.

transform

The Transform attached to this GameObject.

cellGap

The size of the gap between each cell in the layout.

cellLayout

The layout of the cells.

cellSize

The size of each cell in the layout.

cellSwizzle

The cell swizzle for the layout.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

CellToLocal

Converts a cell position to local position space.

CellToLocalInterpolated

Converts an interpolated cell position in oats to local position space.

CellToWorld

Converts a cell position to world position space.

GetBoundsLocal

Returns the local bounds for a cell at the location.

GetLayoutCellCenter

Get the default center coordinate of a cell for the set layout of the Grid.

LocalToCell

Converts a local position to cell position.

LocalToCellInterpolated

Converts a local position to cell position.

LocalToWorld

Converts a local position to world position.

WorldToCell

Converts a world position to cell position.

WorldToLocal

Converts a world position to local position.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Base class for authoring data on a grid with grid painting tools like paint, erase, pick, select and ll.
Inheriting this class and/or creating brush asset instances from your inherited class, you can create custom
brushes which react to high level grid events like paint, erase, pick, select and ll.

using UnityEngine;

// Paints two Prefabs in checkerboard pattern
[CreateAssetMenu]
public class CheckerboardBrush : GridBrushBase
{
public GameObject prefabA;
public GameObject prefabB;

public override void Paint(GridLayout grid, GameObject brushTarget, Vector3I
{
bool evenCell = Mathf.Abs(position.y + position.x) % 2 > 0;
GameObject toBeInstantiated = evenCell ? prefabA : prefabB;

if (toBeInstantiated != null)
{
GameObject newInstance = Instantiate(toBeInstantiated, grid.CellToWo
newInstance.transform.SetParent(brushTarget.transform);
}
}
}

Public Methods
BoxErase

Erases data on a grid within the given bounds.

BoxFill

Box lls tiles and GameObjects into given bounds within the selected layers.

ChangeZPosition

Changes the Z position of the GridBrushBase.

Erase

Erases data on a grid within the given bounds.

Flip

Flips the grid brush in the given FlipAxis.

FloodFill

Flood lls data onto a grid given the starting coordinates of the cell.

Move

Move is called when user moves the area previously selected with the selection marquee.

MoveEnd

MoveEnd is called when user has ended the move of the area previously selected with the
selection marquee.

MoveStart

MoveEnd is called when user starts moving the area previously selected with the selection
marquee.

Paint

Paints data into a grid within the given bounds.

Pick

Picks data from a grid given the coordinates of the cells.

ResetZPosition

Resets Z position changes of the GridBrushBase.

Rotate

Rotates all tiles on the grid brush with the given RotationDirection.

Select

Select an area of a grid.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
Axis to ip tiles in the GridBrushBase by.

Properties
X

Flip the brush in the X Axis.

Y

Flip the brush in the Y Axis.

Leave feedback

Description
Rotate tiles in the GridBrushBase in this direction.

Properties
Clockwise

Rotates tiles clockwise.

CounterClockwise

Rotates tiles counter-clockwise.

Leave feedback

Description
Tool mode for the GridBrushBase.

Properties
Select

Select.

Move

Move.

Paint

Paint.

Box

Box Fill.

Pick

Pick.

Erase

Erase.

FloodFill

Flood Fill.

Leave feedback

Description
An abstract class that de nes a grid layout.
See Also: Grid & GridProxy.

Properties
cellGap

The size of the gap between each cell in the layout.

cellLayout

The layout of the cells.

cellSize

The size of each cell in the layout.

cellSwizzle

The cell swizzle for the layout.

Public Methods
CellToLocal

Converts a cell position to local position space.

CellToLocalInterpolated

Converts an interpolated cell position in oats to local position space.

CellToWorld

Converts a cell position to world position space.

GetBoundsLocal

Returns the local bounds for a cell at the location.

GetLayoutCellCenter

Get the default center coordinate of a cell for the set layout of the Grid.

LocalToCell

Converts a local position to cell position.

LocalToCellInterpolated

Converts a local position to cell position.

LocalToWorld

Converts a local position to world position.

WorldToCell

Converts a world position to cell position.

WorldToLocal

Converts a world position to local position.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a

game object.
tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The layout of the GridLayout.
The layout determines the conversion of positions from cell space to local space and vice versa.

Properties
Rectangle

Rectangular layout for cells in the GridLayout.

Hexagon

Hexagonal layout for cells in the GridLayout.

Isometric

Isometric layout for cells in the GridLayout.

IsometricZAsY

Isometric layout for cells in the GridLayout where any Z cell value set will be added as a Y
value.

Leave feedback

Description
Swizzles cell positions to other positions.

Properties
XYZ

Keeps the cell positions at XYZ.

XZY

Swizzles the cell positions from XYZ to XZY.

YXZ

Swizzles the cell positions from XYZ to YXZ.

YZX

Swizzles the cell positions from XYZ to YZX.

ZXY

Swizzles the cell positions from XYZ to ZXY.

ZYX

Swizzles the cell positions from XYZ to ZYX.

Leave feedback

Description
The GUI class is the interface for Unity's GUI with manual positioning.

See Also: GUI tutorial.

Static Properties
backgroundColor

Global tinting color for all background elements rendered by the GUI.

changed

Returns true if any controls changed the value of the input data.

color

Global tinting color for the GUI.

contentColor

Tinting color for all text rendered by the GUI.

depth

The sorting depth of the currently executing GUI behaviour.

enabled

Is the GUI enabled?

matrix

The GUI transform matrix.

skin

The global skin to use.

tooltip

The tooltip of the control the mouse is currently over, or which has keyboard focus. (Read
Only).

Static Methods
BeginGroup

Begin a group. Must be matched with a call to EndGroup.

BeginScrollView

Begin a scrolling view inside your GUI.

Box

Create a Box on the GUI Layer.

BringWindowToBack

Bring a speci c window to back of the oating windows.

BringWindowToFront

Bring a speci c window to front of the oating windows.

Button

Make a single press button. The user clicks them and something happens
immediately.

DragWindow

Make a window draggable.

DrawTexture

Draw a texture within a rectangle.

DrawTextureWithTexCoords

Draw a texture within a rectangle with the given texture coordinates.

EndGroup

End a group.

EndScrollView

Ends a scrollview started with a call to BeginScrollView.

FocusControl

Move keyboard focus to a named control.

FocusWindow

Make a window become the active window.

GetNameOfFocusedControl

Get the name of named control that has focus.

HorizontalScrollbar

Make a horizontal scrollbar. Scrollbars are what you use to scroll through a
document. Most likely, you want to use scrollViews instead.

HorizontalSlider

A horizontal slider the user can drag to change a value between a min and a
max.

Label

Make a text or texture label on screen.

ModalWindow

Show a Modal Window.

PasswordField

Make a text eld where the user can enter a password.

RepeatButton

Make a button that is active as long as the user holds it down.

ScrollTo

Scrolls all enclosing scrollviews so they try to make position visible.

SelectionGrid

Make a grid of buttons.

SetNextControlName

Set the name of the next control.

TextArea

Make a Multi-line text area where the user can edit a string.

TextField

Make a single-line text eld where the user can edit a string.

Toggle

Make an on/o toggle button.

Toolbar

Make a toolbar.

UnfocusWindow

Remove focus from all windows.

VerticalScrollbar

Make a vertical scrollbar. Scrollbars are what you use to scroll through a
document. Most likely, you want to use scrollViews instead.

VerticalSlider

A vertical slider the user can drag to change a value between a min and a max.

Window

Make a popup window.

Delegates
WindowFunction

Callback to draw GUI within a window (used with GUI.Window).

Leave feedback

Description
Disposable helper class for managing BeginGroup / EndGroup.
BeginGroup is called at construction, and EndGroup is called when the instance is disposed. When you begin a
group, the coordinate system for GUI controls are set so (0,0) is the top-left corner of the group. All controls are
clipped to the group. Groups can be nested - if they are, children are clipped to their parents.
This is very useful when moving a bunch of GUI elements around on screen. A common use case is designing your
menus to t on a speci c screen size, then centering the GUI on larger displays.

using UnityEngine;

public class Example : MonoBehaviour
{
void OnGUI()
{
// Constrain all drawing to be within a 800x600 pixel area centered on t
using (var groupScope = new GUI.GroupScope(new Rect(Screen.width / 2 - 4
{
// Draw a box in the new coordinate space defined by the BeginGroup.
// Notice how (0,0) has now been moved on-screen.
GUI.Box(new Rect(0, 0, 800, 600), "This box is now centered! - here
}
// The group is now ended.
}
}

Constructors
GUI.GroupScope

Create a new GroupScope and begin the corresponding group.

Leave feedback

Description
Disposable helper class for managing BeginScrollView / EndScrollView.
BeginScrollView is called at construction, and EndScrollView is called when the instance is disposed. ScrollViews
let you make a smaller area on-screen look 'into' a much larger area, using scrollbars placed on the sides of the
ScrollView.

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
// The position of the scrolling viewport
public Vector2 scrollPosition = Vector2.zero;
void OnGUI()
{
// An absolute-positioned example: We make a scrollview that has a reall
// rect and put it in a small rect on the screen.
using (var scrollScope = new GUI.ScrollViewScope(new Rect(10, 300, 100,
{
scrollPosition = scrollScope.scrollPosition;

// Make four buttons - one in each corner. The coordinate system is
// by the last parameter to the ScrollScope constructor.
GUI.Button(new Rect(0, 0, 100, 20), "Top-left");
GUI.Button(new Rect(120, 0, 100, 20), "Top-right");
GUI.Button(new Rect(0, 180, 100, 20), "Bottom-left");
GUI.Button(new Rect(120, 180, 100, 20), "Bottom-right");
}
// Now the scroll view is ended.
}
}

Properties
handleScrollWheel

Whether this ScrollView should handle scroll wheel events. (default: true).

scrollPosition

The modi ed scrollPosition. Feed this back into the variable you pass in, as shown in the
example.

Constructors
GUI.ScrollViewScope

Create a new ScrollViewScope and begin the corresponding ScrollView.

Leave feedback

Description
Determines how toolbar button size is calculated.

Properties
Fixed

Calculates the button size by dividing the available width by the number of buttons. The
minimum size is the maximum content width.

FitToContents

The width of each toolbar button is calculated based on the width of its content.

Leave feedback

Description
The contents of a GUI element.
This works closely in relation with GUIStyle. GUIContent de nes what to render and GUIStyle de nes how to
render it.
See Also: GUIStyle.

Static Properties
none

Shorthand for empty content.

Properties
image

The icon image contained.

text

The text contained.

tooltip

The tooltip of this element.

Constructors
GUIContent

Constructor for GUIContent in all shapes and sizes.

Leave feedback

Description
Base class for images & text strings displayed in a GUI.
This class holds the base functionality for any GUI elements.

Public Methods
GetScreenRect

Returns bounding rectangle of GUIElement in screen coordinates.

HitTest

Is a point on screen inside the element?

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Obsolete

Description
Component added to a camera to make it render 2D GUI elements.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The GUILayout class is the interface for Unity gui with automatic layout.

See Also: GUI Layout tutorial.

Static Methods
BeginArea

Begin a GUILayout block of GUI controls in a xed screen area.

BeginHorizontal

Begin a Horizontal control group.

BeginScrollView

Begin an automatically laid out scrollview.

BeginVertical

Begin a vertical control group.

Box

Make an auto-layout box.

Button

Make a single press button.

EndArea

Close a GUILayout block started with BeginArea.

EndHorizontal

Close a group started with BeginHorizontal.

EndScrollView

End a scroll view begun with a call to BeginScrollView.

EndVertical

Close a group started with BeginVertical.

ExpandHeight

Option passed to a control to allow or disallow vertical expansion.

ExpandWidth

Option passed to a control to allow or disallow horizontal expansion.

FlexibleSpace

Insert a exible space element.

Height

Option passed to a control to give it an absolute height.

HorizontalScrollbar

Make a horizontal scrollbar.

HorizontalSlider

A horizontal slider the user can drag to change a value between a min and a max.

Label

Make an auto-layout label.

MaxHeight

Option passed to a control to specify a maximum height.

MaxWidth

Option passed to a control to specify a maximum width.

MinHeight

Option passed to a control to specify a minimum height.

MinWidth

Option passed to a control to specify a minimum width.

PasswordField

Make a text eld where the user can enter a password.

RepeatButton

Make a repeating button. The button returns true as long as the user holds down the
mouse.

SelectionGrid

Make a Selection Grid.

Space

Insert a space in the current layout group.

TextArea

Make a multi-line text eld where the user can edit a string.

TextField

Make a single-line text eld where the user can edit a string.

Toggle

Make an on/o toggle button.

Toolbar

Make a toolbar.

VerticalScrollbar

Make a vertical scrollbar.

VerticalSlider

A vertical slider the user can drag to change a value between a min and a max.

Width

Option passed to a control to give it an absolute width.

Window

Make a popup window that layouts its contents automatically.

Leave feedback

Description
Disposable helper class for managing BeginArea / EndArea.
BeginArea is called at construction, and EndArea is called when the instance is disposed. By default, any GUI
controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of
automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to de ne a new area for the
automatic layouting system to use.
See Also: BeginArea, EndArea

Explained Area of the example.

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
void OnGUI()
{
using (var areaScope = new GUILayout.AreaScope(new Rect(10, 10, 100, 100
{
GUILayout.Button("Click me");
GUILayout.Button("Or me");
}
}
}

Constructors

GUILayout.AreaScope

Create a new AreaScope and begin the corresponding Area.

Leave feedback

Description
Disposable helper class for managing BeginHorizontal / EndHorizontal.
All controls rendered inside this element will be placed horizontally next to each other. The using statement
means BeginHorizontal and EndHorizontal are not needed.

Horizontal Layout.

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
void OnGUI()
{
// Starts a horizontal group
using (var horizontalScope = new GUILayout.HorizontalScope("box"))
{
GUILayout.Button("I'm the first button");
GUILayout.Button("I'm to the right");
}
// Now the group is ended.
}
}

Constructors
GUILayout.HorizontalScope

Create a new HorizontalScope and begin the corresponding horizontal group.

Leave feedback

Description
Disposable helper class for managing BeginScrollView / EndScrollView.
Automatically laid out scrollviews will take whatever content you have inside them and display normally. If it
doesn't t, scrollbars will appear. A call to BeginScrollView must always be matched with a call to EndScrollView.

Scroll View in the Game View..

using UnityEngine;
using UnityEditor;
public class ExampleClass : MonoBehaviour
{
// The variable to control where the scrollview 'looks' into its child eleme
public Vector2 scrollPosition;

// The string to display inside the scrollview. 2 buttons below add & clear
public string longString = "This is a long-ish string";

void OnGUI()
{
// Begin a scroll view. All rects are calculated automatically // it will use up any available screen space and make sure contents flow
// This is kept small with the last two parameters to force scrollbars t
using (var scrollViewScope = new ScrollViewScope(scrollPosition, GUILayo
{
scrollPosition = scrollViewScope.scrollPosition;

// We just add a single label to go inside the scroll view. Note how
// scrollbars will work correctly with wordwrap.
GUILayout.Label(longString);

//
//
//
if

Add a button to clear the string. This is inside the scroll area,
will be scrolled as well. Note how the button becomes narrower to
for the vertical scrollbar
(GUILayout.Button("Clear"))
longString = "";

}

// Now we add a button outside the scrollview - this will be shown below
// the scrolling area.
if (GUILayout.Button("Add More Text"))
longString += "\nHere is another line";
}
}

Properties
handleScrollWheel

Whether this ScrollView should handle scroll wheel events. (default: true).

scrollPosition

The modi ed scrollPosition. Feed this back into the variable you pass in, as shown in the
example.

Constructors
GUILayout.ScrollViewScope

Create a new ScrollViewScope and begin the corresponding ScrollView.

Leave feedback

Description
Disposable helper class for managing BeginVertical / EndVertical.
All controls rendered inside this element will be placed vertically below each other. The group must be closed
with a call to EndVertical.

Vertical Layout.

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
void OnGUI()
{
// Starts a vertical group
using (var verticalScope = new VerticalScope("box"))
{
GUILayout.Button("I'm the top button");
GUILayout.Button("I'm the bottom button");
}
// The group is now ended
}
}

Constructors
GUILayout.VerticalScope

Create a new VerticalScope and begin the corresponding vertical group.

Leave feedback

Description
Class internally used to pass layout options into GUILayout functions. You don't use these directly, but construct
them with the layouting functions in the GUILayout class.
See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight,
GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

Leave feedback

Description
Utility functions for implementing and extending the GUILayout class.
Use this class to make your own GUI layouting code.

Static Methods
GetAspectRect

Reserve layout space for a rectangle with a speci c aspect ratio.

GetLastRect

Get the rectangle last used by GUILayout for a control.

GetRect

Reserve layout space for a rectangle for displaying some contents with a speci c style.

Leave feedback

Description
General settings for how the GUI behaves.
These are shared by all elements in a GUISkin.

Properties
cursorColor

The color of the cursor in text elds.

cursorFlashSpeed

The speed of text eld cursor ashes.

doubleClickSelectsWord

Should double-clicking select words in text elds.

selectionColor

The color of the selection rect in text elds.

tripleClickSelectsLine

Should triple-clicking select whole text in text elds.

Leave feedback
SWITCH TO MANUAL

Description
De nes how GUI looks and behaves.
GUISkin contains GUI settings and a collection of GUIStyle objects that together specify GUI skin.
Active GUI skin is get and set through GUI.skin.

Properties
box

Style used by default for GUI.Box controls.

button

Style used by default for GUI.Button controls.

customStyles

Array of GUI styles for speci c needs.

font

The default font to use for all styles.

horizontalScrollbar

Style used by default for the background part of GUI.HorizontalScrollbar
controls.

horizontalScrollbarLeftButton

Style used by default for the left button on GUI.HorizontalScrollbar controls.

horizontalScrollbarRightButton

Style used by default for the right button on GUI.HorizontalScrollbar
controls.

horizontalScrollbarThumb

Style used by default for the thumb that is dragged in
GUI.HorizontalScrollbar controls.

horizontalSlider

Style used by default for the background part of GUI.HorizontalSlider
controls.

horizontalSliderThumb

Style used by default for the thumb that is dragged in GUI.HorizontalSlider
controls.

label

Style used by default for GUI.Label controls.

scrollView

Style used by default for the background of ScrollView controls (see
GUI.BeginScrollView).

settings

Generic settings for how controls should behave with this skin.

textArea

Style used by default for GUI.TextArea controls.

textField

Style used by default for GUI.TextField controls.

toggle

Style used by default for GUI.Toggle controls.

verticalScrollbar

Style used by default for the background part of GUI.VerticalScrollbar
controls.

verticalScrollbarDownButton

Style used by default for the down button on GUI.VerticalScrollbar controls.

verticalScrollbarThumb

Style used by default for the thumb that is dragged in GUI.VerticalScrollbar
controls.

verticalScrollbarUpButton

Style used by default for the up button on GUI.VerticalScrollbar controls.

verticalSlider

Style used by default for the background part of GUI.VerticalSlider controls.

verticalSliderThumb

Style used by default for the thumb that is dragged in GUI.VerticalSlider
controls.

window

Style used by default for Window controls (SA GUI.Window).

Public Methods
FindStyle

Try to search for a GUIStyle. This functions returns NULL and does not give an error.

GetStyle

Get a named GUIStyle.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback
SWITCH TO MANUAL

Description
Styling information for GUI elements.
Most GUI functions accept an optional GUIStyle parameter to override the default style. This allows coloring, fonts
and other details to be changed and switched for di erent states (eg, when the mouse is hovering over the
control). Where a consistent look-and-feel is required over a whole GUI design, the GUISkin class is a useful way to
collect a set of GUIStyle settings and apply them all at once.

Static Properties
none

Shortcut for an empty GUIStyle.

Properties
active

Rendering settings for when the control is pressed down.

alignment

Text alignment.

border

The borders of all background images.

clipping

What to do when the contents to be rendered is too large to t within the area given.

contentO set

Pixel o set to apply to the content of this GUIstyle.

xedHeight

If non-0, any GUI elements rendered with this style will have the height speci ed here.

xedWidth

If non-0, any GUI elements rendered with this style will have the width speci ed here.

focused

Rendering settings for when the element has keyboard focus.

font

The font to use for rendering. If null, the default font for the current GUISkin is used
instead.

fontSize

The font size to use (for dynamic fonts).

fontStyle

The font style to use (for dynamic fonts).

hover

Rendering settings for when the mouse is hovering over the control.

imagePosition

How image and text of the GUIContent is combined.

lineHeight

The height of one line of text with this style, measured in pixels. (Read Only)

margin

The margins between elements rendered in this style and any other GUI elements.

name

The name of this GUIStyle. Used for getting them based on name.

normal

Rendering settings for when the component is displayed normally.

onActive

Rendering settings for when the element is turned on and pressed down.

onFocused

Rendering settings for when the element has keyboard and is turned on.

onHover

Rendering settings for when the control is turned on and the mouse is hovering it.

onNormal

Rendering settings for when the control is turned on.

over ow

Extra space to be added to the background image.

padding

Space from the edge of GUIStyle to the start of the contents.

richText

Enable HTML-style tags for Text Formatting Markup.

stretchHeight

Can GUI elements of this style be stretched vertically for better layout?

stretchWidth

Can GUI elements of this style be stretched horizontally for better layouting?

wordWrap

Should the text be wordwrapped?

Constructors
GUIStyle

Constructor for empty GUIStyle.

Public Methods
CalcHeight

How tall this element will be when rendered with content and a speci c width.

CalcMinMaxWidth

Calculate the minimum and maximum widths for this style rendered with content.

CalcScreenSize

Calculate the size of an element formatted with this style, and a given space to
content.

CalcSize

Calculate the size of some content if it is rendered with this style.

Draw

Draw this GUIStyle on to the screen, internal version.

DrawCursor

Draw this GUIStyle with selected content.

DrawWithTextSelection

Draw this GUIStyle with selected content.

GetCursorPixelPosition

Get the pixel position of a given string index.

GetCursorStringIndex

Get the cursor position (indexing into contents.text) when the user clicked at
cursorPixelPosition.

Operators
GUIStyle

Get a named GUI style from the current skin.

Leave feedback

Description
Specialized values for the given states used by GUIStyle objects.
The GUIStyle contains all values for displaying GUI elements.

Properties
background

The background image used by GUI elements in this given state.

scaledBackgrounds

Background images used by this state when on a high-resolution screen. It should either
be left empty, or contain a single image that is exactly twice the resolution of
background. This is only used by the editor. The eld is not copied to player data, and is
not accessible from player code.

textColor

The text color used by GUI elements in this state.

Leave feedback
SWITCH TO MANUAL

Obsolete

Description
A text string displayed in a GUI.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetScreenRect

Returns bounding rectangle of GUIElement in screen coordinates.

HitTest

Is a point on screen inside the element?

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Obsolete

Description
A texture image used in a 2D GUI.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetScreenRect

Returns bounding rectangle of GUIElement in screen coordinates.

HitTest

Is a point on screen inside the element?

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Utility class for making new GUI controls.
Unless you are creating your own GUI controls from scratch, you should not use these functions.

Static Properties
hasModalWindow

A global property, which is true if a ModalWindow is being displayed, false otherwise.

hotControl

The controlID of the current hot control.

keyboardControl

The controlID of the control that has keyboard focus.

systemCopyBu er

Get access to the system-wide clipboard.

Static Methods
AlignRectToDevice

Align a local space rectangle to the pixel grid.

ExitGUI

Puts the GUI in a state that will prevent all subsequent immediate mode GUI functions
from evaluating for the remainder of the GUI loop by throwing an ExitGUIException.

GetControlID

Get a unique ID for a control.

GetStateObject

Get a state object from a controlID.

GUIToScreenPoint

Convert a point from GUI position to screen space.

QueryStateObject

Get an existing state object from a controlID.

RotateAroundPivot

Helper function to rotate the GUI around a point.

ScaleAroundPivot

Helper function to scale the GUI around a point.

ScreenToGUIPoint

Convert a point from screen space to GUI position.

Leave feedback

Description
Interface into the Gyroscope.
Use this class to access the gyroscope. The example script below shows how the Gyroscope class can be used to
view the orientation in space of the device.
Underlying sensors used for data population:
Android: Gravity, Linear Acceleration, Rotation Vector. More information.
iOS: Gyroscope, Device-Motion. More information.

// Create a cube with camera vector names on the faces.
// Allow the device to show named faces as it is oriented.

using UnityEngine;

public class ExampleScript : MonoBehaviour
{
// Faces for 6 sides of the cube
private GameObject[] quads = new GameObject[6];

// Textures for each quad, should be +X, +Y etc
// with appropriate colors, red, green, blue, etc
public Texture[] labels;

void Start()
{
// make camera solid colour and based at the origin
GetComponent().backgroundColor = new Color(49.0f / 255.0f, 77.0f
GetComponent().transform.position = new Vector3(0, 0, 0);
GetComponent().clearFlags = CameraClearFlags.SolidColor;

// create the six quads forming the sides of a cube
GameObject quad = GameObject.CreatePrimitive(PrimitiveType.Quad);

quads[0] = createQuad(quad,
new Color(0.90f, 0.10f,
quads[1] = createQuad(quad,
new Color(0.10f, 0.90f,
quads[2] = createQuad(quad,
new Color(0.10f, 0.10f,
quads[3] = createQuad(quad,
new Color(0.90f, 0.50f,
quads[4] = createQuad(quad,
new Color(0.50f, 0.90f,
quads[5] = createQuad(quad,
new Color(0.50f, 0.50f,

new Vector3(1,
0,
0), new Vector3(0, 90
0.10f, 1), labels[0]);
new Vector3(0,
1,
0), new Vector3(-90,
0.10f, 1), labels[1]);
new Vector3(0,
0,
1), new Vector3(0,
0
0.90f, 1), labels[2]);
new Vector3(-1,
0,
0), new Vector3(0, -9
0.50f, 1), labels[3]);
new Vector3(0, -1, 0), new Vector3(90,
0
0.50f, 1), labels[4]);
new Vector3(0,
0, -1), new Vector3(0, 180,
0.90f, 1), labels[5]);

GameObject.Destroy(quad);
}

// make a quad for one side of the cube
GameObject createQuad(GameObject quad, Vector3 pos, Vector3 rot, string name
{
Quaternion quat = Quaternion.Euler(rot);
GameObject GO = Instantiate(quad, pos, quat);
GO.name = name;
GO.GetComponent().material.color = col;
GO.GetComponent().material.mainTexture = t;
GO.transform.localScale += new Vector3(0.25f, 0.25f, 0.25f);
return GO;
}

protected void Update()
{
GyroModifyCamera();
}

protected void OnGUI()
{
GUI.skin.label.fontSize = Screen.width / 40;

GUILayout.Label("Orientation: " + Screen.orientation);
GUILayout.Label("input.gyro.attitude: " + Input.gyro.attitude);
GUILayout.Label("iphone width/font: " + Screen.width + " : " + GUI.skin.
}

/********************************************/

// The Gyroscope is right-handed. Unity is left handed.
// Make the necessary change to the camera.
void GyroModifyCamera()
{
transform.rotation = GyroToUnity(Input.gyro.attitude);
}

private static Quaternion GyroToUnity(Quaternion q)
{
return new Quaternion(q.x, q.y, -q.z, -q.w);
}
}

iOS Screen-shot showing +Z, +Y and -X.

Properties
attitude

Returns the attitude (ie, orientation in space) of the device.

enabled

Sets or retrieves the enabled status of this gyroscope.

gravity

Returns the gravity acceleration vector expressed in the device's reference frame.

rotationRate

Returns rotation rate as measured by the device's gyroscope.

rotationRateUnbiased

Returns unbiased rotation rate as measured by the device's gyroscope.

updateInterval

Sets or retrieves gyroscope interval in seconds.

userAcceleration

Returns the acceleration that the user is giving to the device.

Leave feedback

Description
Interface into functionality unique to handheld devices.

Static Methods
GetActivityIndicatorStyle

Gets the current activity indicator style.

PlayFullScreenMovie

Plays a full-screen movie.

SetActivityIndicatorStyle

Sets the desired activity indicator style.

StartActivityIndicator

Starts os activity indicator.

StopActivityIndicator

Stops os activity indicator.

Vibrate

Triggers device vibration.

Leave feedback

Description
Represent the hash value.

Properties
isValid

Get if the hash value is valid or not. (Read Only)

Constructors
Hash128

Construct the Hash128.

Public Methods
ToString

Convert Hash128 to string.

Static Methods
Compute

Compute a hash of the input string.

Parse

Convert the input string to Hash128.

Leave feedback
SWITCH TO MANUAL

Description
The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge.
This joint is great for, well, doors, but can also be used to model chains, etc...
The HingeJoint has a motor which can be used to make the hinge spin around the joints axis. A spring which
attempts to reach for a target angle by spinning around the joints axis. And a limit which constrains the joint
angle.

Properties
angle

The current angle in degrees of the joint relative to its rest position. (Read Only)

limits

Limit of angular rotation (in degrees) on the hinge joint.

motor

The motor will apply a force up to a maximum force to achieve the target velocity in
degrees per second.

spring

The spring attempts to reach a target angle by adding spring and damping forces.

useLimits

Enables the joint's limits. Disabled by default.

useMotor

Enables the joint's motor. Disabled by default.

useSpring

Enables the joint's spring. Disabled by default.

velocity

The angular velocity of the joint in degrees per second. (Read Only)

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game

object and on every ancestor of the behaviour.
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Leave feedback
SWITCH TO MANUAL

Description
Joint that allows a Rigidbody2D object to rotate around a point in space or a point on another object.
See Also: DistanceJoint2D, SliderJoint2D, SpringJoint2D, JointAngleLimits2D.

Properties
jointAngle

The current joint angle (in degrees) with respect to the reference angle.

jointSpeed

The current joint speed.

limits

Limit of angular rotation (in degrees) on the joint.

limitState

Gets the state of the joint limit.

motor

Parameters for the motor force applied to the joint.

referenceAngle

The angle (in degrees) referenced between the two bodies used as the constraint for the
joint.

useLimits

Should limits be placed on the range of rotation?

useMotor

Should the joint be rotated automatically by a motor torque?

Public Methods
GetMotorTorque

Gets the motor torque of the joint given the speci ed timestep.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always

attached to a game object.
tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game

object and on every ancestor of the behaviour.
GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback
Obsolete

Description
This is the data structure for holding individual host information.
The host list retreived from a master server uses this class to represent individual hosts.

Leave feedback

Description
The mapping between a bone in the model and the conceptual bone in the Mecanim human anatomy.
The names of the Mecanim human bone and the bone in the model are stored along with the limiting muscle
values that constrain the bone's rotation during animation.

using UnityEngine;
using System.Collections.Generic;

public class ExampleClass : MonoBehaviour
{
void Start()
{
Dictionary boneName = new System.Collections.Generic.Dic
boneName["Chest"] = "Bip001 Spine2";
boneName["Head"] = "Bip001 Head";
boneName["Hips"] = "Bip001 Pelvis";
boneName["LeftFoot"] = "Bip001 L Foot";
boneName["LeftHand"] = "Bip001 L Hand";
boneName["LeftLowerArm"] = "Bip001 L Forearm";
boneName["LeftLowerLeg"] = "Bip001 L Calf";
boneName["LeftShoulder"] = "Bip001 L Clavicle";
boneName["LeftUpperArm"] = "Bip001 L UpperArm";
boneName["LeftUpperLeg"] = "Bip001 L Thigh";
boneName["RightFoot"] = "Bip001 R Foot";
boneName["RightHand"] = "Bip001 R Hand";
boneName["RightLowerArm"] = "Bip001 R Forearm";
boneName["RightLowerLeg"] = "Bip001 R Calf";
boneName["RightShoulder"] = "Bip001 R Clavicle";
boneName["RightUpperArm"] = "Bip001 R UpperArm";
boneName["RightUpperLeg"] = "Bip001 R Thigh";
boneName["Spine"] = "Bip001 Spine1";
string[] humanName = HumanTrait.BoneName;
HumanBone[] humanBones = new HumanBone[boneName.Count];
int j = 0;
int i = 0;
while (i < humanName.Length)
{
if (boneName.ContainsKey(humanName[i]))
{
HumanBone humanBone = new HumanBone();

humanBone.humanName = humanName[i];
humanBone.boneName = boneName[humanName[i]];
humanBone.limit.useDefaultValues = true;
humanBones[j++] = humanBone;
}
i++;
}
}
}

See Also: HumanDescription, AvatarBuilder.

Properties
boneName

The name of the bone to which the Mecanim human bone is mapped.

humanName

The name of the Mecanim human bone to which the bone from the model is mapped.

limit

The rotation limits that de ne the muscle for this bone.

Leave feedback

Description
Class that holds humanoid avatar parameters to pass to the AvatarBuilder.BuildHumanAvatar function.

Properties
armStretch

Amount by which the arm's length is allowed to stretch when using IK.

feetSpacing

Modi cation to the minimum distance between the feet of a humanoid model.

hasTranslationDoF

True for any human that has a translation Degree of Freedom (DoF). It is set to false by
default.

human

Mapping between Mecanim bone names and bone names in the rig.

legStretch

Amount by which the leg's length is allowed to stretch when using IK.

lowerArmTwist

De nes how the lower arm's roll/twisting is distributed between the elbow and wrist
joints.

lowerLegTwist

De nes how the lower leg's roll/twisting is distributed between the knee and ankle.

skeleton

List of bone Transforms to include in the model.

upperArmTwist

De nes how the upper arm's roll/twisting is distributed between the shoulder and elbow
joints.

upperLegTwist

De nes how the upper leg's roll/twisting is distributed between the thigh and knee
joints.

Leave feedback

Description
This class stores the rotation limits that de ne the muscle for a single human bone.

Properties
axisLength

Length of the bone to which the limit is applied.

center

The default orientation of a bone when no muscle action is applied.

max

The maximum rotation away from the initial value that this muscle can apply.

min

The maximum negative rotation away from the initial value that this muscle can apply.

useDefaultValues

Should this limit use the default values?

Leave feedback

Description
Retargetable humanoid pose.
Represents a humanoid pose that is completely abstracted from any skeleton rig. See Also: HumanPoseHandler.

Properties
bodyPosition

The human body position for that pose.

bodyRotation

The human body orientation for that pose.

muscles

The array of muscle values for that pose.

Leave feedback

Description
A handler that lets you read or write a HumanPose from or to a humanoid avatar skeleton hierarchy.

Constructors
HumanPoseHandler

Creates a human pose handler from an avatar and a root transform.

Public Methods
GetHumanPose

Gets a human pose from the handled avatar skeleton.

SetHumanPose

Sets a human pose on the handled avatar skeleton.

Leave feedback

Description
Details of all the human bone and muscle types de ned by Mecanim.

Static Properties
BoneCount

The number of human bone types de ned by Mecanim.

BoneName

Array of the names of all human bone types de ned by Mecanim.

MuscleCount

The number of human muscle types de ned by Mecanim.

MuscleName

Array of the names of all human muscle types de ned by Mecanim.

RequiredBoneCount

The number of bone types that are required by Mecanim for any human model.

Static Methods
BoneFromMuscle

Return the bone to which a particular muscle is connected.

GetBoneDefaultHierarchyMass

Gets the bone hierarchy mass.

GetMuscleDefaultMax

Get the default maximum value of rotation for a muscle in degrees.

GetMuscleDefaultMin

Get the default minimum value of rotation for a muscle in degrees.

GetParentBone

Returns parent humanoid bone index of a bone.

MuscleFromBone

Obtain the muscle index for a particular bone index and "degree of
freedom".

RequiredBone

Is the bone a member of the minimal set of bones that Mecanim requires
for a human model?

Leave feedback

Description
This class provides utility and extension methods to convert image data from or to PNG, EXR, TGA, and JPEG
formats.

Static Methods
EncodeToEXR

Encodes this texture into the EXR format.

EncodeToJPG

Encodes this texture into JPG format.

EncodeToPNG

Encodes this texture into PNG format.

EncodeToTGA

Encodes the speci ed texture in TGA format.

LoadImage

Loads PNG/JPG image byte array into a texture.

Leave feedback

Description
Interface into the Input system.
Use this class to read the axes set up in the Conventional Game Input, and to access multi-touch/accelerometer
data on mobile devices.
To read an axis use Input.GetAxis with one of the following default axes: "Horizontal" and "Vertical" are mapped
to joystick, A, W, S, D and the arrow keys. "Mouse X" and "Mouse Y" are mapped to the mouse delta. "Fire1", "Fire2"
"Fire3" are mapped to Ctrl, Alt, Cmd keys and three mouse or joystick buttons. New input axes can be added.
See Input Manager for this.
If you are using input for any kind of movement behaviour use Input.GetAxis. It gives you smoothed and
con gurable input that can be mapped to keyboard, joystick or mouse. Use Input.GetButton for action like events
only. Do not use it for movement. Input.GetAxis will make the script code more small and simple.
Note also that the Input ags are not reset until Update. It is suggested you make all the Input calls in the Update
Loop.
See Also: KeyCode which lists all of the key press, mouse and joystick options.
Mobile Devices:
iOS and Android devices are capable of tracking multiple ngers touching the screen simultaneously. You can
access data on the status of each nger touching screen during the last frame by accessing the Input.touches
property array.
As a device moves, its accelerometer hardware reports linear acceleration changes along the three primary axes
in three-dimensional space. You can use this data to detect both the current orientation of the device (relative to
the ground) and any immediate changes to that orientation.
Acceleration along each axis is reported directly by the hardware as G-force values. A value of 1.0 represents a
load of about +1g along a given axis while a value of -1.0 represents -1g. If you hold the device upright (with the
home button at the bottom) in front of you, the X axis is positive along the right, the Y axis is positive directly up,
and the Z axis is positive pointing toward you.
You can read the Input.acceleration property to get the accelerometer reading. You can also use the
Input.deviceOrientation property to get a discrete evaluation of the device's orientation in three-dimensional
space. Detecting a change in orientation can be useful if you want to create game behaviors when the user
rotates the device to hold it di erently.
Note that the accelerometer hardware can be polled more than once per frame. To access all accelerometer
samples since the last frame, you can read the Input.accelerationEvents property array. This can be useful when

reconstructing player motions, feeding acceleration data into a predictor, or implementing other precise motion
analysis.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Debug.Log(Input.mousePosition);
}
}
}

This component relates to legacy methods for drawing UI textures and images to the screen. You should instead
use UI system. This is also unrelated to the IMGUI system.

Static Properties
acceleration

Last measured linear acceleration of a device in three-dimensional space.
(Read Only)

accelerationEventCount

Number of acceleration measurements which occurred during last frame.

accelerationEvents

Returns list of acceleration measurements which occurred during the last
frame. (Read Only) (Allocates temporary variables).

anyKey

Is any key or mouse button currently held down? (Read Only)

anyKeyDown

Returns true the rst frame the user hits any key or mouse button. (Read Only)

backButtonLeavesApp

Should Back button quit the application?Only usable on Android, Windows
Phone or Windows Tablets.

compass

Property for accessing compass (handheld devices only). (Read Only)

compensateSensors

This property controls if input sensors should be compensated for screen
orientation.

compositionCursorPos

The current text input position used by IMEs to open windows.

compositionString

The current IME composition string being typed by the user.

deviceOrientation

Device physical orientation as reported by OS. (Read Only)

gyro

Returns default gyroscope.

imeCompositionMode

Controls enabling and disabling of IME input composition.

imeIsSelected

Does the user have an IME keyboard input source selected?

inputString

Returns the keyboard input entered this frame. (Read Only)

location

Property for accessing device location (handheld devices only). (Read Only)

mousePosition

The current mouse position in pixel coordinates. (Read Only)

mousePresent

Indicates if a mouse device is detected.

mouseScrollDelta

The current mouse scroll delta. (Read Only)

multiTouchEnabled

Property indicating whether the system handles multiple touches.

simulateMouseWithTouches

Enables/Disables mouse simulation with touches. By default this option is
enabled.

stylusTouchSupported

Returns true when Stylus Touch is supported by a device or platform.

touchCount

Number of touches. Guaranteed not to change throughout the frame. (Read
Only)

touches

Returns list of objects representing status of all touches during last frame.
(Read Only) (Allocates temporary variables).

touchPressureSupported

Bool value which let's users check if touch pressure is supported.

touchSupported

Returns whether the device on which application is currently running supports
touch input.

Static Methods
GetAccelerationEvent

Returns speci c acceleration measurement which occurred during last frame. (Does
not allocate temporary variables).

GetAxis

Returns the value of the virtual axis identi ed by axisName.

GetAxisRaw

Returns the value of the virtual axis identi ed by axisName with no smoothing
ltering applied.

GetButton

Returns true while the virtual button identi ed by buttonName is held down.

GetButtonDown

Returns true during the frame the user pressed down the virtual button identi ed
by buttonName.

GetButtonUp

Returns true the rst frame the user releases the virtual button identi ed by
buttonName.

GetJoystickNames

Returns an array of strings describing the connected joysticks.

GetKey

Returns true while the user holds down the key identi ed by name.

GetKeyDown

Returns true during the frame the user starts pressing down the key identi ed by
name.

GetKeyUp

Returns true during the frame the user releases the key identi ed by name.

GetMouseButton

Returns whether the given mouse button is held down.

GetMouseButtonDown

Returns true during the frame the user pressed the given mouse button.

GetMouseButtonUp

Returns true during the frame the user releases the given mouse button.

GetTouch

Returns object representing status of a speci c touch. (Does not allocate temporary
variables).

IsJoystickPrecon gured

Determine whether a particular joystick model has been precon gured by Unity.
(Linux-only).

ResetInputAxes

Resets all input. After ResetInputAxes all axes return to 0 and all buttons return to 0
for one frame.

Leave feedback

Description
Joint is the base class for all joints.
See Also: CharacterJoint, HingeJoint, SpringJoint, FixedJoint, Con gurableJoint.

Properties
anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Parent class for joints to connect Rigidbody2D objects.
See Also: AnchoredJoint2D class.

Properties
attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie, the object
without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

Public Methods
GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Angular limits on the rotation of a Rigidbody2D object around a HingeJoint2D.
See Also: Rigidbody2D class, HingeJoint2D class.

Properties
max

Upper angular limit of rotation.

min

Lower angular limit of rotation.

Leave feedback

Description
How the joint's movement will behave along its local X axis.

Properties
maximumForce

Amount of force applied to push the object toward the de ned direction.

positionDamper

Resistance strength against the Position Spring. Only used if mode includes Position.

positionSpring

Strength of a rubber-band pull toward the de ned direction. Only used if mode includes
Position.

Leave feedback

Description
JointLimits is used by the HingeJoint to limit the joints angle.
See Also: HingeJoint.

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Set the hinge limits for a door.
HingeJoint hinge = GetComponent();

JointLimits limits = hinge.limits;
limits.min = 0;
limits.max = 90;
limits.bounciness = 0;
limits.bounceMinVelocity = 0;
hinge.limits = limits;
}
}

Properties
bounceMinVelocity

The minimum impact velocity which will cause the joint to bounce.

bounciness

Determines the size of the bounce when the joint hits it's limit. Also known as
restitution.

contactDistance

Distance inside the limit value at which the limit will be considered to be active by the
solver.

max

The upper angular limit (in degrees) of the joint.

min

The lower angular limit (in degrees) of the joint.

Leave feedback

Description
The JointMotor is used to motorize a joint.
For example the HingeJoint can be told to rotate at a given speed and force. The joint will then attempt to reach
the velocity with the given maximum force.
See Also: HingeJoint.

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
HingeJoint hinge = GetComponent();

// Make the hinge motor rotate with 90 degrees per second and a strong f
JointMotor motor = hinge.motor;
motor.force = 100;
motor.targetVelocity = 90;
motor.freeSpin = false;
hinge.motor = motor;
}
}

Properties
force

The motor will apply a force.

freeSpin

If freeSpin is enabled the motor will only accelerate but never slow down.

targetVelocity

The motor will apply a force up to force to achieve targetVelocity.

Leave feedback

Description
Parameters for the optional motor force applied to a Joint2D.
See Also: HingeJoint2D class, SliderJoint2D class.

Properties
maxMotorTorque

The maximum force that can be applied to the Rigidbody2D at the joint to attain the
target speed.

motorSpeed

The desired speed for the Rigidbody2D to reach as it moves with the joint.

Leave feedback

Description
JointSpring is used add a spring force to HingeJoint and PhysicMaterial.

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
HingeJoint hinge = GetComponent();

// Make the spring reach shoot for a 70 degree angle.
// This could be used to fire off a catapult.

JointSpring spring = hinge.spring;
spring.spring = 10;
spring.damper = 3;
spring.targetPosition = 70;
hinge.spring = spring;
}
}

Properties
damper

The damper force uses to dampen the spring.

spring

The spring forces used to reach the target position.

targetPosition

The target position the joint attempts to reach.

Leave feedback

Description
Joint suspension is used to de ne how suspension works on a WheelJoint2D.
See Also: WheelJoint2D class.

Properties
angle

The world angle (in degrees) along which the suspension will move.

dampingRatio

The amount by which the suspension spring force is reduced in proportion to the
movement speed.

frequency

The frequency at which the suspension spring oscillates.

Leave feedback

Description
Motion limits of a Rigidbody2D object along a SliderJoint2D.
See Also: Rigidbody2D class, SliderJoint2D class.

Properties
max

Maximum distance the Rigidbody2D object can move from the Slider Joint's anchor.

min

Minimum distance the Rigidbody2D object can move from the Slider Joint's anchor.

Leave feedback

Description
Utility functions for working with JSON data.

Static Methods
FromJson

Create an object from its JSON representation.

FromJsonOverwrite

Overwrite data in an object by reading from its JSON representation.

ToJson

Generate a JSON representation of the public elds of an object.

Leave feedback

Description
A single keyframe that can be injected into an animation curve.

Properties
inTangent

Sets the incoming tangent for this key. The incoming tangent a ects the slope of the curve
from the previous key to this key.

inWeight

Sets the incoming weight for this key. The incoming weight a ects the slope of the curve
from the previous key to this key.

outTangent

Sets the outgoing tangent for this key. The outgoing tangent a ects the slope of the curve
from this key to the next key.

outWeight

Sets the outgoing weight for this key. The outgoing weight a ects the slope of the curve
from this key to the next key.

time

The time of the keyframe.

value

The value of the curve at keyframe.

weightedMode

Weighted mode for the keyframe.

Constructors
Keyframe

Create a keyframe.

Leave feedback

Description
Speci es Layers to use in a Physics.Raycast.
A GameObject can use up to 32 LayerMasks supported by the Editor. The rst 8 of these Layers are speci ed by
Unity; the following 24 are controllable by the user.
Bitmasks represent the 32 Layers and de ne them as true or false. Each bitmask describes whether the Layer
is used. As an example, bit 5 can be set to 1 (true). This will allow the use of the built-in Water setting.
Edit­>Settings­>Tags and Layers option shows the use of the 32 bitmasks. Each Layer is shown with a
string setting. As an example Built­in Layer 0 is set as Default; Built­in Layer 1 is set as
TransparentFX. New named Layers are added above bitmask layer 8. A selected GameObject will show the
chosen Layer at top right of the Inspector. The example below has User Layer 13 set to "Wall". This causes the
assigned GameObject to be treated as part of a building.
In the following script example, Physics.Raycast sends a ray into the world. Camera.main can be rotated around
the y-axis and re a ray. Three GameObjects represent walls that can be hit by the red ray. Each GameObject has
GameObject.label set to the "Wall" layerMask.

using UnityEngine;

//
//
//
//
//
//
//
//
//
//

Fire a gun at 3 walls in the scene.
The Raycast will be aimed in the range of -45 to 45 degrees. If the Ray hits
walls true will be returned . The three walls all have a Wall Layer attached.
and right keys, and the space key, are all used to aim and fire.
Quad floor
ZCube wall
LCube wall
RCube wall

based at (0, -0.5, 0), rotated in x by 90 degrees, scale (8, 8, 8)
at (0, 0.5, 6), scale (3, 2, 0.5).
at (-3, 0, 3), scale (0.5, 1, 4).
at (3, 1.5, 3), scale (1, 4, 4).

public class ExampleScript : MonoBehaviour
{
private float cameraRotation;

void Start()
{

Camera.main.transform.position = new Vector3(0, 0.5f, 0);
cameraRotation = 0.0f;
}

// Rotate the camera based on what the user wants to look at.
// Avoid rotating more than +/-45 degrees.
void Update()
{
if (Input.GetKey("left"))
{
cameraRotation -= 1f;
if (cameraRotation < -45.0f)
{
cameraRotation = -45.0f;
}
}

if (Input.GetKey("right"))
{
cameraRotation += 1f;
if (cameraRotation > 45.0f)
{
cameraRotation = 45.0f;
}
}

// Rotate the camera
Camera.main.transform.localEulerAngles = new Vector3(0.0f, cameraRotatio
}

void FixedUpdate()
{
Transform transform = Camera.main.transform;

if (Input.GetKeyUp("space"))
{
// Check for a Wall.
LayerMask mask = LayerMask.GetMask("Wall");

// Check if a Wall is hit.

if (Physics.Raycast(transform.position, transform.forward, 20.0f, ma
{
Debug.Log("Fired and hit a wall");
}
}
}
}

Note: LayerMask is a bitmask. Use LayerMask.GetMask and LayerMask.LayerToName to generate the bitmask.

Properties
value

Converts a layer mask value to an integer value.

Static Methods
GetMask

Given a set of layer names as de ned by either a Builtin or a User Layer in the Tags and
Layers manager, returns the equivalent layer mask for all of them.

LayerToName

Given a layer number, returns the name of the layer as de ned in either a Builtin or a
User Layer in the Tags and Layers manager.

NameToLayer

Given a layer name, returns the layer index as de ned by either a Builtin or a User Layer
in the Tags and Layers manager.

Operators
LayerMask

Implicitly converts an integer to a LayerMask.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for a Lens are component.
This allows you to change the brightness and color of lens ares at runtime.

Properties
brightness

The strength of the are.

color

The color of the are.

fadeSpeed

The fade speed of the are.

are

The are asset to use.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for light components.
Use this to control all aspects of Unity's lights. The properties are an exact match for the values shown in the
Inspector.
Usually lights are just created in the editor but sometimes you want to create a light from a script:

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Make a game object
GameObject lightGameObject = new GameObject("The Light");

// Add the light component
Light lightComp = lightGameObject.AddComponent();

// Set color and position
lightComp.color = Color.blue;

// Set the position (or any transform property)
lightGameObject.transform.position = new Vector3(0, 5, 0);
}
}

Properties
areaSize

The size of the area light.

bakingOutput

This property describes the output of the last Global Illumination bake.

bounceIntensity

The multiplier that de nes the strength of the bounce lighting.

color

The color of the light.

colorTemperature

The color temperature of the light. Correlated Color Temperature (abbreviated as
CCT) is multiplied with the color lter when calculating the nal color of a light
source. The color temperature of the electromagnetic radiation emitted from an
ideal black body is de ned as its surface temperature in Kelvin. White is 6500K
according to the D65 standard. Candle light is 1800K. If you want to use
lightsUseCCT, lightsUseLinearIntensity has to be enabled to ensure physically
correct output. See Also: GraphicsSettings.lightsUseLinearIntensity,
GraphicsSettings.lightsUseCCT.

commandBu erCount

Number of command bu ers set up on this light (Read Only).

cookie

The cookie texture projected by the light.

cookieSize

The size of a directional light's cookie.

cullingMask

This is used to light certain objects in the Scene selectively.

are

The are asset to use for this light.

intensity

The Intensity of a light is multiplied with the Light color.

layerShadowCullDistances

Per-light, per-layer shadow culling distances.

lightmapBakeType

This property describes what part of a light's contribution can be baked.

lightShadowCasterMode

Allows you to override the global Shadowmask Mode per light. Only use this with
render pipelines that can handle per light Shadowmask modes. Incompatible
with the legacy renderers.

range

The range of the light.

renderMode

How to render the light.

shadowAngle

Controls the amount of arti cial softening applied to the edges of shadows cast
by directional lights.

shadowBias

Shadow mapping constant bias.

shadowCustomResolution

The custom resolution of the shadow map.

shadowNearPlane

Near plane value to use for shadow frustums.

shadowNormalBias

Shadow mapping normal-based bias.

shadowRadius

Controls the amount of arti cial softening applied to the edges of shadows cast
by the Point or Spot light.

shadowResolution

The resolution of the shadow map.

shadows

How this light casts shadows

shadowStrength

Strength of light's shadows.

spotAngle

The angle of the light's spotlight cone in degrees.

type

The type of the light.

Public Methods
AddCommandBu er

Add a command bu er to be executed at a speci ed place.

AddCommandBu erAsync

Adds a command bu er to the GPU's async compute queues and executes that
command bu er when graphics processing reaches a given point.

GetCommandBu ers

Get command bu ers to be executed at a speci ed place.

RemoveAllCommandBu ers

Remove all command bu ers set on this light.

RemoveCommandBu er

Remove command bu er from execution at a speci ed place.

RemoveCommandBu ers

Remove command bu ers from execution at a speci ed place.

Reset

Revert all light parameters to default.

SetLightDirty

Sets a light dirty to notify the light baking backends to update their internal
light representation.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Struct describing the result of a Global Illumination bake for a given light.
The example below demonstrates how you can check the baked status of a light and change its active state.

using UnityEngine;
using System.Collections;

public class LightBakingOutputExample : MonoBehaviour
{
void TurnOffLight(Light light)
{
if (light.bakingOutput.isBaked && light.bakingOutput.lightmapBakeType !=
{
Debug.Log("Light got some contribution statically baked, it cannot b
}
else
{
light.enabled = false;
}
}
}

Properties
isBaked

Is the light contribution already stored in lightmaps and/or lightprobes?

lightmapBakeType

This property describes what part of a light's contribution was baked.

mixedLightingMode

In case of a LightmapBakeType.Mixed light, describes what Mixed mode was
used to bake the light, irrelevant otherwise.

occlusionMaskChannel

In case of a LightmapBakeType.Mixed light, contains the index of the occlusion
mask channel to use if any, otherwise -1.

probeOcclusionLightIndex

In case of a LightmapBakeType.Mixed light, contains the index of the light as
seen from the occlusion probes point of view if any, otherwise -1.

Leave feedback

Description
Data of a lightmap.
A Scene can have several lightmaps stored in it, and Renderer components can use those lightmaps. This makes it
possible to use the same material on multiple objects, while each object can refer to a di erent lightmap or
di erent portion of the same lightmap.
See Also: LightmapSettings class, Renderer.lightmapIndex

Properties
lightmapColor

Lightmap storing color of incoming light.

lightmapDir

Lightmap storing dominant direction of incoming light.

shadowMask

Texture storing occlusion mask per light (ShadowMask, up to four lights).

Leave feedback

Description
Stores lightmaps of the Scene.
A Scene can have several lightmaps stored in it, and Renderer components can use those lightmaps. This makes it
possible to use the same material on multiple objects, while each object can refer to a di erent lightmap or
di erent portion of the same lightmap.
See Also: LightmapData class, Renderer.lightmapIndex

Static Properties
lightmaps

Lightmap array.

lightmapsMode

NonDirectional or CombinedDirectional Specular lightmaps rendering mode.

lightProbes

Holds all data needed by the light probes.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Light Probe Group.

Properties
dering

Removes ringing from probes if enabled.

probePositions

Editor only function to access and modify probe positions.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The Light Probe Proxy Volume component o ers the possibility to use higher resolution lighting for large nonstatic GameObjects.
By default, a probe-lit Renderer receives lighting from a single Light Probe that is interpolated from the
surrounding Light Probes in the Scene. Because of this, GameObjects have constant ambient lighting regardless
of their position on the surface. The light has have a rotational gradient because it's using spherical harmonics,
but it lacks a spatial gradient. This is more noticeable on larger GameObjects and Particle Systems. The lighting
across the GameObject matches the lighting at the anchor point, and if the GameObject straddles a lighting
gradient, parts of the GameObject will look incorrect.
This component will generate a 3D grid of interpolated Light Probes inside a bounding volume. The resolution of
the grid can be user-speci ed. The spherical harmonics coe cients of the interpolated Light Probes are updated
into 3D textures, which are sampled at render time to compute the contribution to the di use ambient lighting.
This adds a spatial gradient to probe-lit GameObjects.
See Also: Light Probes.

Static Properties
isFeatureSupported

Checks if Light Probe Proxy Volumes are supported.

Properties
boundingBoxMode

The bounding box mode for generating the 3D grid of interpolated Light Probes.

boundsGlobal

The world-space bounding box in which the 3D grid of interpolated Light Probes is
generated.

gridResolutionX

The 3D grid resolution on the z-axis.

gridResolutionY

The 3D grid resolution on the y-axis.

gridResolutionZ

The 3D grid resolution on the z-axis.

originCustom

The local-space origin of the bounding box in which the 3D grid of interpolated Light
Probes is generated.

probeDensity

Interpolated Light Probe density.

probePositionMode

The mode in which the interpolated Light Probe positions are generated.

qualityMode

Determines how many Spherical Harmonics bands will be evaluated to compute the

ambient color.
refreshMode

Sets the way the Light Probe Proxy Volume refreshes.

resolutionMode

The resolution mode for generating the grid of interpolated Light Probes.

sizeCustom

The size of the bounding box in which the 3D grid of interpolated Light Probes is
generated.

Public Methods
Update

Triggers an update of the Light Probe Proxy Volume.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The bounding box mode for generating a grid of interpolated Light Probes.
See Also: Light Probes, Light Probe Proxy Volume.

Properties
AutomaticLocal

The bounding box encloses the current Renderer and all the relevant Renderers down the
hierarchy, in local space.

AutomaticWorld

The bounding box encloses the current Renderer and all the relevant Renderers down the
hierarchy, in world space.

Custom

A custom local-space bounding box is used. The user is able to edit the bounding box.

Leave feedback
SWITCH TO MANUAL

Description
The mode in which the interpolated Light Probe positions are generated.
See Also: Light Probes, Light Probe Proxy Volume.

Properties
CellCorner

Divide the volume in cells based on resolution, and generate interpolated Light Probes
positions in the corner/edge of the cells.

CellCenter

Divide the volume in cells based on resolution, and generate interpolated Light Probe
positions in the center of the cells.

Leave feedback
SWITCH TO MANUAL

Description
An enum describing the Quality option used by the Light Probe Proxy Volume component.
See Also: Light Probes, Light Probe Proxy Volume, Spherical Harmonics(SH).

Properties
Low

This option will use only two SH coe cients bands: L0 and L1. The coe cients are
sampled from the Light Probe Proxy Volume 3D Texture. Using this option might increase
the draw call batch sizes by not having to change the L2 coe cients per Renderer.

Normal

This option will use L0 and L1 SH coe cients from the Light Probe Proxy Volume 3D
Texture. The L2 coe cients are constant per Renderer. By having to provide the L2
coe cients, draw call batches might be broken.

Leave feedback
SWITCH TO MANUAL

Description
An enum describing the way a Light Probe Proxy Volume refreshes in the Player.
See Also: Light Probe Proxy Volume.

Properties
Automatic

Automatically detects updates in Light Probes and triggers an update of the Light Probe
volume.

EveryFrame

Causes Unity to update the Light Probe Proxy Volume every frame.

ViaScripting

Use this option to indicate that the Light Probe Proxy Volume is never to be automatically
updated by Unity.

Leave feedback
SWITCH TO MANUAL

Description
The resolution mode for generating a grid of interpolated Light Probes.
See Also: Light Probes, Light Probe Proxy Volume.

Properties
Automatic

The automatic mode uses a number of interpolated Light Probes per unit area, and uses
the bounding volume size to compute the resolution. The nal resolution value is a power
of 2.

Custom

The custom mode allows you to specify the 3D grid resolution.

Leave feedback

Description
Stores light probes for the Scene.
The baked data includes: probe positions, Spherical Harmonics (SH) coe cients and the tetrahedral tessellation.
You can modify the coe cients at runtime. You can also swap the entire LightProbes object to a di erent prebaked one using LightmapSettings.lightProbes.
See Also: LightmapSettings class, Renderer.useLightProbes property.

Properties
bakedProbes

Coe cients of baked light probes.

cellCount

The number of cells space is divided into (Read Only).

count

The number of light probes (Read Only).

positions

Positions of the baked light probes (Read Only).

Static Methods
CalculateInterpolatedLightAndOcclusionProbes

Calculate light probes and occlusion probes at the given
world space positions.

GetInterpolatedProbe

Returns an interpolated probe for the given position for
both realtime and baked light probes combined.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The line renderer is used to draw free- oating lines in 3D space.
This class is a script interface for a line renderer component.

Properties
alignment

Select whether the line will face the camera, or the orientation of the Transform
Component.

colorGradient

Set the color gradient describing the color of the line at various points along its
length.

endColor

Set the color at the end of the line.

endWidth

Set the width at the end of the line.

generateLightingData

Con gures a line to generate Normals and Tangents. With this data, Scene lighting
can a ect the line via Normal Maps and the Unity Standard Shader, or your own
custom-built Shaders.

loop

Connect the start and end positions of the line together to form a continuous loop.

numCapVertices

Set this to a value greater than 0, to get rounded corners on each end of the line.

numCornerVertices

Set this to a value greater than 0, to get rounded corners between each segment of
the line.

positionCount

Set/get the number of vertices.

shadowBias

Apply a shadow bias to prevent self-shadowing artifacts. The speci ed value is the
proportion of the line width at each segment.

startColor

Set the color at the start of the line.

startWidth

Set the width at the start of the line.

textureMode

Choose whether the U coordinate of the line texture is tiled or stretched.

useWorldSpace

If enabled, the lines are de ned in world space.

widthCurve

Set the curve describing the width of the line at various points along its length.

widthMultiplier

Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the nal
width of the line.

Public Methods
BakeMesh

Creates a snapshot of LineRenderer and stores it in mesh.

GetPosition

Get the position of a vertex in the line.

GetPositions

Get the positions of all vertices in the line.

SetPosition

Set the position of a vertex in the line.

SetPositions

Set the positions of all vertices in the line.

Simplify

Generates a simpli ed version of the original line by removing points that fall within the
speci ed tolerance.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read

Only).
material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback

Description
A collection of common line functions.

Static Methods
Simplify

Generates a simpli ed version of the original line by removing points that fall within the
speci ed tolerance.

Leave feedback

Description
Structure describing device location.
Units are in meters.

Properties
altitude

Geographical device location altitude.

horizontalAccuracy

Horizontal accuracy of the location.

latitude

Geographical device location latitude.

longitude

Geographical device location latitude.

timestamp

Timestamp (in seconds since 1970) when location was last time updated.

verticalAccuracy

Vertical accuracy of the location.

Leave feedback

Description
Interface into location functionality.

Properties
isEnabledByUser

Speci es whether location service is enabled in user settings.

lastData

Last measured device geographical location.

status

Returns location service status.

Public Methods
Start

Starts location service updates. Last location coordinates could be.

Stop

Stops location service updates. This could be useful for saving battery life.

Leave feedback

Description
Structure for building a LOD for passing to the SetLODs function.

Properties
fadeTransitionWidth

Width of the cross-fade transition zone (proportion to the current LOD's
whole length) [0-1]. Only used if it's not animated.

renderers

List of renderers for this LOD level.

screenRelativeTransitionHeight

The screen relative height to use for the transition [0-1].

Constructors
LOD

Construct a LOD.

Leave feedback
SWITCH TO MANUAL

Description
LODGroup lets you group multiple Renderers into LOD levels.
This can be used to switch between di erent LOD levels at runtime based on size on screen.

Static Properties
crossFadeAnimationDuration

The cross-fading animation duration in seconds. ArgumentException will be
thrown if it is set to zero or a negative value.

Properties
animateCrossFading

Specify if the cross-fading should be animated by time. The animation duration is
speci ed globally as crossFadeAnimationDuration.

enabled

Enable / Disable the LODGroup - Disabling will turn o all renderers.

fadeMode

The LOD fade mode used.

localReferencePoint

The local reference point against which the LOD distance is calculated.

lodCount

The number of LOD levels.

size

The size of the LOD object in local space.

Public Methods
ForceLOD
GetLODs

Returns the array of LODs.

RecalculateBounds

Recalculate the bounding region for the LODGroup (Relatively slow, do not call often).

SetLODs

Set the LODs for the LOD group. This will remove any existing LODs con gured on the
LODGroup.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a

game object.
tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Implements interfaces:ILogger, ILogHandler

Description
Initializes a new instance of the Logger.
Create a new instance or use default Debug.unityLogger. See Also: ILogger, ILogHandler.

using
using
using
using

UnityEngine;
System.Collections;
System.IO;
System;

public class MyLogHandler : ILogHandler
{
public void LogFormat(LogType logType, UnityEngine.Object context, string fo
{
Debug.unityLogger.logHandler.LogFormat(logType, context, format, args);
}

public void LogException(Exception exception, UnityEngine.Object context)
{
Debug.unityLogger.LogException(exception, context);
}
}

public class MyGameClass : MonoBehaviour
{
private static string kTAG = "MyGameTag";
private Logger myLogger;

void Start()
{
myLogger = new Logger(new MyLogHandler());

myLogger.Log(kTAG, "MyGameClass Start.");
}
}

Properties
lterLogType

To selective enable debug log message.

logEnabled

To runtime toggle debug logging [ON/OFF].

logHandler

Set Logger.ILogHandler.

Constructors
Logger

Create a custom Logger.

Public Methods
IsLogTypeAllowed

Check logging is enabled based on the LogType.

Log

Logs message to the Unity Console using default logger.

LogError

A variant of Logger.Log that logs an error message.

LogException

A variant of Logger.Log that logs an exception message.

LogFormat

Logs a formatted message.

LogWarning

A variant of Logger.Log that logs an warning message.

Leave feedback
Obsolete

Description
The Master Server is used to make matchmaking between servers and clients easy.
You can advertise game hosts or fetch host lists for you game type. The functions here are used to communicate
with the Master Server itself which resides on a separate server. If necessary the server itself can be customized.
For an overview of the Master Server as well as a technical description see the Master Server manual page.

Messages
OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
master server.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

Leave feedback

Description
Use this struct to specify the position and rotation weight mask for Animator.MatchTarget.

Properties
positionXYZWeight

Position XYZ weight.

rotationWeight

Rotation weight.

Constructors
MatchTargetWeightMask

MatchTargetWeightMask contructor.

Leave feedback
SWITCH TO MANUAL

Description
The material class.
This class exposes all properties from a material, allowing you to animate them. You can also use it to set custom
shader properties that can't be accessed through the inspector (e.g. matrices).
In order to get the material used by an object, use the Renderer.material property.
See Also: Materials, Shaders.

Properties
color

The main material's color.

doubleSidedGI

Gets and sets whether the Double Sided Global Illumination setting is enabled for
this material.

enableInstancing

Gets and sets whether GPU instancing is enabled for this material.

globalIlluminationFlags

De nes how the material should interact with lightmaps and lightprobes.

mainTexture

The material's texture.

mainTextureO set

The texture o set of the main texture.

mainTextureScale

The texture scale of the main texture.

passCount

How many passes are in this material (Read Only).

renderQueue

Render queue of this material.

shader

The shader used by the material.

shaderKeywords

Additional shader keywords set by this material.

Constructors
Material

Public Methods
CopyPropertiesFromMaterial

Copy properties from other material into this material.

DisableKeyword

Unset a shader keyword.

EnableKeyword

Sets a shader keyword that is enabled by this material.

FindPass

Returns the index of the pass passName.

GetColor

Get a named color value.

GetColorArray

Get a named color array.

GetFloat

Get a named oat value.

GetFloatArray

Get a named oat array.

GetInt

Get a named integer value.

GetMatrix

Get a named matrix value from the shader.

GetMatrixArray

Get a named matrix array.

GetPassName

Returns the name of the shader pass at index pass.

GetShaderPassEnabled

Checks whether a given Shader pass is enabled on this Material.

GetTag

Get the value of material's shader tag.

GetTexture

Get a named texture.

GetTextureO set

Gets the placement o set of texture propertyName.

GetTexturePropertyNameIDs

Return the name IDs of all texture properties exposed on this material.

GetTexturePropertyNames

Returns the names of all texture properties exposed on this material.

GetTextureScale

Gets the placement scale of texture propertyName.

GetVector

Get a named vector value.

GetVectorArray

Get a named vector array.

HasProperty

Checks if material's shader has a property of a given name.

IsKeywordEnabled

Is the shader keyword enabled on this material?

Lerp

Interpolate properties between two materials.

SetBu er

Sets a named ComputeBu er value.

SetColor

Sets a named color value.

SetColorArray

Sets a color array property.

SetFloat

Sets a named oat value.

SetFloatArray

Sets a oat array property.

SetInt

Sets a named integer value.

SetMatrix

Sets a named matrix for the shader.

SetMatrixArray

Sets a matrix array property.

SetOverrideTag

Sets an override tag/value on the material.

SetPass

Activate the given pass for rendering.

SetShaderPassEnabled

Enables or disables a Shader pass on a per-Material level.

SetTexture

Sets a named texture.

SetTextureO set

Sets the placement o set of texture propertyName.

SetTextureScale

Sets the placement scale of texture propertyName.

SetVector

Sets a named vector value.

SetVectorArray

Sets a vector array property.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A block of material values to apply.
MaterialPropertyBlock is used by Graphics.DrawMesh and Renderer.SetPropertyBlock. Use it in situations where
you want to draw multiple objects with the same material, but slightly di erent properties. For example, if you
want to slightly change the color of each mesh drawn. Changing the render state is not supported.
Unity's terrain engine uses MaterialPropertyBlock to draw trees; all of them use the same material, but each tree
has di erent color, scale & wind factor.
The block passed to Graphics.DrawMesh or Renderer.SetPropertyBlock is copied, so the most e cient way of
using it is to create one block and reuse it for all DrawMesh calls. Use SetFloat, SetVector, SetColor, SetMatrix,
SetTexture, SetBu er to add or replace values.
See Also: Graphics.DrawMesh, Material.

Properties
isEmpty

Is the material property block empty? (Read Only)

Public Methods
Clear

Clear material property values.

CopyProbeOcclusionArrayFrom

This function copies the entire source array into a Vector4 property array
named unity_ProbesOcclusion for use with instanced Shadowmask
rendering.

CopySHCoe cientArraysFrom

This function converts and copies the entire source array into 7 Vector4
property arrays named unity_SHAr, unity_SHAg, unity_SHAb, unity_SHBr,
unity_SHBg, unity_SHBb and unity_SHC for use with instanced light probe
rendering.

GetColor

Get a color from the property block.

GetFloat

Get a oat from the property block.

GetFloatArray

Get a oat array from the property block.

GetInt

Get an int from the property block.

GetMatrix

Get a matrix from the property block.

GetMatrixArray

Get a matrix array from the property block.

GetTexture

Get a texture from the property block.

GetVector

Get a vector from the property block.

GetVectorArray

Get a vector array from the property block.

SetBu er

Set a ComputeBu er property.

SetColor

Set a color property.

SetFloat

Set a oat property.

SetFloatArray

Set a oat array property.

SetInt

Adds a property to the block. If an int property with the given name already
exists, the old value is replaced.

SetMatrix

Set a matrix property.

SetMatrixArray

Set a matrix array property.

SetTexture

Set a texture property.

SetVector

Set a vector property.

SetVectorArray

Set a vector array property.

Leave feedback

Description
A collection of common math functions.

Static Properties
Deg2Rad

Degrees-to-radians conversion constant (Read Only).

Epsilon

A tiny oating point value (Read Only).

In nity

A representation of positive in nity (Read Only).

NegativeIn nity

A representation of negative in nity (Read Only).

PI

The well-known 3.14159265358979... value (Read Only).

Rad2Deg

Radians-to-degrees conversion constant (Read Only).

Static Methods
Abs

Returns the absolute value of f.

Acos

Returns the arc-cosine of f - the angle in radians whose cosine is f.

Approximately

Compares two oating point values and returns true if they are similar.

Asin

Returns the arc-sine of f - the angle in radians whose sine is f.

Atan

Returns the arc-tangent of f - the angle in radians whose tangent is f.

Atan2

Returns the angle in radians whose Tan is y/x.

Ceil

Returns the smallest integer greater to or equal to f.

CeilToInt

Returns the smallest integer greater to or equal to f.

Clamp

Clamps a value between a minimum oat and maximum oat value.

Clamp01

Clamps value between 0 and 1 and returns value.

ClosestPowerOfTwo

Returns the closest power of two value.

CorrelatedColorTemperatureToRGB

Convert a color temperature in Kelvin to RGB color.

Cos

Returns the cosine of angle f.

DeltaAngle

Calculates the shortest di erence between two given angles given in
degrees.

Exp

Returns e raised to the speci ed power.

Floor

Returns the largest integer smaller than or equal to f.

FloorToInt

Returns the largest integer smaller to or equal to f.

GammaToLinearSpace

Converts the given value from gamma (sRGB) to linear color space.

InverseLerp

Calculates the linear parameter t that produces the interpolant value
within the range [a, b].

IsPowerOfTwo

Returns true if the value is power of two.

Lerp

Linearly interpolates between a and b by t.

LerpAngle

Same as Lerp but makes sure the values interpolate correctly when
they wrap around 360 degrees.

LerpUnclamped

Linearly interpolates between a and b by t with no limit to t.

LinearToGammaSpace

Converts the given value from linear to gamma (sRGB) color space.

Log

Returns the logarithm of a speci ed number in a speci ed base.

Log10

Returns the base 10 logarithm of a speci ed number.

Max

Returns largest of two or more values.

Min

Returns the smallest of two or more values.

MoveTowards

Moves a value current towards target.

MoveTowardsAngle

Same as MoveTowards but makes sure the values interpolate correctly
when they wrap around 360 degrees.

NextPowerOfTwo

Returns the next power of two that is equal to, or greater than, the
argument.

PerlinNoise

Generate 2D Perlin noise.

PingPong

PingPongs the value t, so that it is never larger than length and never
smaller than 0.

Pow

Returns f raised to power p.

Repeat

Loops the value t, so that it is never larger than length and never
smaller than 0.

Round

Returns f rounded to the nearest integer.

RoundToInt

Returns f rounded to the nearest integer.

Sign

Returns the sign of f.

Sin

Returns the sine of angle f.

SmoothDamp

Gradually changes a value towards a desired goal over time.

SmoothDampAngle

Gradually changes an angle given in degrees towards a desired goal
angle over time.

SmoothStep

Interpolates between min and max with smoothing at the limits.

Sqrt

Returns square root of f.

Tan

Returns the tangent of angle f in radians.

Leave feedback

Description
A standard 4x4 transformation matrix.
A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear
etc.) and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; most
often using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are
used in special cases like setting up nonstandard camera projection.
Consult any graphics textbook for in depth explanation of transformation matrices.
In Unity, Matrix4x4 is used by several Transform, Camera, Material and GL functions.
Matrices in unity are column major. Data is accessed as: row + (column*4). Matrices can be indexed like 2D arrays
but in an expression like mat[a, b], a refers to the row index, while b refers to the column index (note that this is
the opposite way round to Cartesian coordinates).

Static Properties
identity

Returns the identity matrix (Read Only).

zero

Returns a matrix with all elements set to zero (Read Only).

Properties
decomposeProjection

This property takes a projection matrix and returns the six plane coordinates that
de ne a projection frustum.

determinant

The determinant of the matrix.

inverse

The inverse of this matrix (Read Only).

isIdentity

Is this the identity matrix?

lossyScale

Attempts to get a scale value from the matrix.

rotation

Attempts to get a rotation quaternion from this matrix.

this[int,int]

Access element at [row, column].

transpose

Returns the transpose of this matrix (Read Only).

Public Methods
GetColumn

Get a column of the matrix.

GetRow

Returns a row of the matrix.

MultiplyPoint

Transforms a position by this matrix (generic).

MultiplyPoint3x4

Transforms a position by this matrix (fast).

MultiplyVector

Transforms a direction by this matrix.

SetColumn

Sets a column of the matrix.

SetRow

Sets a row of the matrix.

SetTRS

Sets this matrix to a translation, rotation and scaling matrix.

ToString

Returns a nicely formatted string for this matrix.

TransformPlane

Returns a plane that is transformed in space.

ValidTRS

Checks if this matrix is a valid transform matrix.

Static Methods
Frustum

This function returns a projection matrix with viewing frustum that has a near plane
de ned by the coordinates that were passed in.

LookAt

Given a source point, a target point, and an up vector, computes a transformation matrix
that corresponds to a camera viewing the target from the source, such that the right-hand
vector is perpendicular to the up vector.

Ortho

Creates an orthogonal projection matrix.

Perspective

Creates a perspective projection matrix.

Rotate

Creates a rotation matrix.

Scale

Creates a scaling matrix.

Translate

Creates a translation matrix.

TRS

Creates a translation, rotation and scaling matrix.

Operators
operator *

Multiplies two matrices.

Leave feedback
SWITCH TO MANUAL

Description
A class that allows creating or modifying meshes from scripts.
Meshes contain vertices and multiple triangle arrays. See the Procedural example project for examples of using
the mesh interface.
The triangle arrays are simply indices into the vertex arrays; three indices for each triangle.
For every vertex there can be a normal, two texture coordinates, color and tangent. These are optional though
and can be removed at will. All vertex information is stored in separate arrays of the same size, so if your mesh
has 10 vertices, you would also have 10-size arrays for normals and other attributes.
There are probably 3 things you might want to use the modifyable mesh interface for:
1. Building a mesh from scratch: should always be done in the following order:
a) assign vertices
b) assign triangles.

using UnityEngine;

public class Example : MonoBehaviour
{
Vector3[] newVertices;
Vector2[] newUV;
int[] newTriangles;

void Start()
{
Mesh mesh = new Mesh();
GetComponent().mesh = mesh;
mesh.vertices = newVertices;
mesh.uv = newUV;
mesh.triangles = newTriangles;
}
}

2. Modifying vertex attributes every frame:
a) get vertices
b) modify them
c) assign them back to the mesh.

using UnityEngine;

public class Example : MonoBehaviour
{
void Update()
{
Mesh mesh = GetComponent().mesh;
Vector3[] vertices = mesh.vertices;
Vector3[] normals = mesh.normals;

for (var i = 0; i < vertices.Length; i++)
{
vertices[i] += normals[i] * Mathf.Sin(Time.time);
}

mesh.vertices = vertices;
}
}

3. Continously changing the mesh triangles and vertices:
a) call Clear to start fresh
b) assign vertices and other attributes
c) assign triangle indices.
It is important to call Clear before assigning new vertices or triangles. Unity always checks the supplied triangle
indices whether they don't reference out of bounds vertices. Calling Clear then assigning vertices then triangles
makes sure you never have out of bounds data.

using UnityEngine;

public class ExampleClass : MonoBehaviour
{
Vector3[] newVertices;
Vector2[] newUV;

int[] newTriangles;

void Start()
{
Mesh mesh = GetComponent().mesh;

mesh.Clear();

// Do some calculations...
mesh.vertices = newVertices;
mesh.uv = newUV;
mesh.triangles = newTriangles;
}
}

Properties
bindposes

The bind poses. The bind pose at each index refers to the bone with the same index.

blendShapeCount

Returns BlendShape count on this mesh.

boneWeights

The bone weights of each vertex.

bounds

The bounding volume of the mesh.

colors

Vertex colors of the Mesh.

colors32

Vertex colors of the Mesh.

indexFormat

Format of the mesh index bu er data.

isReadable

Returns a bool indicated whether the mesh is read/write enabled.

normals

The normals of the Mesh.

subMeshCount

The number of sub-meshes inside the Mesh object.

tangents

The tangents of the Mesh.

triangles

An array containing all triangles in the Mesh.

uv

The base texture coordinates of the Mesh.

uv2

The second texture coordinate set of the mesh, if present.

uv3

The third texture coordinate set of the mesh, if present.

uv4

The fourth texture coordinate set of the mesh, if present.

uv5

The fth texture coordinate set of the mesh, if present.

uv6

The sixth texture coordinate set of the mesh, if present.

uv7

The seventh texture coordinate set of the mesh, if present.

uv8

The eighth texture coordinate set of the mesh, if present.

vertexBu erCount

Gets the number of vertex bu ers present in the Mesh. (Read Only)

vertexCount

Returns the number of vertices in the Mesh (Read Only).

vertices

Returns a copy of the vertex positions or assigns a new vertex positions array.

Constructors
Mesh

Creates an empty Mesh.

Public Methods
AddBlendShapeFrame

Adds a new blend shape frame.

Clear

Clears all vertex data and all triangle indices.

ClearBlendShapes

Clears all blend shapes from Mesh.

CombineMeshes

Combines several Meshes into this Mesh.

GetBaseVertex

Gets the base vertex index of the given sub-mesh.

GetBindposes

Gets the bind poses for this instance.

GetBlendShapeFrameCount

Returns the frame count for a blend shape.

GetBlendShapeFrameVertices

Retreives deltaVertices, deltaNormals and deltaTangents of a blend shape
frame.

GetBlendShapeFrameWeight

Returns the weight of a blend shape frame.

GetBlendShapeIndex

Returns index of BlendShape by given name.

GetBlendShapeName

Returns name of BlendShape by given index.

GetBoneWeights

Gets the bone weights for this instance.

GetColors

Gets the vertex colors for this instance.

GetIndexCount

Gets the index count of the given sub-mesh.

GetIndexStart

Gets the starting index location within the Mesh's index bu er, for the given
sub-mesh.

GetIndices

Fetches the index list for the speci ed sub-mesh.

GetNativeIndexBu erPtr

Retrieves a native (underlying graphics API) pointer to the index bu er.

GetNativeVertexBu erPtr

Retrieves a native (underlying graphics API) pointer to the vertex bu er.

GetNormals

Gets the vertex normals for this instance.

GetTangents

Gets the tangents for this instance.

GetTopology

Gets the topology of a sub-mesh.

GetTriangles

Fetches the triangle list for the speci ed sub-mesh on this object.

GetUVDistributionMetric

The UV distribution metric can be used to calculate the desired mipmap level
based on the position of the camera.

GetUVs

Gets the UVs of the Mesh.

GetVertices

Gets the vertex positions for this instance.

MarkDynamic

Optimize mesh for frequent updates.

RecalculateBounds

Recalculate the bounding volume of the Mesh from the vertices.

RecalculateNormals

Recalculates the normals of the Mesh from the triangles and vertices.

RecalculateTangents

Recalculates the tangents of the Mesh from the normals and texture
coordinates.

SetColors

Vertex colors of the Mesh.

SetIndices

Sets the index bu er for the sub-mesh.

SetNormals

Set the normals of the Mesh.

SetTangents

Set the tangents of the Mesh.

SetTriangles

Sets the triangle list for the sub-mesh.

SetUVs

Sets the UVs of the Mesh.

SetVertices

Assigns a new vertex positions array.

UploadMeshData

Upload previously done Mesh modi cations to the graphics API.

Inherited Members
Properties

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A mesh collider allows you to do collision detection between meshes and primitives.
See Also: BoxCollider, CapsuleCollider, PhysicMaterial, Rigidbody.

Properties
convex

Use a convex collider from the mesh.

cookingOptions

Options used to enable or disable certain features in mesh cooking.

sharedMesh

The mesh object used for collision detection.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback
SWITCH TO MANUAL

Description
A class to access the Mesh of the mesh lter.
Use this with a procedural mesh interface. See Also: Mesh class.

Properties
mesh

Returns the instantiated Mesh assigned to the mesh lter.

sharedMesh

Returns the shared mesh of the mesh lter.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Renders meshes inserted by the MeshFilter or TextMesh.

Properties
additionalVertexStreams

Vertex attributes in this mesh will override or add attributes of the primary mesh
in the MeshRenderer.

subMeshStartIndex

Index of the rst sub-mesh to use from the Mesh associated with this
MeshRenderer (Read Only).

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback
SWITCH TO MANUAL

Description
Use this class to record to an AudioClip using a connected microphone.
You can get a list of connected microphone(s) from the devices property and then use the Start and End functions
to start or end a recording session using one of the available devices.

Static Properties
devices

A list of available microphone devices, identi ed by name.

Static Methods
End

Stops recording.

GetDeviceCaps

Get the frequency capabilities of a device.

GetPosition

Get the position in samples of the recording.

IsRecording

Query if a device is currently recording.

Start

Start Recording with device.

Leave feedback

Description
MonoBehaviour is the base class from which every Unity script derives.
When you use C#, you must explicitly derive from MonoBehaviour.
Note: There is a checkbox for disabling MonoBehaviour on the Unity Editor. It disables functions when unticked.
If none of these functions are present in the script, the Editor does not display the checkbox. The functions are:
Start()
Update()
FixedUpdate()
LateUpdate()
OnGUI()
OnDisable()
OnEnable()
See Also: The Deactivating GameObjects page in the manual.

Properties
runInEditMode

Allow a speci c instance of a MonoBehaviour to run in edit mode (only available in the
editor).

useGUILayout

Disabling this lets you skip the GUI layout phase.

Public Methods
CancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

Invoke

Invokes the method methodName in time seconds.

InvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every repeatRate
seconds.

IsInvoking

Is any invoke on methodName pending?

StartCoroutine

Starts a coroutine.

StopAllCoroutines

Stops all coroutines running on this behaviour.

StopCoroutine

Stops the rst coroutine named methodName, or the coroutine stored in routine running
on this behaviour.

Static Methods
print

Logs message to the Unity Console (identical to Debug.Log).

Messages
Awake

Awake is called when the script instance is being loaded.

FixedUpdate

This function is called every xed framerate frame, if the
MonoBehaviour is enabled.

LateUpdate

LateUpdate is called every frame, if the Behaviour is enabled.

OnAnimatorIK

Callback for setting up animation IK (inverse kinematics).

OnAnimatorMove

Callback for processing animation movements for modifying root
motion.

OnApplicationFocus

Sent to all GameObjects when the player gets or loses focus.

OnApplicationPause

Sent to all GameObjects when the application pauses.

OnApplicationQuit

Sent to all game objects before the application quits.

OnAudioFilterRead

If OnAudioFilterRead is implemented, Unity will insert a custom lter
into the audio DSP chain.

OnBecameInvisible

OnBecameInvisible is called when the renderer is no longer visible by
any camera.

OnBecameVisible

OnBecameVisible is called when the renderer became visible by any
camera.

OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun
touching another rigidbody/collider.

OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider
(2D physics only).

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped
touching another rigidbody/collider.

OnCollisionExit2D

Sent when a collider on another object stops touching this object's
collider (2D physics only).

OnCollisionStay

:ref::OnCollisionStay is called once per frame for every
collider/rigidbody that is touching rigidbody/collider.

OnCollisionStay2D

Sent each frame where a collider on another object is touching this
object's collider (2D physics only).

OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnControllerColliderHit

OnControllerColliderHit is called when the controller hits a collider while
performing a Move.

OnDestroy

Destroying the attached Behaviour will result in the game or Scene
receiving OnDestroy.

OnDisable

This function is called when the behaviour becomes disabled.

OnDisconnectedFromServer

Called on the client when the connection was lost or you disconnected
from the server.

OnDrawGizmos

Implement OnDrawGizmos if you want to draw gizmos that are also
pickable and always drawn.

OnDrawGizmosSelected

Implement OnDrawGizmosSelected to draw a gizmo if the object is
selected.

OnEnable

This function is called when the object becomes enabled and active.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnFailedToConnectToMasterServer

Called on clients or servers when there is a problem connecting to the
MasterServer.

OnGUI

OnGUI is called for rendering and handling GUI events.

OnJointBreak

Called when a joint attached to the same game object broke.

OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

OnMasterServerEvent

Called on clients or servers when reporting events from the
MasterServer.

OnMouseDown

OnMouseDown is called when the user has pressed the mouse button
while over the GUIElement or Collider.

OnMouseDrag

OnMouseDrag is called when the user has clicked on a GUIElement or
Collider and is still holding down the mouse.

OnMouseEnter

Called when the mouse enters the GUIElement or Collider.

OnMouseExit

Called when the mouse is not any longer over the GUIElement or
Collider.

OnMouseOver

Called every frame while the mouse is over the GUIElement or Collider.

OnMouseUp

OnMouseUp is called when the user has released the mouse button.

OnMouseUpAsButton

OnMouseUpAsButton is only called when the mouse is released over
the same GUIElement or Collider as it was pressed.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnParticleCollision

OnParticleCollision is called when a particle hits a Collider.

OnParticleSystemStopped

OnParticleSystemStopped is called when all particles in the system have
died, and no new particles will be born. New particles cease to be
created either after Stop is called, or when the duration property of a
non-looping system has been exceeded.

OnParticleTrigger

OnParticleTrigger is called when any particles in a particle system meet
the conditions in the trigger module.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player disconnected from the server.

OnPostRender

OnPostRender is called after a camera nished rendering the Scene.

OnPreCull

OnPreCull is called before a camera culls the Scene.

OnPreRender

OnPreRender is called before a camera starts rendering the Scene.

OnRenderImage

OnRenderImage is called after all rendering is complete to render
image.

OnRenderObject

OnRenderObject is called after camera has rendered the Scene.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked
and has completed.

OnTransformChildrenChanged

This function is called when the list of children of the transform of the
GameObject has changed.

OnTransformParentChanged

This function is called when the parent property of the transform of the
GameObject has changed.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this
object (2D physics only).

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching
the trigger.

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this
object (2D physics only).

OnTriggerStay

OnTriggerStay is called once per physics update for every Collider other
that is touching the trigger.

OnTriggerStay2D

Sent each frame where another object is within a trigger collider
attached to this object (2D physics only).

OnValidate

This function is called when the script is loaded or a value is changed in
the inspector (Called in the editor only).

OnWillRenderObject

OnWillRenderObject is called for each camera if the object is visible and
not a UI element.

Reset

Reset to default values.

Start

Start is called on the frame when a script is enabled just before any of
the Update methods are called the rst time.

Update

Update is called every frame, if the MonoBehaviour is enabled.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Base class for AnimationClips and BlendTrees.
Motions are used by animation States in the Mecanim StateMachines.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Obsolete

Description
MovieTexture has been deprecated. Refer to the new movie playback solution VideoPlayer.
Movie Textures are textures onto which movies are played back. They can be used for cutscene movie sequences,
or to render movies into the Scene itself.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Obsolete

Description
The network class is at the heart of the network implementation and provides the core functions.
This class con gures the network interface and all the network parameters. You use it to set up a server or
connect to one and have a row of helper functions to help you with those tasks. For more information on what is
exposed in the editor see the Network Manger component reference.

Messages
OnConnectedToServer

Called on the client when you have successfully connected to a server.

OnDisconnectedFromServer

Called on client during disconnection from server, but also on the server when
the connection has disconnected.

OnFailedToConnect

Called on the client when a connection attempt fails for some reason.

OnNetworkInstantiate

Called on objects which have been network instantiated with
Network.Instantiate.

OnPlayerConnected

Called on the server whenever a new player has successfully connected.

OnPlayerDisconnected

Called on the server whenever a player is disconnected from the server.

OnSerializeNetworkView

Used to customize synchronization of variables in a script watched by a
network view.

OnServerInitialized

Called on the server whenever a Network.InitializeServer was invoked and has
completed.

Leave feedback
Obsolete

Description
This data structure contains information on a message just received from the network.
It reveals where it came from, what time it was send and what network view sent it.

Leave feedback
Obsolete

Description
The NetworkPlayer is a data structure with which you can locate another player over the network.
With this you can, for example, send a message directly to another player.

Leave feedback
Obsolete

Description
The network view is the binding material of multiplayer games.
With this you can de ne exactly what is to be synchronized over the network and how it should be done. Game
objects can have NetworkView components which can be con gured to watch other components for the object.
For more information see the Network View manual page and the component reference page.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Obsolete

Description
The NetworkViewID is a unique identi er for a network view instance in a multiplayer game.
It is imporatant that this is a unique number accross all clients and that they can generate these numbers
themselves, or else network synchronization will break.

Leave feedback

Description
Base class for all objects Unity can reference.
Any public variable you make that derives from Object gets shown in the inspector as a drop target, allowing you
to set the value from the GUI. UnityEngine.Object is the base class of all built-in Unity objects.
Although Object is a class it is not intended to be used widely in script. However as an example Object is used in
the Resources class. See Resources.LoadAll which has [[Object[]]] as a return.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
OcclusionArea is an area in which occlusion culling is performed.

Properties
center

Center of the occlusion area relative to the transform.

size

Size that the occlusion area will have.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
The portal for dynamically changing occlusion at runtime.

Properties
open

Gets / sets the portal's open state.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game

object.
SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Information about a particle collision.

Properties
colliderComponent

The Collider or Collider2D for the GameObject struck by the particles.

intersection

Intersection point of the collision in world coordinates.

normal

Geometry normal at the intersection point of the collision.

velocity

Incident velocity at the intersection point of the collision.

Leave feedback

Description
Method extension for Physics in Particle System.

Static Methods
GetCollisionEvents

Get the particle collision events for a GameObject. Returns the number of
events written to the array.

GetSafeCollisionEventSize

Safe array size for use with ParticleSystem.GetCollisionEvents.

GetSafeTriggerParticlesSize

Safe array size for use with ParticleSystem.GetTriggerParticles.

GetTriggerParticles

Get the particles that met the condition in the particle trigger module. Returns
the number of particles written to the array.

SetTriggerParticles

Write modi ed particles back to the particle system, during a call to
OnParticleTrigger.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for Particle Systems (Shuriken).
Shuriken is a powerful and versatile Particle System component.
General parameters
The Particle System's general parameters are kept inside a special Main module. These parameters are visible in
the Inspector above all the other modules:

In script, these parameters are accessible through ParticleSystem.main.
Module e ect multipliers
Every module has special multiplier properties that allow you to change the overall e ect of a curve without
having to edit the curve itself. These multiplier properties are all named after the curve they a ect - for instance
ParticleSystem.emission.rateMultiplier controls the overall e ect of ParticleSystem.emission.rate in a given
system.
Constant value shorthand
Parameters support a shorthand notation for simple constant values. To set a constant value for a parameter, all

you need to do is assign a number to it. It is not necessary to create a MinMaxCurve or MinMaxGradient object in
the ParticleSystemCurveMode.Constant mode.
For example, instead of:
ParticleSystem.emission.rate = new ParticleSystem.MinMaxCurve(5.0f);
write:
ParticleSystem.emission.rate = 5.0f;
Performance note: When setting properties on particle modules, the settings are passed immediately into native
code. This gives the best performance. This means that setting properties on a module struct doesn't set
something in script that requires setting back to the Particle System; it all happens automatically.
See Also: Particle.

Properties
collision

Script interface for the Particle System collision module.

colorBySpeed

Script interface for the Particle System color by lifetime module.

colorOverLifetime

Script interface for the Particle System color over lifetime module.

customData

Script interface for the Particle System Custom Data module.

emission

Script interface for the Particle System emission module.

externalForces

Script interface for the Particle System external forces module.

forceOverLifetime

Script interface for the Particle System force over lifetime module.

inheritVelocity

Script interface for the Particle System velocity inheritance module.

isEmitting

Determines whether the Particle System is emitting particles. A Particle
System may stop emitting when its emission module has nished, it has
been paused or if the system has been stopped using Stop with the
StopEmitting ag. Resume emitting by calling Play.

isPaused

Determines whether the Particle System is paused.

isPlaying

Determines whether the Particle System is playing.

isStopped

Determines whether the Particle System is stopped.

lights

Script interface for the Particle System Lights module.

limitVelocityOverLifetime

Script interface for the Particle System Limit Velocity over Lifetime module.

main

Access the main Particle System settings.

noise

Script interface for the Particle System Noise module.

particleCount

The current number of particles (Read Only).

proceduralSimulationSupported

Does this system support Procedural Simulation?

randomSeed

Override the random seed used for the Particle System emission.

rotationBySpeed

Script interface for the Particle System Rotation by Speed module.

rotationOverLifetime

Script interface for the Particle System Rotation over Lifetime module.

shape

Script interface for the Particle System Shape module.

sizeBySpeed

Script interface for the Particle System Size by Speed module.

sizeOverLifetime

Script interface for the Particle System Size over Lifetime module.

subEmitters

Script interface for the Particle System Sub Emitters module.

textureSheetAnimation

Script interface for the Particle System Texture Sheet Animation module.

time

Playback position in seconds.

trails

Script interface for the Particle System Trails module.

trigger

Script interface for the Particle System Trigger module.

useAutoRandomSeed

Controls whether the Particle System uses an automatically-generated
random number to seed the random number generator.

velocityOverLifetime

Script interface for the Particle System Velocity over Lifetime module.

Public Methods
Clear

Remove all particles in the Particle System.

Emit

Emit count particles immediately.

GetCustomParticleData

Get a stream of custom per-particle data.

GetParticles

Gets the particles of this Particle System.

IsAlive

Does the Particle System contain any live particles, or will it produce more?

Pause

Pauses the system so no new particles are emitted and the existing particles are not
updated.

Play

Starts the Particle System.

SetCustomParticleData

Set a stream of custom per-particle data.

SetParticles

Sets the particles of this Particle System.

Simulate

Fast-forwards the Particle System by simulating particles over the given period of

time, then pauses it.
Stop

Stops playing the Particle System using the supplied stop behaviour.

TriggerSubEmitter

Triggers the speci ed sub emitter on all particles of the Particle System.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for a Burst.
A burst is a particle emission event, where a number of particles are all emitted at the same time. See Also:
ParticleSystem.emission, ParticleSystem.emissionModule.SetBursts, ParticleSystem.emissionModule.GetBursts.

Properties
count

Number of particles to be emitted.

cycleCount

How many times to play the burst. (0 means in nitely).

maxCount

Maximum number of particles to be emitted.

minCount

Minimum number of particles to be emitted.

probability

The chance that the burst will trigger.

repeatInterval

How often to repeat the burst, in seconds.

time

The time that each burst occurs.

Constructors
ParticleSystem.Burst

Construct a new Burst with a time and count.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Collision module.
See Also: ParticleSystem, ParticleSystem.collision.

Properties
bounce

How much force is applied to each particle after a collision.

bounceMultiplier

Change the bounce multiplier.

colliderForce

How much force is applied to a Collider when hit by particles from
this Particle System.

collidesWith

Control which layers this particle system collides with.

dampen

How much speed is lost from each particle after a collision.

dampenMultiplier

Change the dampen multiplier.

enabled

Enable/disable the Collision module.

enableDynamicColliders

Allow particles to collide with dynamic colliders when using world
collision mode.

lifetimeLoss

How much a particle's lifetime is reduced after a collision.

lifetimeLossMultiplier

Change the lifetime loss multiplier.

maxCollisionShapes

The maximum number of collision shapes that will be considered for
particle collisions. Excess shapes will be ignored. Terrains take
priority.

maxKillSpeed

Kill particles whose speed goes above this threshold, after a collision.

maxPlaneCount

The maximum number of planes it is possible to set as colliders.

minKillSpeed

Kill particles whose speed falls below this threshold, after a collision.

mode

Choose between 2D and 3D world collisions.

multiplyColliderForceByCollisionAngle

If true, the collision angle is considered when applying forces from
particles to Colliders.

multiplyColliderForceByParticleSize

If true, particle sizes are considered when applying forces to Colliders.

multiplyColliderForceByParticleSpeed

If true, particle speeds are considered when applying forces to

Colliders.
quality

Speci es the accuracy of particle collisions against colliders in the
Scene.

radiusScale

A multiplier applied to the size of each particle before collisions are
processed.

sendCollisionMessages

Send collision callback messages.

type

The type of particle collision to perform.

voxelSize

Size of voxels in the collision cache.

Public Methods
GetPlane

Get a collision plane associated with this particle system.

SetPlane

Set a collision plane to be used with this particle system.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Color By Speed module.
See Also: ParticleSystem, ParticleSystem.colorBySpeed.

Properties
color

The gradient controlling the particle colors.

enabled

Enable/disable the Color By Speed module.

range

Apply the color gradient between these minimum and maximum speeds.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Color Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.colorOverLifetime.

Properties
color

The gradient controlling the particle colors.

enabled

Enable/disable the Color Over Lifetime module.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Custom Data module.
See Also: ParticleSystem, ParticleSystem.customData.

Properties
enabled

Enable/disable the Custom Data module.

Public Methods
GetColor

Get a MinMaxGradient, that is being used to generate custom HDR color data.

GetMode

Find out the type of custom data that is being generated for the chosen data
stream.

GetVector

Get a MinMaxCurve, that is being used to generate custom data.

GetVectorComponentCount

Query how many MinMaxCurve elements are being used to generate this
stream of custom data.

SetColor

Set a MinMaxGradient, in order to generate custom HDR color data.

SetMode

Choose the type of custom data to generate for the chosen data stream.

SetVector

Set a MinMaxCurve, in order to generate custom data.

SetVectorComponentCount

Specify how many curves are used to generate custom data for this stream.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Emission module.
See Also: ParticleSystem, ParticleSystem.emission.

Properties
burstCount

The current number of bursts.

enabled

Enable/disable the Emission module.

rateOverDistance

The rate at which new particles are spawned, over distance.

rateOverDistanceMultiplier

Change the rate over distance multiplier.

rateOverTime

The rate at which new particles are spawned, over time.

rateOverTimeMultiplier

Change the rate over time multiplier.

Public Methods
GetBurst

Get a single burst from the array of bursts.

GetBursts

Get the burst array.

SetBurst

Set a single burst in the array of bursts.

SetBursts

Set the burst array.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for Particle System emission parameters.

Properties
angularVelocity

Override the angular velocity of emitted particles.

angularVelocity3D

Override the 3D angular velocity of emitted particles.

applyShapeToPosition

When overriding the position of particles, setting this ag to true allows you to retain
the in uence of the shape module.

axisOfRotation

Override the axis of rotation of emitted particles.

position

Override the position of emitted particles.

randomSeed

Override the random seed of emitted particles.

rotation

Override the rotation of emitted particles.

rotation3D

Override the 3D rotation of emitted particles.

startColor

Override the initial color of emitted particles.

startLifetime

Override the lifetime of emitted particles.

startSize

Override the initial size of emitted particles.

startSize3D

Override the initial 3D size of emitted particles.

velocity

Override the velocity of emitted particles.

Public Methods
ResetAngularVelocity

Reverts angularVelocity and angularVelocity3D back to the values speci ed in the
inspector.

ResetAxisOfRotation

Revert the axis of rotation back to the value speci ed in the inspector.

ResetPosition

Revert the position back to the value speci ed in the inspector.

ResetRandomSeed

Revert the random seed back to the value speci ed in the inspector.

ResetRotation

Reverts rotation and rotation3D back to the values speci ed in the inspector.

ResetStartColor

Revert the initial color back to the value speci ed in the inspector.

ResetStartLifetime

Revert the lifetime back to the value speci ed in the inspector.

ResetStartSize

Revert the initial size back to the value speci ed in the inspector.

ResetVelocity

Revert the velocity back to the value speci ed in the inspector.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the External Forces module.
See Also: ParticleSystem, ParticleSystem.externalForces.

Properties
enabled

Enable/disable the External Forces module.

in uenceFilter

Apply all Force Fields belonging to a matching layer to this Particle System.

multiplier

Multiplies the magnitude of applied external forces.

Public Methods
IsA ectedBy

Determines whether any particles are inside the in uence of a Force Field.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Force Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.forceOverLifetime.

Properties
enabled

Enable/disable the Force Over Lifetime module.

randomized

When randomly selecting values between two curves or constants, this ag will cause a
new random force to be chosen on each frame.

space

Are the forces being applied in local or world space?

x

The curve de ning particle forces in the X axis.

xMultiplier

Change the X axis mulutiplier.

y

The curve de ning particle forces in the Y axis.

yMultiplier

Change the Y axis multiplier.

z

The curve de ning particle forces in the Z axis.

zMultiplier

Change the Z axis multiplier.

Leave feedback
SWITCH TO MANUAL

Description
The Inherit Velocity Module controls how the velocity of the emitter is transferred to the particles as they are
emitted.
NOTE: The inherit velocity module only has an e ect if the Particle System is set to simulate in world space. If the
system is simulating in local space, this module is ignored. See Also: ParticleSystem,
ParticleSystem.inheritVelocity.

Properties
curve

Curve to de ne how much emitter velocity is applied during the lifetime of a particle.

curveMultiplier

Change the curve multiplier.

enabled

Enable/disable the InheritVelocity module.

mode

How to apply emitter velocity to particles.

Leave feedback
SWITCH TO MANUAL

Description
Access the ParticleSystem Lights Module.
The Lights module allows you to attach real-time Lights to a percentage of your particles.
The Lights Module is a simple and powerful module that allows particles to cast light onto their environment
easily. Lights can inherit properties from the particles they are attached to, such as color and size. Point and Spot
Lights are supported, including shadow casting and Light cookies.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public Light myLight;

void Start()
{
ParticleSystem ps = GetComponent();
var lights = ps.lights;
lights.enabled = true;
lights.ratio = 0.5f;
lights.light = myLight;
}
}

Properties
alphaA ectsIntensity

Toggle whether the particle alpha gets multiplied by the light intensity, when
computing the nal light intensity.

enabled

Enable/disable the Lights module.

intensity

De ne a curve to apply custom intensity scaling to particle lights.

intensityMultiplier

Intensity multiplier.

light

Select what Light Prefab you want to base your particle lights on.

maxLights

Set a limit on how many lights this Module can create.

range

De ne a curve to apply custom range scaling to particle lights.

rangeMultiplier

Range multiplier.

ratio

Choose what proportion of particles will receive a dynamic light.

sizeA ectsRange

Toggle where the particle size will be multiplied by the light range, to determine the
nal light range.

useParticleColor

Toggle whether the particle lights will have their color multiplied by the particle
color.

useRandomDistribution

Randomly assign lights to new particles based on
ParticleSystem.LightsModule.ratio.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Limit Velocity Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.limitVelocityOverLifetime.

Properties
dampen

Controls how much the velocity that exceeds the velocity limit should be
dampened.

drag

Controls the amount of drag applied to the particle velocities.

dragMultiplier

Change the drag multiplier.

enabled

Enable/disable the Limit Force Over Lifetime module.

limit

Maximum velocity curve, when not using one curve per axis.

limitMultiplier

Change the limit multiplier.

limitX

Maximum velocity curve for the X axis.

limitXMultiplier

Change the limit multiplier on the X axis.

limitY

Maximum velocity curve for the Y axis.

limitYMultiplier

Change the limit multiplier on the Y axis.

limitZ

Maximum velocity curve for the Z axis.

limitZMultiplier

Change the limit multiplier on the Z axis.

multiplyDragByParticleSize

Adjust the amount of drag applied to particles, based on their sizes.

multiplyDragByParticleVelocity

Adjust the amount of drag applied to particles, based on their speeds.

separateAxes

Set the velocity limit on each axis separately.

space

Speci es if the velocity limits are in local space (rotated with the transform)
or world space.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the main module.
See Also: ParticleSystem, ParticleSystem.main.

Properties
cullingMode

Con gure whether the Particle System will still be simulated each frame, when it is
o screen.

customSimulationSpace

Simulate particles relative to a custom transform component.

duration

The duration of the particle system in seconds.

emitterVelocityMode

Control how the Particle System calculates its velocity, when moving in the world.

ipRotation

Makes some particles spin in the opposite direction.

gravityModi er

Scale applied to the gravity, de ned by Physics.gravity.

gravityModi erMultiplier

Change the gravity multiplier.

loop

Is the particle system looping?

maxParticles

The maximum number of particles to emit.

playOnAwake

If set to true, the particle system will automatically start playing on startup.

prewarm

When looping is enabled, this controls whether this particle system will look like it
has already simulated for one loop when rst becoming visible.

ringBu erLoopRange

When ParticleSystem.MainModule.ringBu erMode is set to loop, this value de nes
the proportion of the particle life that is looped.

ringBu erMode

Con gure the Particle System to not kill its particles when their lifetimes are
exceeded.

scalingMode

Control how the particle system's Transform Component is applied to the particle
system.

simulationSpace

This selects the space in which to simulate particles. It can be either world or local
space.

simulationSpeed

Override the default playback speed of the Particle System.

startColor

The initial color of particles when emitted.

startDelay

Start delay in seconds.

startDelayMultiplier

Start delay multiplier in seconds.

startLifetime

The total lifetime in seconds that each new particle will have.

startLifetimeMultiplier

Start lifetime multiplier.

startRotation

The initial rotation of particles when emitted.

startRotation3D

A ag to enable 3D particle rotation.

startRotationMultiplier

The initial rotation multiplier of particles when emitted.

startRotationX

The initial rotation of particles around the X axis when emitted.

startRotationXMultiplier

The initial rotation multiplier of particles around the X axis when emitted.

startRotationY

The initial rotation of particles around the Y axis when emitted.

startRotationYMultiplier

The initial rotation multiplier of particles around the Y axis when emitted.

startRotationZ

The initial rotation of particles around the Z axis when emitted.

startRotationZMultiplier

The initial rotation multiplier of particles around the Z axis when emitted.

startSize

The initial size of particles when emitted.

startSize3D

A ag to enable specifying particle size individually for each axis.

startSizeMultiplier

A multiplier of the initial size of particles when emitted.

startSizeX

The initial size of particles along the X axis when emitted.

startSizeXMultiplier

The initial size multiplier of particles along the X axis when emitted.

startSizeY

The initial size of particles along the Y axis when emitted.

startSizeYMultiplier

The initial size multiplier of particles along the Y axis when emitted.

startSizeZ

The initial size of particles along the Z axis when emitted.

startSizeZMultiplier

The initial size multiplier of particles along the Z axis when emitted.

startSpeed

The initial speed of particles when emitted.

startSpeedMultiplier

A multiplier of the initial speed of particles when emitted.

stopAction

Select whether to Disable or Destroy the GameObject, or to call the
OnParticleSystemStopped script Callback, when the Particle System is stopped and
all particles have died.

useUnscaledTime

When true, use the unscaled delta time to simulate the Particle System. Otherwise,
use the scaled delta time.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for a Min-Max Curve.
MinMaxCurve describes functions taking a value between a minimum and maximum limit and returning a value
based on ParticleSystem.MinMaxCurve.mode. Depending on the mode, the value returned may be randomized.
For modes requiring curves, the value returned is dependent on one or two curves designed in the ParticleSystem
Inspector, that can be evaluated to a single value between -n and n, where n is a constant also set in the
Inspector. See ParticleSystemCurveMode for more information.
See Also: ParticleSystem.

using UnityEngine;

// This example shows setting a constant rate value.
public class ConstantRateExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.EmissionModule emissionModule;

void Start()
{
// Get the system and the emission module.
myParticleSystem = GetComponent();
emissionModule = myParticleSystem.emission;

GetValue();
SetValue();
}

void GetValue()
{
print("The constant value is " + emissionModule.rate.constant);
}

void SetValue()

{
emissionModule.rate = 10.0f;
}
}

using UnityEngine;

// This example shows using 2 constants to drive the rate.
public class TwoConstantsRateExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.EmissionModule emissionModule;

void Start()
{
// Get the system and the emission module.
myParticleSystem = GetComponent();
emissionModule = myParticleSystem.emission;

GetValue();
SetValue();
}

void GetValue()
{
print(string.Format("The constant values are: min {0} max {1}.", emissio
}

void SetValue()
{
emissionModule.rate = new ParticleSystem.MinMaxCurve(0.0f, 10.0f);
}
}

using UnityEngine;

// This example shows using a curve to drive the rate.
public class CurveRateExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.EmissionModule emissionModule;

// We can "scale" the curve with this value. It gets multiplied by the curve
public float scalar = 1.0f;

AnimationCurve ourCurve;

void Start()
{
// Get the system and the emission module.
myParticleSystem = GetComponent();
emissionModule = myParticleSystem.emission;

// A simple linear curve.
ourCurve = new AnimationCurve();
ourCurve.AddKey(0.0f, 0.0f);
ourCurve.AddKey(1.0f, 1.0f);

// Apply the curve.
emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurve);

// In 5 seconds we will modify the curve.
Invoke("ModifyCurve", 5.0f);
}

void ModifyCurve()
{
// Add a key to the current curve.
ourCurve.AddKey(0.5f, 0.0f);

// Apply the changed curve.
emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurve);

}
}

using UnityEngine;

// This example shows using 2 curves to drive the rate.
public class TwoCurveRateExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.EmissionModule emissionModule;

AnimationCurve ourCurveMin;
AnimationCurve ourCurveMax;

// We can "scale" the curves with this value. It gets multiplied by the curv
public float scalar = 1.0f;

void Start()
{
// Get the system and the emission module.
myParticleSystem = GetComponent();
emissionModule = myParticleSystem.emission;

// A horizontal straight line at value 1.
ourCurveMin = new AnimationCurve();
ourCurveMin.AddKey(0.0f, 1.0f);
ourCurveMin.AddKey(1.0f, 1.0f);

// A horizontal straight line at value 0.5.
ourCurveMax = new AnimationCurve();
ourCurveMax.AddKey(0.0f, 0.5f);
ourCurveMax.AddKey(1.0f, 0.5f);

// Apply the curves.
emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurveMin

// In 5 seconds we will modify the curve.
Invoke("ModifyCurve", 5.0f);
}

void ModifyCurve()
{
// Create a "pinch" point.
ourCurveMin.AddKey(0.5f, 0.7f);
ourCurveMax.AddKey(0.5f, 0.6f);

// Apply the changed curve.
emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurveMin
}
}

Properties
constant

Set the constant value.

constantMax

Set a constant for the upper bound.

constantMin

Set a constant for the lower bound.

curve

Set the curve.

curveMax

Set a curve for the upper bound.

curveMin

Set a curve for the lower bound.

curveMultiplier

Set a multiplier to be applied to the curves.

mode

Set the mode that the min-max curve will use to evaluate values.

Constructors
ParticleSystem.MinMaxCurve

A single constant value for the entire curve.

Public Methods
Evaluate

Manually query the curve to calculate values based on what mode it is in.

Leave feedback
SWITCH TO MANUAL

Description
MinMaxGradient contains two Gradients, and returns a Color based on ParticleSystem.MinMaxGradient.mode.
Depending on the mode, the Color returned may be randomized. Gradients are edited via the ParticleSystem
Inspector once a ParticleSystemGradientMode requiring them has been selected. Some modes do not require
gradients, only colors.
See Also: ParticleSystem.

using UnityEngine;

// This example shows setting a constant color value.
public class ConstantColorExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.ColorOverLifetimeModule colorModule;

void Start()
{
// Get the system and the color module.
myParticleSystem = GetComponent();
colorModule = myParticleSystem.colorOverLifetime;

GetValue();
SetValue();
}

void GetValue()
{
print("The constant color is " + colorModule.color.color);
}

void SetValue()
{
colorModule.color = Color.red;

}
}

using UnityEngine;

// This example shows using 2 colors to drive the color over lifetime.
public class TwoConstantColorsExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.ColorOverLifetimeModule colorModule;

void Start()
{
// Get the system and the color module.
myParticleSystem = GetComponent();
colorModule = myParticleSystem.colorOverLifetime;

GetValue();
SetValue();
}

void GetValue()
{
print(string.Format("The constant values are: min {0} max {1}.", colorMo
}

void SetValue()
{
colorModule.color = new ParticleSystem.MinMaxGradient(Color.green, Color
}
}

using UnityEngine;

// This example shows using a gradient to drive the color over lifetime.

public class GradientColorExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.ColorOverLifetimeModule colorModule;
Gradient ourGradient;

void Start()
{
// Get the system and the color module.
myParticleSystem = GetComponent();
colorModule = myParticleSystem.colorOverLifetime;

// A simple 2 color gradient with a fixed alpha of 1.0f.
float alpha = 1.0f;
ourGradient = new Gradient();
ourGradient.SetKeys(
new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), ne
new GradientAlphaKey[] { new GradientAlphaKey(alpha, 0.0f), new Grad
);

// Apply the gradient.
colorModule.color = ourGradient;

// In 5 seconds we will modify the gradient.
Invoke("ModifyGradient", 5.0f);
}

void ModifyGradient()
{
// Reduce the alpha
float alpha = 0.5f;
ourGradient.SetKeys(
new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), ne
new GradientAlphaKey[] { new GradientAlphaKey(alpha, 0.0f), new Grad
);

// Apply the changed gradient.
colorModule.color = ourGradient;
}
}

using UnityEngine;

// This example shows using 2 gradients to drive the color over lifetime.
public class TwoGradientColorExample : MonoBehaviour
{
ParticleSystem myParticleSystem;
ParticleSystem.ColorOverLifetimeModule colorModule;

Gradient ourGradientMin;
Gradient ourGradientMax;

void Start()
{
// Get the system and the emission module.
myParticleSystem = GetComponent();
colorModule = myParticleSystem.colorOverLifetime;

// A simple 2 color gradient with a fixed alpha of 1.0f.
float alpha1 = 1.0f;
ourGradientMin = new Gradient();
ourGradientMin.SetKeys(
new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), ne
new GradientAlphaKey[] { new GradientAlphaKey(alpha1, 0.0f), new Gra
);

// A simple 2 color gradient with a fixed alpha of 0.0f.
float alpha2 = 0.0f;
ourGradientMax = new Gradient();
ourGradientMax.SetKeys(
new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), ne
new GradientAlphaKey[] { new GradientAlphaKey(alpha2, 0.0f), new Gra
);

// Apply the gradients.
colorModule.color = new ParticleSystem.MinMaxGradient(ourGradientMin, ou

// In 5 seconds we will modify the gradient.

Invoke("ModifyGradient", 5.0f);
}

void ModifyGradient()
{
// Reduce the alpha
float alpha = 0.5f;
ourGradientMin.SetKeys(
new GradientColorKey[] { new GradientColorKey(Color.green, 0.0f), ne
new GradientAlphaKey[] { new GradientAlphaKey(alpha, 0.0f), new Grad
);

// Apply the changed gradients.
colorModule.color = new ParticleSystem.MinMaxGradient(ourGradientMin, ou
}
}

Properties
color

Set a constant color.

colorMax

Set a constant color for the upper bound.

colorMin

Set a constant color for the lower bound.

gradient

Set the gradient.

gradientMax

Set a gradient for the upper bound.

gradientMin

Set a gradient for the lower bound.

mode

Set the mode that the min-max gradient will use to evaluate colors.

Constructors
ParticleSystem.MinMaxGradient

A single constant color for the entire gradient.

Public Methods
Evaluate

Manually query the gradient to calculate colors based on what mode it is in.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Noise Module.
The Noise Module allows you to apply turbulence to the movement of your particles. Use the low quality settings
to create computationally e cient Noise, or simulate smoother, richer Noise with the higher quality settings. You
can also choose to de ne the behavior of the Noise individually for each axis.
See Also: ParticleSystem, ParticleSystem.noise.

Properties
damping

Higher frequency noise will reduce the strength by a proportional amount, if enabled.

enabled

Enable/disable the Noise module.

frequency

Low values create soft, smooth noise, and high values create rapidly changing noise.

octaveCount

Layers of noise that combine to produce nal noise.

octaveMultiplier

When combining each octave, scale the intensity by this amount.

octaveScale

When combining each octave, zoom in by this amount.

positionAmount

How much the noise a ects the particle positions.

quality

Generate 1D, 2D or 3D noise.

remap

De ne how the noise values are remapped.

remapEnabled

Enable remapping of the nal noise values, allowing for noise values to be translated
into di erent values.

remapMultiplier

Remap multiplier.

remapX

De ne how the noise values are remapped on the X axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

remapXMultiplier

X axis remap multiplier.

remapY

De ne how the noise values are remapped on the Y axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

remapYMultiplier

Y axis remap multiplier.

remapZ

De ne how the noise values are remapped on the Z axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

remapZMultiplier

Z axis remap multiplier.

rotationAmount

How much the noise a ects the particle rotation, in degrees per second.

scrollSpeed

Scroll the noise map over the particle system.

scrollSpeedMultiplier

Scroll speed multiplier.

separateAxes

Control the noise separately for each axis.

sizeAmount

How much the noise a ects the particle sizes, applied as a multiplier on the size of
each particle.

strength

How strong the overall noise e ect is.

strengthMultiplier

Strength multiplier.

strengthX

De ne the strength of the e ect on the X axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

strengthXMultiplier

X axis strength multiplier.

strengthY

De ne the strength of the e ect on the Y axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

strengthYMultiplier

Y axis strength multiplier.

strengthZ

De ne the strength of the e ect on the Z axis, when using the
ParticleSystem.NoiseModule.separateAxes option.

strengthZMultiplier

Z axis strength multiplier.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for a Particle.
See Also: ParticleSystem, ParticleSystem.GetParticles, ParticleSystem.SetParticles.

Properties
angularVelocity

The angular velocity of the particle.

angularVelocity3D

The 3D angular velocity of the particle.

animatedVelocity

The animated velocity of the particle.

axisOfRotation

Mesh particles will rotate around this axis.

position

The position of the particle.

randomSeed

The random seed of the particle.

remainingLifetime

The remaining lifetime of the particle.

rotation

The rotation of the particle.

rotation3D

The 3D rotation of the particle.

startColor

The initial color of the particle. The current color of the particle is calculated procedurally
based on this value and the active color modules.

startLifetime

The starting lifetime of the particle.

startSize

The initial size of the particle. The current size of the particle is calculated procedurally
based on this value and the active size modules.

startSize3D

The initial 3D size of the particle. The current size of the particle is calculated
procedurally based on this value and the active size modules.

totalVelocity

The total velocity of the particle.

velocity

The velocity of the particle.

Public Methods
GetCurrentColor

Calculate the current color of the particle by applying the relevant curves to its startColor
property.

GetCurrentSize

Calculate the current size of the particle by applying the relevant curves to its startSize
property.

GetCurrentSize3D

Calculate the current 3D size of the particle by applying the relevant curves to its
startSize3D property.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Rotation By Speed module.
See Also: ParticleSystem, ParticleSystem.rotationBySpeed.

Properties
enabled

Enable/disable the Rotation By Speed module.

range

Apply the rotation curve between these minimum and maximum speeds.

separateAxes

Set the rotation by speed on each axis separately.

x

Rotation by speed curve for the X axis.

xMultiplier

Speed multiplier along the X axis.

y

Rotation by speed curve for the Y axis.

yMultiplier

Speed multiplier along the Y axis.

z

Rotation by speed curve for the Z axis.

zMultiplier

Speed multiplier along the Z axis.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Rotation Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.rotationOverLifetime.

Properties
enabled

Enable/disable the Rotation Over Lifetime module.

separateAxes

Set the rotation over lifetime on each axis separately.

x

Rotation over lifetime curve for the X axis.

xMultiplier

Rotation multiplier around the X axis.

y

Rotation over lifetime curve for the Y axis.

yMultiplier

Rotation multiplier around the Y axis.

z

Rotation over lifetime curve for the Z axis.

zMultiplier

Rotation multiplier around the Z axis.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Shape module.
See Also: ParticleSystem, ParticleSystem.shape.

Properties
alignToDirection

Align particles based on their initial direction of travel.

angle

Angle of the cone to emit particles from.

arc

Angle of the circle arc to emit particles from.

arcMode

The mode used for generating particles around the arc.

arcSpeed

In animated modes, this determines how quickly the particle emission position
moves around the arc.

arcSpeedMultiplier

A multiplier of the arc speed of the particle emission shape.

arcSpread

Control the gap between particle emission points around the arc.

boxThickness

Thickness of the box to emit particles from.

donutRadius

The radius of the Donut shape to emit particles from.

enabled

Enable/disable the Shape module.

length

Length of the cone to emit particles from.

mesh

Mesh to emit particles from.

meshMaterialIndex

Emit particles from a single material of a mesh.

meshRenderer

MeshRenderer to emit particles from.

meshShapeType

Where on the mesh to emit particles from.

meshSpawnMode

The mode used for generating particles on a mesh.

meshSpawnSpeed

In animated modes, this determines how quickly the particle emission position
moves across the mesh.

meshSpawnSpeedMultiplier

A multiplier of the mesh spawn speed.

meshSpawnSpread

Control the gap between particle emission points across the mesh.

normalO set

Move particles away from the surface of the source mesh.

position

Apply an o set to the position from which particles are emitted.

radius

Radius of the shape to emit particles from.

radiusMode

The mode used for generating particles along the radius.

radiusSpeed

In animated modes, this determines how quickly the particle emission position
moves along the radius.

radiusSpeedMultiplier

A multiplier of the radius speed of the particle emission shape.

radiusSpread

Control the gap between particle emission points along the radius.

radiusThickness

Radius thickness of the shape's edge from which to emit particles.

randomDirectionAmount

Randomizes the starting direction of particles.

randomPositionAmount

Randomizes the starting position of particles.

rotation

Apply a rotation to the shape from which particles are emitted.

scale

Apply scale to the shape from which particles are emitted.

shapeType

Type of shape to emit particles from.

skinnedMeshRenderer

SkinnedMeshRenderer to emit particles from.

sphericalDirectionAmount

Makes particles move in a spherical direction from their starting point.

sprite

Sprite to emit particles from.

spriteRenderer

SpriteRenderer to emit particles from.

texture

Selects a texture to be used for tinting particle start colors.

textureAlphaA ectsParticles

When enabled, the alpha channel of the texture is applied to the particle alpha
when spawned.

textureBilinearFiltering

When enabled, 4 neighboring samples are taken from the texture, and
combined to give the nal particle value.

textureClipChannel

Selects which channel of the texture is used for discarding particles.

textureClipThreshold

Discards particles when they are spawned on an area of the texture with a
value lower than this threshold.

textureColorA ectsParticles

When enabled, the RGB channels of the texture are applied to the particle color
when spawned.

textureUVChannel

When using a Mesh as a source shape type, this option controls which UV
channel on the Mesh is used for reading the source texture.

useMeshColors

Modulate the particle colors with the vertex colors, or the material color if no

vertex colors exist.
useMeshMaterialIndex

Emit particles from a single material, or the whole mesh.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Size By Speed module.
See Also: ParticleSystem, ParticleSystem.sizeBySpeed.

Properties
enabled

Enable/disable the Size By Speed module.

range

Apply the size curve between these minimum and maximum speeds.

separateAxes

Set the size by speed on each axis separately.

size

Curve to control particle size based on speed.

sizeMultiplier

Size multiplier.

x

Size by speed curve for the X axis.

xMultiplier

X axis size multiplier.

y

Size by speed curve for the Y axis.

yMultiplier

Y axis size multiplier.

z

Size by speed curve for the Z axis.

zMultiplier

Z axis size multiplier.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Size Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.sizeOverLifetime.

Properties
enabled

Enable/disable the Size Over Lifetime module.

separateAxes

Set the size over lifetime on each axis separately.

size

Curve to control particle size based on lifetime.

sizeMultiplier

Size multiplier.

x

Size over lifetime curve for the X axis.

xMultiplier

X axis size multiplier.

y

Size over lifetime curve for the Y axis.

yMultiplier

Y axis size multiplier.

z

Size over lifetime curve for the Z axis.

zMultiplier

Z axis size multiplier.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Sub Emitters module.
See Also: ParticleSystem, ParticleSystem.subEmitters.

Properties
enabled

Enable/disable the Sub Emitters module.

subEmittersCount

The total number of sub-emitters.

Public Methods
AddSubEmitter

Add a new sub-emitter.

GetSubEmitterEmitProbability

Returns the probability that the sub-emitter emits particles.

GetSubEmitterProperties

Get the properties of the sub-emitter at the given index.

GetSubEmitterSystem

Get the sub-emitter Particle System at the given index.

GetSubEmitterType

Get the type of the sub-emitter at the given index.

RemoveSubEmitter

Remove a sub-emitter from the given index in the array.

SetSubEmitterEmitProbability

Sets the probability that the sub-emitter emits particles.

SetSubEmitterProperties

Set the properties of the sub-emitter at the given index.

SetSubEmitterSystem

Set the Particle System to use as the sub-emitter at the given index.

SetSubEmitterType

Set the type of the sub-emitter at the given index.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Texture Sheet Animation module.
This module allows you to add animations to your particle textures. This is achieved by authoring ipbook
textures, which look like this:

Each numbered region represents a frame of the animation, and must be distributed evenly across the texture.
Select a variable below to see script examples. You may want to use this texture on your particle system with each
example, to see how the module works.
See Also: ParticleSystem, ParticleSystem.textureSheetAnimation.

Properties
animation

Speci es the animation type.

cycleCount

Speci es how many times the animation will loop during the lifetime of the
particle.

enabled

Enable/disable the Texture Sheet Animation module.

fps

Control how quickly the animation plays.

frameOverTime

Curve to control which frame of the texture sheet animation to play.

frameOverTimeMultiplier

Frame over time mutiplier.

mode

Select whether the animated texture information comes from a grid of frames on
a single texture, or from a list of Sprite objects.

numTilesX

De nes the tiling of the texture in the X axis.

numTilesY

De nes the tiling of the texture in the Y axis.

rowIndex

Explicitly select which row of the texture sheet is used, when
ParticleSystem.TextureSheetAnimationModule.useRandomRow is set to false.

speedRange

Specify how particle speeds are mapped to the animation frames.

spriteCount

The total number of sprites.

startFrame

De ne a random starting frame for the texture sheet animation.

startFrameMultiplier

Starting frame multiplier.

timeMode

Select whether the playback is based on mapping a curve to the lifetime of each
particle, by using the particle speeds, or if playback simply uses a constant frames
per second.

useRandomRow

Use a random row of the texture sheet for each particle emitted.

uvChannelMask

Choose which UV channels will receive texture animation.

Public Methods
AddSprite

Add a new Sprite.

GetSprite

Get the Sprite at the given index.

RemoveSprite

Remove a Sprite from the given index in the array.

SetSprite

Set the Sprite at the given index.

Leave feedback
SWITCH TO MANUAL

Description
Access the particle system trails module.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
void Start()
{
ParticleSystem ps = GetComponent();
var trails = ps.trails;
trails.enabled = true;
trails.ratio = 0.5f;
}
}

Properties
attachRibbonsToTransform

Adds an extra position to each ribbon, connecting it to the location of the
Transform Component.

colorOverLifetime

The gradient controlling the trail colors during the lifetime of the attached
particle.

colorOverTrail

The gradient controlling the trail colors over the length of the trail.

dieWithParticles

If enabled, Trails will disappear immediately when their owning particle dies.
Otherwise, the trail will persist until all its points have naturally expired, based
on its lifetime.

enabled

Enable/disable the Trail module.

generateLightingData

Con gures the trails to generate Normals and Tangents. With this data, Scene
lighting can a ect the trails via Normal Maps and the Unity Standard Shader, or
your own custom-built Shaders.

inheritParticleColor

Toggle whether the trail will inherit the particle color as its starting color.

lifetime

The curve describing the trail lifetime, throughout the lifetime of the particle.

lifetimeMultiplier

Change the lifetime multiplier.

minVertexDistance

Set the minimum distance each trail can travel before a new vertex is added to
it.

mode

Choose how particle trails are generated.

ratio

Choose what proportion of particles will receive a trail.

ribbonCount

Select how many lines to create through the Particle System.

shadowBias

Apply a shadow bias to prevent self-shadowing artifacts. The speci ed value is
the proportion of the trail width at each segment.

sizeA ectsLifetime

Set whether the particle size will act as a multiplier on top of the trail lifetime.

sizeA ectsWidth

Set whether the particle size will act as a multiplier on top of the trail width.

splitSubEmitterRibbons

When used on a sub emitter, ribbons will connect particles from each parent
particle independently.

textureMode

Choose whether the U coordinate of the trail texture is tiled or stretched.

widthOverTrail

The curve describing the width, of each trail point.

widthOverTrailMultiplier

Change the width multiplier.

worldSpace

Drop new trail points in world space, regardless of Particle System Simulation
Space.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Trigger module.
This module is useful for killing particles when they touch a set of collision shapes, or for calling a script command
to let you apply custom particle behaviors when the trigger is activated.

The example code for MonoBehaviour.OnParticleTrigger shows how the callback type action works.

See Also: ParticleSystem, ParticleSystem.trigger.

Properties
enabled

Enable/disable the Trigger module.

enter

Choose what action to perform when particles enter the trigger volume.

exit

Choose what action to perform when particles leave the trigger volume.

inside

Choose what action to perform when particles are inside the trigger volume.

maxColliderCount

The maximum number of collision shapes that can be attached to this particle system
trigger.

outside

Choose what action to perform when particles are outside the trigger volume.

radiusScale

A multiplier applied to the size of each particle before overlaps are processed.

Public Methods
GetCollider

Get a collision shape associated with this particle system trigger.

SetCollider

Set a collision shape associated with this particle system trigger.

Leave feedback
SWITCH TO MANUAL

Description
Script interface for the Velocity Over Lifetime module.
See Also: ParticleSystem, ParticleSystem.velocityOverLifetime.

Properties
enabled

Enable/disable the Velocity Over Lifetime module.

orbitalO setX

Specify a custom center of rotation for the orbital and radial velocities.

orbitalO setXMultiplier

This method is more e cient than accessing the whole curve, if you only want to
change the overall o set multiplier.

orbitalO setY

Specify a custom center of rotation for the orbital and radial velocities.

orbitalO setYMultiplier

This method is more e cient than accessing the whole curve, if you only want to
change the overall o set multiplier.

orbitalO setZ

Specify a custom center of rotation for the orbital and radial velocities.

orbitalO setZMultiplier

This method is more e cient than accessing the whole curve, if you only want to
change the overall o set multiplier.

orbitalX

Curve to control particle speed based on lifetime, around the X axis.

orbitalXMultiplier

X axis speed multiplier.

orbitalY

Curve to control particle speed based on lifetime, around the Y axis.

orbitalYMultiplier

Y axis speed multiplier.

orbitalZ

Curve to control particle speed based on lifetime, around the Z axis.

orbitalZMultiplier

Z axis speed multiplier.

radial

Curve to control particle speed based on lifetime, away from a center position.

radialMultiplier

Radial speed multiplier.

space

Speci es if the velocities are in local space (rotated with the transform) or world
space.

speedModi er

Curve to control particle speed based on lifetime, without a ecting the direction of
the particles.

speedModi erMultiplier

Speed multiplier.

x

Curve to control particle speed based on lifetime, on the X axis.

xMultiplier

X axis speed multiplier.

y

Curve to control particle speed based on lifetime, on the Y axis.

yMultiplier

Y axis speed multiplier.

z

Curve to control particle speed based on lifetime, on the Z axis.

zMultiplier

Z axis speed multiplier.

Leave feedback

Description
Renders particles on to the screen (Shuriken).

Properties
activeVertexStreamsCount

The number of currently active custom vertex streams.

alignment

Control the direction that particles face.

allowRoll

Allow billboard particles to roll around their Z axis.

cameraVelocityScale

How much are the particles stretched depending on the Camera's speed.

enableGPUInstancing

Enables GPU Instancing on platforms where it is supported.

ip

Flip a percentage of the particles, along each axis.

lengthScale

How much are the particles stretched in their direction of motion.

maskInteraction

Speci es how the Particle System Renderer interacts with SpriteMask.

maxParticleSize

Clamp the maximum particle size.

mesh

Mesh used as particle instead of billboarded texture.

meshCount

The number of meshes being used for particle rendering.

minParticleSize

Clamp the minimum particle size.

normalDirection

How much are billboard particle normals oriented towards the camera.

pivot

Modify the pivot point used for rotating particles.

renderMode

How particles are drawn.

shadowBias

Apply a shadow bias to prevent self-shadowing artifacts. The speci ed value is
the proportion of the particle size.

sortingFudge

Biases particle system sorting amongst other transparencies.

sortMode

Sort particles within a system.

trailMaterial

Set the material used by the Trail module for attaching trails to particles.

velocityScale

How much are the particles stretched depending on "how fast they move".

Public Methods

BakeMesh

Creates a snapshot of ParticleSystemRenderer and stores it in mesh.

BakeTrailsMesh

Creates a snapshot of ParticleSystem Trails and stores them in mesh.

GetActiveVertexStreams

Query which vertex shader streams are enabled on the ParticleSystemRenderer.

GetMeshes

Get the array of meshes to be used as particles.

SetActiveVertexStreams

Enable a set of vertex shader streams on the ParticleSystemRenderer.

SetMeshes

Set an array of meshes to be used as particles when the
ParticleSystemRenderer.renderMode is set to ParticleSystemRenderMode.Mesh.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback

Description
Structure containing minimum and maximum terrain patch height values.

Properties
max

Maximum height of a terrain patch.

min

Minimum height of a terrain patch.

Leave feedback
SWITCH TO MANUAL

Description
Physics material describes how to handle colliding objects (friction, bounciness).
See Also: Collider.

Properties
bounceCombine

Determines how the bounciness is combined.

bounciness

How bouncy is the surface? A value of 0 will not bounce. A value of 1 will bounce without
any loss of energy.

dynamicFriction

The friction used when already moving. This value is usually between 0 and 1.

frictionCombine

Determines how the friction is combined.

staticFriction

The friction coe cient used when an object is lying on a surface.

Constructors
PhysicMaterial

Creates a new material.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy

instead.
DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Global physics properties and helper methods.

Static Properties
AllLayers

Layer mask constant to select all layers.

autoSimulation

Sets whether the physics should be simulated automatically or not.

autoSyncTransforms

Whether or not to automatically sync transform changes with the physics
system whenever a Transform component changes.

bounceThreshold

Two colliding objects with a relative velocity below this will not bounce
(default 2). Must be positive.

defaultContactO set

The default contact o set of the newly created colliders.

defaultPhysicsScene

The PhysicsScene automatically created when Unity starts.

DefaultRaycastLayers

Layer mask constant to select default raycast layers.

defaultSolverIterations

The defaultSolverIterations determines how accurately Rigidbody joints and
collision contacts are resolved. (default 6). Must be positive.

defaultSolverVelocityIterations

The defaultSolverVelocityIterations a ects how accurately the Rigidbody
joints and collision contacts are resolved. (default 1). Must be positive.

gravity

The gravity applied to all rigid bodies in the Scene.

IgnoreRaycastLayer

Layer mask constant to select ignore raycast layer.

interCollisionDistance

Sets the minimum separation distance for cloth inter-collision.

interCollisionSti ness

Sets the cloth inter-collision sti ness.

queriesHitBackfaces

Whether physics queries should hit back-face triangles.

queriesHitTriggers

Speci es whether queries (raycasts, spherecasts, overlap tests, etc.) hit
Triggers by default.

sleepThreshold

The mass-normalized energy threshold, below which objects start going to
sleep.

Static Methods
BoxCast

Casts the box along a ray and returns detailed information on what was hit.

BoxCastAll

Like Physics.BoxCast, but returns all hits.

BoxCastNonAlloc

Cast the box along the direction, and store hits in the provided bu er.

CapsuleCast

Casts a capsule against all colliders in the Scene and returns detailed
information on what was hit.

CapsuleCastAll

Like Physics.CapsuleCast, but this function will return all hits the capsule sweep
intersects.

CapsuleCastNonAlloc

Casts a capsule against all colliders in the Scene and returns detailed
information on what was hit into the bu er.

CheckBox

Check whether the given box overlaps with other colliders or not.

CheckCapsule

Checks if any colliders overlap a capsule-shaped volume in world space.

CheckSphere

Returns true if there are any colliders overlapping the sphere de ned by
position and radius in world coordinates.

ClosestPoint

Returns a point on the given collider that is closest to the speci ed location.

ComputePenetration

Compute the minimal translation required to separate the given colliders apart
at speci ed poses.

GetIgnoreLayerCollision

Are collisions between layer1 and layer2 being ignored?

IgnoreCollision

Makes the collision detection system ignore all collisions between collider1 and
collider2.

IgnoreLayerCollision

Makes the collision detection system ignore all collisions between any collider in
layer1 and any collider in layer2.Note that IgnoreLayerCollision will reset the
trigger state of a ected colliders, so you might receive OnTriggerExit and
OnTriggerEnter messages in response to calling this.

Linecast

Returns true if there is any collider intersecting the line between start and end.

OverlapBox

Find all colliders touching or inside of the given box.

OverlapBoxNonAlloc

Find all colliders touching or inside of the given box, and store them into the
bu er.

OverlapCapsule

Check the given capsule against the physics world and return all overlapping
colliders.

OverlapCapsuleNonAlloc

Check the given capsule against the physics world and return all overlapping
colliders in the user-provided bu er.

OverlapSphere

Returns an array with all colliders touching or inside the sphere.

OverlapSphereNonAlloc

Computes and stores colliders touching or inside the sphere into the provided
bu er.

Raycast

Casts a ray, from point origin, in direction direction, of length maxDistance,
against all colliders in the Scene.

RaycastAll

Casts a ray through the Scene and returns all hits. Note that order is not
guaranteed.

RaycastNonAlloc

Cast a ray through the Scene and store the hits into the bu er.

RebuildBroadphaseRegions

Rebuild the broadphase interest regions as well as set the world boundaries.

Simulate

Simulate physics in the Scene.

SphereCast

Casts a sphere along a ray and returns detailed information on what was hit.

SphereCastAll

Like Physics.SphereCast, but this function will return all hits the sphere sweep
intersects.

SphereCastNonAlloc

Cast sphere along the direction and store the results into bu er.

SyncTransforms

Apply Transform changes to the physics engine.

Leave feedback

Description
Global settings and helpers for 2D physics.

Static Properties
AllLayers

Layer mask constant that includes all layers.

alwaysShowColliders

Should the collider gizmos always be shown even when they are not selected?

angularSleepTolerance

A rigid-body cannot sleep if its angular velocity is above this tolerance.

autoSimulation

Sets whether the physics should be simulated automatically or not.

autoSyncTransforms

Whether or not to automatically sync transform changes with the physics system
whenever a Transform component changes.

baumgarteScale

The scale factor that controls how fast overlaps are resolved.

baumgarteTOIScale

The scale factor that controls how fast TOI overlaps are resolved.

callbacksOnDisable

Use this to control whether or not the appropriate OnCollisionExit2D or
OnTriggerExit2D callbacks should be called when a Collider2D is disabled.

colliderAABBColor

Sets the color used by the gizmos to show all Collider axis-aligned bounding boxes
(AABBs).

colliderAsleepColor

The color used by the gizmos to show all asleep colliders (collider is asleep when the
body is asleep).

colliderAwakeColor

The color used by the gizmos to show all awake colliders (collider is awake when the
body is awake).

colliderContactColor

The color used by the gizmos to show all collider contacts.

contactArrowScale

The scale of the contact arrow used by the collider gizmos.

defaultContactO set

The default contact o set of the newly created colliders.

defaultPhysicsScene

The PhysicsScene2D automatically created when Unity starts.

DefaultRaycastLayers

Layer mask constant that includes all layers participating in raycasts by default.

gravity

Acceleration due to gravity.

IgnoreRaycastLayer

Layer mask constant for the default layer that ignores raycasts.

jobOptions

A set of options that control how physics operates when using the job system to
multithread the physics simulation.

linearSleepTolerance

A rigid-body cannot sleep if its linear velocity is above this tolerance.

maxAngularCorrection

The maximum angular position correction used when solving constraints. This helps
to prevent overshoot.

maxLinearCorrection

The maximum linear position correction used when solving constraints. This helps to
prevent overshoot.

maxRotationSpeed

The maximum angular speed of a rigid-body per physics update. Increasing this can
cause numerical problems.

maxTranslationSpeed

The maximum linear speed of a rigid-body per physics update. Increasing this can
cause numerical problems.

positionIterations

The number of iterations of the physics solver when considering objects' positions.

queriesHitTriggers

Do raycasts detect Colliders con gured as triggers?

queriesStartInColliders

Sets the raycasts or linecasts that start inside Colliders to detect or not detect those
Colliders.

showColliderAABB

Should the collider gizmos show the AABBs for each collider?

showColliderContacts

Should the collider gizmos show current contacts for each collider?

showColliderSleep

Should the collider gizmos show the sleep-state for each collider?

timeToSleep

The time in seconds that a rigid-body must be still before it will go to sleep.

velocityIterations

The number of iterations of the physics solver when considering objects' velocities.

velocityThreshold

Any collisions with a relative linear velocity below this threshold will be treated as
inelastic.

Static Methods
BoxCast

Casts a box against colliders in the Scene, returning the rst collider to contact
with it.

BoxCastAll

Casts a box against colliders in the Scene, returning all colliders that contact
with it.

BoxCastNonAlloc

Casts a box into the Scene, returning colliders that contact with it into the
provided results array.

CapsuleCast

Casts a capsule against colliders in the Scene, returning the rst collider to
contact with it.

CapsuleCastAll

Casts a capsule against colliders in the Scene, returning all colliders that contact
with it.

CapsuleCastNonAlloc

Casts a capsule into the Scene, returning colliders that contact with it into the
provided results array.

CircleCast

Casts a circle against colliders in the Scene, returning the rst collider to contact
with it.

CircleCastAll

Casts a circle against colliders in the Scene, returning all colliders that contact
with it.

CircleCastNonAlloc

Casts a circle into the Scene, returning colliders that contact with it into the
provided results array.

Distance

Calculates the minimum distance between two colliders.

GetContacts

Retrieves all colliders in contact with the collider.

GetIgnoreCollision

Checks whether the collision detection system will ignore all collisions/triggers
between collider1 and collider2 or not.

GetIgnoreLayerCollision

Checks whether collisions between the speci ed layers be ignored or not.

GetLayerCollisionMask

Get the collision layer mask that indicates which layer(s) the speci ed layer can
collide with.

GetRayIntersection

Cast a 3D ray against the colliders in the Scene returning the rst collider along
the ray.

GetRayIntersectionAll

Cast a 3D ray against the colliders in the Scene returning all the colliders along
the ray.

GetRayIntersectionNonAlloc

Cast a 3D ray against the colliders in the Scene returning the colliders along the
ray.

IgnoreCollision

Makes the collision detection system ignore all collisions/triggers between
collider1 and collider2.

IgnoreLayerCollision

Choose whether to detect or ignore collisions between a speci ed pair of
layers.

IsTouching

Checks whether the passed colliders are in contact or not.

IsTouchingLayers

Checks whether the collider is touching any colliders on the speci ed layerMask
or not.

Linecast

Casts a line segment against colliders in the Scene.

LinecastAll

Casts a line against colliders in the Scene.

LinecastNonAlloc

Casts a line against colliders in the Scene.

OverlapArea

Checks if a collider falls within a rectangular area.

OverlapAreaAll

Get a list of all colliders that fall within a rectangular area.

OverlapAreaNonAlloc

Get a list of all colliders that fall within a speci ed area.

OverlapBox

Checks if a collider falls within a box area.

OverlapBoxAll

Get a list of all colliders that fall within a box area.

OverlapBoxNonAlloc

Get a list of all colliders that fall within a box area.

OverlapCapsule

Checks if a collider falls within a capsule area.

OverlapCapsuleAll

Get a list of all colliders that fall within a capsule area.

OverlapCapsuleNonAlloc

Get a list of all colliders that fall within a capsule area.

OverlapCircle

Checks if a collider falls within a circular area.

OverlapCircleAll

Get a list of all colliders that fall within a circular area.

OverlapCircleNonAlloc

Get a list of all colliders that fall within a circular area.

OverlapCollider

Get a list of all colliders that overlap collider.

OverlapPoint

Checks if a collider overlaps a point in space.

OverlapPointAll

Get a list of all colliders that overlap a point in space.

OverlapPointNonAlloc

Get a list of all colliders that overlap a point in space.

Raycast

Casts a ray against colliders in the Scene.

RaycastAll

Casts a ray against colliders in the Scene, returning all colliders that contact
with it.

RaycastNonAlloc

Casts a ray into the Scene.

SetLayerCollisionMask

Set the collision layer mask that indicates which layer(s) the speci ed layer can
collide with.

Simulate

Simulate physics in the Scene.

SyncTransforms

Synchronizes.

Leave feedback

Description
A set of options that control how physics operates when using the job system to multithread the physics
simulation.
Multithreaded physics is currently an experimental feature. As such, many options are exposed that allow
performance con guration that may not be available when the feature moves out of experimental status.
A physics simulation executes in the following discrete stages:
• Find New Contacts
• Contact Collision
• Discrete Solver (Clear Island Flags -> Discrete Island Traversal -> Discrete Island Solver -> Synchronize Fixtures ->
Find New Contacts)
• Continuous Solver (Clear Island Flags > Continuous Island Traversal -> Discrete Island Solver -> Synchronize
Fixtures -> Find New Contacts)
• Clear Body Forces
• Update Trigger Contacts
These stages execute in the order given above. Each stage is run as a job "task". Each task executes sub job tasks,
which are shown in parenthesis above. When executing a job, physics simulation may process bodies, contacts,
joints, and so on, across multiple job threads. You can task each of these threads with executing a speci c
number of items, such as bodies, contacts and joints. Many of the options provided here allow you to control the
minimum number of items assigned to each job. Raising the minimum can reduce the number of jobs required.
This is because running a lot of jobs, each processing only a few items, is usually not very e cient. The default
settings provide a decent performance to job balance, however you are free to experiment.
Additionally, prior to the simulation being run, Rigidbody2D interpolation/extrapolation poses are stored ready
for per-frame interpolation/extrapolation. These are also executed using the job system and are controlled here.

Properties
clearBodyForcesPerJob

Controls the minimum number of bodies to be cleared in each simulation
job.

clearFlagsPerJob

Controls the minimum number of ags to be cleared in each simulation job.

collideContactsPerJob

Controls the minimum number of contacts to collide in each simulation job.

ndNearestContactsPerJob

Controls the minimum number of nearest contacts to nd in each simulation
job.

interpolationPosesPerJob

Controls the minimum number of Rigidbody2D being interpolated in each
simulation job.

islandSolverBodiesPerJob

Controls the minimum number of bodies to solve in each simulation job

when performing island solving.
islandSolverBodyCostScale

Scales the cost of each body during discrete island solving.

islandSolverContactCostScale

Scales the cost of each contact during discrete island solving.

islandSolverContactsPerJob

Controls the minimum number of contacts to solve in each simulation job
when performing island solving.

islandSolverCostThreshold

The minimum threshold cost of all bodies, contacts and joints in an island
during discrete island solving.

islandSolverJointCostScale

Scales the cost of each joint during discrete island solving.

newContactsPerJob

Controls the minimum number of new contacts to nd in each simulation
job.

syncContinuousFixturesPerJob

Controls the minimum number of xtures to synchronize in the broadphase
during continuous island solving in each simulation job.

syncDiscreteFixturesPerJob

Controls the minimum number of xtures to synchronize in the broadphase
during discrete island solving in each simulation job.

updateTriggerContactsPerJob

Controls the minimum number of trigger contacts to update in each
simulation job.

useConsistencySorting

Should physics simulation sort multi-threaded results to maintain processing
order consistency?

useMultithreading

Should physics simulation use multithreading?

Leave feedback
SWITCH TO MANUAL

Description
Asset type that de nes the surface properties of a Collider2D.
Note: the 3D equivalent of this class is spelt as "PhysicMaterial" with no S, but this class is spelt "PhysicsMaterial"
with an S.
See Also: PhysicMaterial class.

Properties
bounciness

The degree of elasticity during collisions.

friction

Coe cient of friction.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A base type for 2D physics components that required a callback during FixedUpdate.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game

object and on every ancestor of the behaviour.
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Ping any given IP address (given in dot notation).
The ping operation is asynchronous and a ping object can be polled for status using Ping.isDone. When a
response is received it is in Ping.time.
Windows Store Apps: A stream socket is used to mimic ping functionality, it will try to open a connection to
speci ed IP address using port 80. For this to work correctly, InternetClient capability must be enabled in
Package.appxmanifest.
Android: ICMP sockets are used for ping operation if they're available, otherwise Unity spawns a child process
/system/bin/ping for ping operations. To check if ICMP sockets are available, you need to read the contents for
/proc/sys/net/ipv4/ping_group_range. If ICMP sockets are available, this le should contain an entry for 0
2147483647.

Properties
ip

The IP target of the ping.

isDone

Has the ping function completed?

time

This property contains the ping time result after isDone returns true.

Constructors
Ping

Perform a ping to the supplied target IP address.

Leave feedback

Description
Representation of a plane in 3D space.
A plane is an in nitely large, at surface that exists in 3D space and divides the space into two halves known as
half-spaces. It is easy to determine which of the two half-spaces a particular point is in and also how far the point
is from the plane. Walls, oors and other at surfaces are common in games, so a plane is sometimes useful for
mathematical calculations with these objects. Also, there are cases where a real surface does not exist but it is
useful to imagine that one is there. For example, in sports, a goal line or out-of-bounds line is often assumed to
extend into the air, e ectively de ning a plane.
When a plane passes through the <0,0,0> point in world space, it is de ned simply by a normal vector that
determines which way it faces. It is easy to visualise this if you imagine looking at the plane edge-on.

Note that the side from which the normal vector points is important since it is used to identify which half-space a
point is in (ie, on the positive or "normal" side of the plane or the other side). When the plane doesn't pass
through <0,0,0> it can be de ned by the normal vector along with a distance from <0,0,0>

A plane can also be de ned by the three corner points of a triangle that lies within the plane. In this case, the
normal vector points toward you if the corner points go around clockwise as you look at the triangle face-on.

.

Properties
distance
ipped
normal

Distance from the origin to the plane.
Returns a copy of the plane that faces in the opposite direction.
Normal vector of the plane.

Constructors
Plane

Creates a plane.

Public Methods
ClosestPointOnPlane

For a given point returns the closest point on the plane.

Flip

Makes the plane face in the opposite direction.

GetDistanceToPoint

Returns a signed distance from plane to point.

GetSide

Is a point on the positive side of the plane?

Raycast

Intersects a ray with the plane.

SameSide

Are two points on the same side of the plane?

Set3Points

Sets a plane using three points that lie within it. The points go around clockwise as
you look down on the top surface of the plane.

SetNormalAndPosition

Sets a plane using a point that lies within it along with a normal to orient it.

Translate

Returns a copy of the given plane that is moved in space by the given translation.

Leave feedback
SWITCH TO MANUAL

Description
Applies "platform" behaviour such as one-way collisions etc.
When the source Collider2D is a trigger, the e ector will apply forces whenever the target Collider2D overlaps the
source. When the source Collider isn't a trigger, the e ector will apply forces whenever the target Collider2D is in
contact with the source only.

Properties
rotationalO set

The rotational o set angle from the local 'up'.

sideArc

The angle of an arc that de nes the sides of the platform centered on the local 'left'
and 'right' of the e ector. Any collision normals within this arc are considered for the
'side' behaviours.

surfaceArc

The angle of an arc that de nes the surface of the platform centered of the local 'up'
of the e ector.

useOneWay

Should the one-way collision behaviour be used?

useOneWayGrouping

Ensures that all contacts controlled by the one-way behaviour act the same.

useSideBounce

Should bounce be used on the platform sides?

useSideFriction

Should friction be used on the platform sides?

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Stores and accesses player preferences between game sessions.
Editor/Standalone
On macOS PlayerPrefs are stored in ~/Library/Preferences folder, in a le named unity.[company name].[product
name].plist, where company and product names are the names set up in Project Settings. The same .plist le is
used for both Projects run in the Editor and standalone players.
On Windows, PlayerPrefs are stored in the registry under HKCU\Software\[company name]\[product name] key,
where company and product names are the names set up in Project Settings.
On Linux, PlayerPrefs can be found in ~/.con g/unity3d/[CompanyName]/[ProductName] again using the
company and product names speci ed in the Project Settings.
On Windows Store Apps, Player Prefs can be found in %userpro le%\AppData\Local\Packages\
[ProductPackageId]>\LocalState\playerprefs.dat
On Windows Phone 8, Player Prefs can be found in application's local folder, See Also: Directory.localFolder
On Android data is stored (persisted) on the device. The data is saved in SharedPreferences. C#/JavaScript,
Android Java and Native code can all access the PlayerPrefs data. The PlayerPrefs data is physically stored in
/data/data/pkg-name/shared_prefs/pkg-name.xml.
On WebGL, PlayerPrefs are stored using the browser's IndexedDB API.
On iOS, PlayerPrefs are stored in /Library/Preferences/[bundle identi er].plist.

Static Methods
DeleteAll

Removes all keys and values from the preferences. Use with caution.

DeleteKey

Removes key and its corresponding value from the preferences.

GetFloat

Returns the value corresponding to key in the preference le if it exists.

GetInt

Returns the value corresponding to key in the preference le if it exists.

GetString

Returns the value corresponding to key in the preference le if it exists.

HasKey

Returns true if key exists in the preferences.

Save

Writes all modi ed preferences to disk.

SetFloat

Sets the value of the preference identi ed by key.

SetInt

Sets the value of the preference identi ed by key.

SetString

Sets the value of the preference identi ed by key.

Leave feedback

Description
An exception thrown by the PlayerPrefs class in a web player build.
The exception is thrown when writing to a preference le exceeds the allotted storage space. This exception is not
thrown on other platforms.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
void Start()
{
// create a one megabyte character string
string s16 = "0123456789abcdef";
string s1024 = "";
for (int j = 0; j < 64; j++)
s1024 += s16;
string s1024x1024 = "";
for (int i = 0; i < 1024; i++)
s1024x1024 += s1024;

// try to save the string
try
{
PlayerPrefs.SetString("fail", s1024x1024);
}
// handle the error
catch (System.Exception err)
{
Debug.Log("Got: " + err);
}
}
}

Note that web player is not supported from 5.4.0 onwards.

Leave feedback
SWITCH TO MANUAL

Description
Applies forces to attract/repulse against a point.
When the source Collider2D is a trigger, the e ector will apply forces whenever the target Collider2D overlaps the
source. When the source Collider isn't a trigger, the e ector will apply forces whenever the target Collider2D is in
contact with the source only.
This e ector is designed primarily to work with source Collider2D that are set as triggers so that target Collider2D
can overlap the de ned area.

Properties
angularDrag

The angular drag to apply to rigid-bodies.

distanceScale

The scale applied to the calculated distance between source and target.

drag

The linear drag to apply to rigid-bodies.

forceMagnitude

The magnitude of the force to be applied.

forceMode

The mode used to apply the e ector force.

forceSource

The source which is used to calculate the centroid point of the e ector. The distance from
the target is de ned from this point.

forceTarget

The target for where the e ector applies any force.

forceVariation

The variation of the magnitude of the force to be applied.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Collider for 2D physics representing an arbitrary polygon de ned by its vertices.
See Also: BoxCollider2D, CircleCollider2D, EdgeCollider2D.

Properties
autoTiling

Determines whether the PolygonCollider2D's shape is automatically updated based on a
SpriteRenderer's tiling properties.

pathCount

The number of paths in the polygon.

points

Corner points that de ne the collider's shape in local space.

Public Methods
CreatePrimitive

Creates as regular primitive polygon with the speci ed number of sides.

GetPath

Gets a path from the Collider by its index.

GetTotalPointCount

Return the total number of points in the polygon in all paths.

SetPath

De ne a path by its constituent points.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

attachedRigidbody

The Rigidbody2D attached to the Collider2D.

bounciness

Get the bounciness used by the collider.

bounds

The world space bounding area of the collider.

composite

Get the CompositeCollider2D that is available to be attached to the collider.

density

The density of the collider used to calculate its mass (when auto mass is enabled).

friction

Get the friction used by the collider.

isTrigger

Is this collider con gured as a trigger?

o set

The local o set of the collider geometry.

shapeCount

The number of separate shaped regions in the collider.

sharedMaterial

The PhysicsMaterial2D that is applied to this collider.

usedByComposite

Sets whether the Collider will be used or not used by a CompositeCollider2D.

usedByE ector

Whether the collider is used by an attached e ector or not.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
Cast

Casts the collider shape into the Scene starting at the collider position ignoring
the collider itself.

Distance

Calculates the minimum separation of this collider against another collider.

GetContacts

Retrieves all contact points for this collider.

IsTouching

Check whether this collider is touching the collider or not.

IsTouchingLayers

Checks whether this collider is touching any colliders on the speci ed layerMask
or not.

OverlapCollider

Get a list of all colliders that overlap this collider.

OverlapPoint

Check if a collider overlaps a point in space.

Raycast

Casts a ray into the Scene starting at the collider position ignoring the collider
itself.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children

using depth rst search.
GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter2D

Sent when an incoming collider makes contact with this object's collider (2D physics
only).

OnCollisionExit2D

Sent when a collider on another object stops touching this object's collider (2D physics
only).

OnCollisionStay2D

Sent each frame where a collider on another object is touching this object's collider (2D
physics only).

OnTriggerEnter2D

Sent when another object enters a trigger collider attached to this object (2D physics
only).

OnTriggerExit2D

Sent when another object leaves a trigger collider attached to this object (2D physics
only).

OnTriggerStay2D

Sent each frame where another object is within a trigger collider attached to this object
(2D physics only).

Leave feedback

Description
Representation of a Position, and a Rotation in 3D Space
This structure is used primarily in XR applications to describe the current "pose" of a device in 3D space.

Static Properties
identity

Shorthand for pose which represents zero position, and an identity rotation.

Properties
forward

Returns the forward vector of the pose.

position

The position component of the pose.

right

Returns the right vector of the pose.

rotation

The rotation component of the pose.

up

Returns the up vector of the pose.

Constructors
Pose

Creates a new pose with the given vector, and quaternion values.

Public Methods
GetTransformedBy

Transforms the current pose into the local space of the provided pose.

Operators
operator !=

Returns true if two poses are not equal.

operator ==

Returns true if two poses are equal.

Leave feedback
Obsolete

Description
Deprecated feature, no longer available

Inherited Members
Properties
color

The main material's color.

doubleSidedGI

Gets and sets whether the Double Sided Global Illumination setting is enabled for
this material.

enableInstancing

Gets and sets whether GPU instancing is enabled for this material.

globalIlluminationFlags

De nes how the material should interact with lightmaps and lightprobes.

mainTexture

The material's texture.

mainTextureO set

The texture o set of the main texture.

mainTextureScale

The texture scale of the main texture.

passCount

How many passes are in this material (Read Only).

renderQueue

Render queue of this material.

shader

The shader used by the material.

shaderKeywords

Additional shader keywords set by this material.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
CopyPropertiesFromMaterial

Copy properties from other material into this material.

DisableKeyword

Unset a shader keyword.

EnableKeyword

Sets a shader keyword that is enabled by this material.

FindPass

Returns the index of the pass passName.

GetColor

Get a named color value.

GetColorArray

Get a named color array.

GetFloat

Get a named oat value.

GetFloatArray

Get a named oat array.

GetInt

Get a named integer value.

GetMatrix

Get a named matrix value from the shader.

GetMatrixArray

Get a named matrix array.

GetPassName

Returns the name of the shader pass at index pass.

GetShaderPassEnabled

Checks whether a given Shader pass is enabled on this Material.

GetTag

Get the value of material's shader tag.

GetTexture

Get a named texture.

GetTextureO set

Gets the placement o set of texture propertyName.

GetTexturePropertyNameIDs

Return the name IDs of all texture properties exposed on this material.

GetTexturePropertyNames

Returns the names of all texture properties exposed on this material.

GetTextureScale

Gets the placement scale of texture propertyName.

GetVector

Get a named vector value.

GetVectorArray

Get a named vector array.

HasProperty

Checks if material's shader has a property of a given name.

IsKeywordEnabled

Is the shader keyword enabled on this material?

Lerp

Interpolate properties between two materials.

SetBu er

Sets a named ComputeBu er value.

SetColor

Sets a named color value.

SetColorArray

Sets a color array property.

SetFloat

Sets a named oat value.

SetFloatArray

Sets a oat array property.

SetInt

Sets a named integer value.

SetMatrix

Sets a named matrix for the shader.

SetMatrixArray

Sets a matrix array property.

SetOverrideTag

Sets an override tag/value on the material.

SetPass

Activate the given pass for rendering.

SetShaderPassEnabled

Enables or disables a Shader pass on a per-Material level.

SetTexture

Sets a named texture.

SetTextureO set

Sets the placement o set of texture propertyName.

SetTextureScale

Sets the placement scale of texture propertyName.

SetVector

Sets a named vector value.

SetVectorArray

Sets a vector array property.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Obsolete

Description
Deprecated feature, no longer available

Leave feedback
Obsolete

Description
Deprecated feature, no longer available

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A script interface for a projector component.
The Projector can be used to project any material onto the Scene - just like a real world projector. The properties
exposed by this class are an exact match for the values in the Projector's inspector.
It can be used to implement blob or projected shadows. You could also project an animated texture or a render
texture that lms another part of the Scene. The projector will render all objects in its view frustum with the
provided material.
There is no shortcut property in GameObject or Component to access the Projector, so you must use
GetComponent to do it:

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Get the projector
Projector proj = GetComponent();
// Use it
proj.nearClipPlane = 0.5f;
}
}

See Also: projector component.

Properties
aspectRatio

The aspect ratio of the projection.

farClipPlane

The far clipping plane distance.

eldOfView

The eld of view of the projection in degrees.

ignoreLayers

Which object layers are ignored by the projector.

material

The material that will be projected onto every object.

nearClipPlane

The near clipping plane distance.

orthographic

Is the projection orthographic (true) or perspective (false)?

orthographicSize

Projection's half-size when in orthographic mode.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Represents a string as an int for e cient lookup and comparison. Use this for common PropertyNames.
Internally stores just an int to represent the string. A PropertyName can be created from a string but can not be
converted back to a string. The same string always results in the same int representing that string. Thus this is a
very e cient string representation in both memory and speed when all you need is comparison.
PropertyName is serializable.
ToString() is only implemented for debugging purposes in the editor it returns "theName:3737" in the player it
returns "Unknown:3737".

Constructors
PropertyName

Initializes the PropertyName using a string.

Public Methods
Equals

Determines whether this instance and a speci ed object, which must also be a
PropertyName object, have the same value.

GetHashCode

Returns the hash code for this PropertyName.

ToString

For debugging purposes only. Returns the string value representing the string in the
Editor. Returns "UnityEngine.PropertyName" in the player.

Static Methods
IsNullOrEmpty

Indicates whether the speci ed PropertyName is an Empty string.

Operators
operator !=

Determines whether two speci ed PropertyName have a di erent string value.

operator ==

Determines whether two speci ed PropertyName have the same string value. Because
two PropertyNames initialized with the same string value always have the same name
index, we can simply perform a comparison of two ints to nd out if the string value
equals.

PropertyName

Converts the string passed into a PropertyName. See Also:
PropertyName.ctor(System.String).

Leave feedback
SWITCH TO MANUAL

Description
Script interface for Quality Settings.
There can be an arbitrary number of quality settings. The details of each are set up in the project's Quality
Settings. At run time, the current quality level can be changed using this class.

Static Properties
activeColorSpace

Active color space (Read Only).

anisotropicFiltering

Global anisotropic ltering mode.

antiAliasing

Set The AA Filtering option.

asyncUploadBu erSize

Async texture upload provides timesliced async texture upload on
the render thread with tight control over memory and timeslicing.
There are no allocations except for the ones which driver has to do.
To read data and upload texture data a ringbu er whose size can
be controlled is re-used.Use asyncUploadBu erSize to set the
bu er size for asynchronous texture uploads. The size is in
megabytes. Minimum value is 2 and maximum is 512. Although the
bu er will resize automatically to t the largest texture currently
loading, it is recommended to set the value approximately to the
size of biggest texture used in the Scene to avoid re-sizing of the
bu er which can incur performance cost.

asyncUploadPersistentBu er

This ag controls if the async upload pipeline's ring bu er remains
allocated when there are no active loading operations. To make the
ring bu er allocation persist after all upload operations have
completed, set this to true. If you have issues with excessive
memory usage, you can set this to false. This means you reduce the
runtime memory footprint, but memory fragmentation can occur.
The default value is true.

asyncUploadTimeSlice

Async texture upload provides timesliced async texture upload on
the render thread with tight control over memory and timeslicing.
There are no allocations except for the ones which driver has to do.
To read data and upload texture data a ringbu er whose size can
be controlled is re-used.Use asyncUploadTimeSlice to set the timeslice in milliseconds for asynchronous texture uploads per frame.
Minimum value is 1 and maximum is 33.

billboardsFaceCameraPosition

If enabled, billboards will face towards camera position rather than

camera orientation.
blendWeights

Blend weights.

desiredColorSpace

Desired color space (Read Only).

lodBias

Global multiplier for the LOD's switching distance.

masterTextureLimit

A texture size limit applied to all textures.

maximumLODLevel

A maximum LOD level. All LOD groups.

maxQueuedFrames

Maximum number of frames queued up by graphics driver.

names

The indexed list of available Quality Settings.

particleRaycastBudget

Budget for how many ray casts can be performed per frame for
approximate collision testing.

pixelLightCount

The maximum number of pixel lights that should a ect any object.

realtimeRe ectionProbes

Enables realtime re ection probes.

resolutionScalingFixedDPIFactor

In resolution scaling mode, this factor is used to multiply with the
target Fixed DPI speci ed to get the actual Fixed DPI to use for this
quality setting.

shadowCascade2Split

The normalized cascade distribution for a 2 cascade setup. The
value de nes the position of the cascade with respect to Zero.

shadowCascade4Split

The normalized cascade start position for a 4 cascade setup. Each
member of the vector de nes the normalized position of the
coresponding cascade with respect to Zero.

shadowCascades

Number of cascades to use for directional light shadows.

shadowDistance

Shadow drawing distance.

shadowmaskMode

The rendering mode of Shadowmask.

shadowNearPlaneO set

O set shadow frustum near plane.

shadowProjection

Directional light shadow projection.

shadowResolution

The default resolution of the shadow maps.

shadows

Realtime Shadows type to be used.

softParticles

Should soft blending be used for particles?

softVegetation

Use a two-pass shader for the vegetation in the terrain engine.

streamingMipmapsActive

Enable automatic streaming of texture mipmap levels based on
their distance from all active cameras.

streamingMipmapsAddAllCameras

Process all enabled Cameras for texture streaming (rather than just
those with StreamingController components).

streamingMipmapsMaxFileIORequests

The maximum number of active texture le IO requests from the
texture streaming system.

streamingMipmapsMaxLevelReduction

The maximum number of mipmap levels to discard for each
texture.

streamingMipmapsMemoryBudget

The total amount of memory to be used by streaming and nonstreaming textures.

streamingMipmapsRenderersPerFrame

Number of renderers used to process each frame during the
calculation of desired mipmap levels for the associated textures.

vSyncCount

The VSync Count.

Static Methods
DecreaseLevel

Decrease the current quality level.

GetQualityLevel

Returns the current graphics quality level.

IncreaseLevel

Increase the current quality level.

SetQualityLevel

Sets a new graphics quality level.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Quaternions are used to represent rotations.
They are compact, don't su er from gimbal lock and can easily be interpolated. Unity internally uses Quaternions
to represent all rotations.
They are based on complex numbers and are not easy to understand intuitively. You almost never access or
modify individual Quaternion components (x,y,z,w); most often you would just take existing rotations (e.g. from
the Transform) and use them to construct new rotations (e.g. to smoothly interpolate between two rotations). The
Quaternion functions that you use 99% of the time are: Quaternion.LookRotation, Quaternion.Angle,
Quaternion.Euler, Quaternion.Slerp, Quaternion.FromToRotation, and Quaternion.identity. (The other functions
are only for exotic uses.)
You can use the Quaternion.operator * to rotate one rotation by another, or to rotate a vector by a rotation.
Note that Unity expects Quaternions to be normalized.

Static Properties
identity

The identity rotation (Read Only).

Properties
eulerAngles

Returns or sets the euler angle representation of the rotation.

normalized

Returns this quaternion with a magnitude of 1 (Read Only).

this[int]

Access the x, y, z, w components using [0], [1], [2], [3] respectively.

w

W component of the Quaternion. Do not directly modify quaternions.

x

X component of the Quaternion. Don't modify this directly unless you know quaternions
inside out.

y

Y component of the Quaternion. Don't modify this directly unless you know quaternions
inside out.

z

Z component of the Quaternion. Don't modify this directly unless you know quaternions
inside out.

Constructors
Quaternion

Constructs new Quaternion with given x,y,z,w components.

Public Methods
Set

Set x, y, z and w components of an existing Quaternion.

SetFromToRotation

Creates a rotation which rotates from fromDirection to toDirection.

SetLookRotation

Creates a rotation with the speci ed forward and upwards directions.

ToAngleAxis

Converts a rotation to angle-axis representation (angles in degrees).

ToString

Returns a nicely formatted string of the Quaternion.

Static Methods
Angle

Returns the angle in degrees between two rotations a and b.

AngleAxis

Creates a rotation which rotates angle degrees around axis.

Dot

The dot product between two rotations.

Euler

Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis,
and y degrees around the y axis.

FromToRotation

Creates a rotation which rotates from fromDirection to toDirection.

Inverse

Returns the Inverse of rotation.

Lerp

Interpolates between a and b by t and normalizes the result afterwards. The parameter t
is clamped to the range [0, 1].

LerpUnclamped

Interpolates between a and b by t and normalizes the result afterwards. The parameter t
is not clamped.

LookRotation

Creates a rotation with the speci ed forward and upwards directions.

Normalize

Converts this quaternion to one with the same orientation but with a magnitude of 1.

RotateTowards

Rotates a rotation from towards to.

Slerp

Spherically interpolates between a and b by t. The parameter t is clamped to the range [0,
1].

SlerpUnclamped

Spherically interpolates between a and b by t. The parameter t is not clamped.

Operators
operator *

Combines rotations lhs and rhs.

operator ==

Are two quaternions equal to each other?

Leave feedback

Description
Class for generating random data.

Static Properties
insideUnitCircle

Returns a random point inside a circle with radius 1 (Read Only).

insideUnitSphere

Returns a random point inside a sphere with radius 1 (Read Only).

onUnitSphere

Returns a random point on the surface of a sphere with radius 1 (Read Only).

rotation

Returns a random rotation (Read Only).

rotationUniform

Returns a random rotation with uniform distribution (Read Only).

state

Gets/Sets the full internal state of the random number generator.

value

Returns a random number between 0.0 [inclusive] and 1.0 [inclusive] (Read Only).

Static Methods
ColorHSV

Generates a random color from HSV and alpha ranges.

InitState

Initializes the random number generator state with a seed.

Range

Returns a random oat number between and min [inclusive] and max [inclusive] (Read
Only).

Leave feedback

Description
Serializable structure used to hold the full internal state of the random number generator. See Also:
Random.state.

Leave feedback

Description
Describes an integer range.

Properties
end

The end index of the range (not inclusive).

length

The length of the range.

start

The starting index of the range, where 0 is the rst position, 1 is the second, 2 is the third,
and so on.

Constructors
RangeInt

Constructs a new RangeInt with given start, length values.

Leave feedback

Description
Representation of rays.
A ray is an in nite line starting at origin and going in some direction.

Properties
direction

The direction of the ray.

origin

The origin point of the ray.

Constructors
Ray

Creates a ray starting at origin along direction.

Public Methods
GetPoint

Returns a point at distance units along the ray.

ToString

Returns a nicely formatted string for this ray.

Leave feedback

Description
A ray in 2D space.
A ray is a line segment that extends from a point in space in a speci ed direction. Rays have a number of uses in
Unity but the most common is probably raycasting. This technique involves tracing along the path of a ray from its
origin to determine if it intersects with any objects. This is useful for plotting the paths of projectiles, determining
lines of sight and implementing many common game mechanics.
See Also: Physics2D.Raycast, Ray class, RaycastHit2D class.

Properties
direction

The direction of the ray in world space.

origin

The starting point of the ray in world space.

Constructors
Ray2D

Creates a 2D ray starting at origin along direction.

Public Methods
GetPoint

Get a point that lies a given distance along a ray.

Leave feedback

Description
Struct used to set up a raycast command to be performed asynchronously during a job.
When you use this struct to schedule a batch of raycasts, they will be performed asynchronously and in parallel to
each other. The results of the raycasts are written to the results bu er. Since the results are written
asynchronously the results bu er cannot be accessed until the job has been completed.
The result for a command at index N in the command bu er will be stored at index N * maxHits in the results
bu er.
If maxHits is larger than the actual number of results for the command the result bu er will contain some invalid
results which did not hit anything. The rst invalid result is identi ed by the collider being null. The second and
later invalid results are not written to by the raycast command so their colliders are not guaranteed to be null.
When iterating over the results the loop should stop when the rst invalid result is found.
See Also: Physics.Raycast, Physics.RaycastAll.

using Unity.Collections;
using Unity.Jobs;
using UnityEngine;

public class Example : MonoBehaviour
{
private void RaycasExample()
{
// Perform a single raycast using RaycastCommand and wait for it to comp
// Setup the command and result buffers
var results = new NativeArray(1, Allocator.Temp);

var commands = new NativeArray(1, Allocator.Temp);

// Set the data of the first command
Vector3 origin = Vector3.forward * -10;

Vector3 direction = Vector3.forward;

commands[0] = new RaycastCommand(origin, direction);

// Schedule the batch of raycasts
JobHandle handle = RaycastCommand.ScheduleBatch(commands, results, 1, de

// Wait for the batch processing job to complete
handle.Complete();

// Copy the result. If batchedHit.collider is null there was no hit
RaycastHit batchedHit = results[0];

// Dispose the buffers
results.Dispose();
commands.Dispose();
}
}

Properties
direction

The direction of the ray.

distance

The maximum distance the ray should check for collisions.

from

The starting point of the ray in world coordinates.

layerMask

A LayerMask that is used to selectively ignore Colliders when casting a ray.

maxHits

The maximum number of Colliders the ray can hit.

Constructors
RaycastCommand

Create a RaycastCommand.

Static Methods
ScheduleBatch

Schedule a batch of raycasts which are performed in a job.

Leave feedback

Description
Structure used to get information back from a raycast.
See Also: Physics.Raycast, Physics.Linecast, Physics.RaycastAll.

Properties
barycentricCoordinate

The barycentric coordinate of the triangle we hit.

collider

The Collider that was hit.

distance

The distance from the ray's origin to the impact point.

lightmapCoord

The uv lightmap coordinate at the impact point.

normal

The normal of the surface the ray hit.

point

The impact point in world space where the ray hit the collider.

rigidbody

The Rigidbody of the collider that was hit. If the collider is not attached to a rigidbody
then it is null.

textureCoord

The uv texture coordinate at the collision location.

textureCoord2

The secondary uv texture coordinate at the impact point.

transform

The Transform of the rigidbody or collider that was hit.

triangleIndex

The index of the triangle that was hit.

Leave feedback

Description
Information returned about an object detected by a raycast in 2D physics.
A raycast is used to detect objects that lie along the path of a ray and is conceptually like ring a laser beam into
the Scene and observing which objects are hit by it. The RaycastHit2D class is used by Physics2D.Raycast and
other functions to return information about the objects detected by raycasts.
See Also: Physics2D.Raycast, Ray2D class.

Properties
centroid

The centroid of the primitive used to perform the cast.

collider

The collider hit by the ray.

distance

The distance from the ray origin to the impact point.

fraction

Fraction of the distance along the ray that the hit occurred.

normal

The normal vector of the surface hit by the ray.

point

The point in world space where the ray hit the collider's surface.

rigidbody

The Rigidbody2D attached to the object that was hit.

transform

The Transform of the object that was hit.

Leave feedback

Description
A 2D Rectangle de ned by X and Y position, width and height.
Unity uses a number of 2D coordinate spaces, most of which de ne X as increasing to the right, and Y increasing
upwards. The one exception is in the GUI and GUILayout classes, where Y increases downwards.
The following examples are illustrated in GUI space, where (0,0) represents the top-left corner and Y increases
downwards.
Rectangles can be speci ed in two di erent ways. The rst is with an x and y position and a width and height:
x

width

y
height

The other way is with the X and Y coordinates of each of its edges. These are called xMin, xMax, yMin and yMax:
xMin

xMax

yMin

yMax

Note that although x and y have the same values as xMin and yMin, they behave di erently when you set them.
Setting x or y changes the position of the rectangle, but preserves its size:
x

Setting any of xMin, xMax, yMin and yMax will resize the rectangle, but preserve the position of the opposite

edge:
xMin

See Also: GUI Scripting Guide, Camera.rect, Camera.pixelRect.

Static Properties
zero

Shorthand for writing new Rect(0,0,0,0).

Properties
center

The position of the center of the rectangle.

height

The height of the rectangle, measured from the Y position.

max

The position of the maximum corner of the rectangle.

min

The position of the minimum corner of the rectangle.

position

The X and Y position of the rectangle.

size

The width and height of the rectangle.

width

The width of the rectangle, measured from the X position.

x

The X coordinate of the rectangle.

xMax

The maximum X coordinate of the rectangle.

xMin

The minimum X coordinate of the rectangle.

y

The Y coordinate of the rectangle.

yMax

The maximum Y coordinate of the rectangle.

yMin

The minimum Y coordinate of the rectangle.

Constructors
Rect

Creates a new rectangle.

Public Methods
Contains

Returns true if the x and y components of point is a point inside this rectangle. If
allowInverse is present and true, the width and height of the Rect are allowed to take
negative values (ie, the min value is greater than the max), and the test will still work.

Overlaps

Returns true if the other rectangle overlaps this one. If allowInverse is present and true,
the widths and heights of the Rects are allowed to take negative values (ie, the min value
is greater than the max), and the test will still work.

Set

Set components of an existing Rect.

ToString

Returns a nicely formatted string for this Rect.

Static Methods
MinMaxRect

Creates a rectangle from min/max coordinate values.

NormalizedToPoint

Returns a point inside a rectangle, given normalized coordinates.

PointToNormalized

Returns the normalized coordinates cooresponding the the point.

Operators
operator ==

Returns true if the rectangles are the same.

Leave feedback

Description
A 2D Rectangle de ned by x, y, width, height with integers.

Properties
allPositionsWithin

A RectInt.PositionCollection that contains all positions within the RectInt.

center

Center coordinate of the rectangle.

height

Height of the rectangle.

max

Upper right corner of the rectangle.

min

Lower left corner of the rectangle.

position

Returns the position (x, y) of the RectInt.

size

Returns the width and height of the RectInt.

width

Width of the rectangle.

x

Left coordinate of the rectangle.

xMax

Returns the maximum X value of the RectInt.

xMin

Returns the minimum X value of the RectInt.

y

Top coordinate of the rectangle.

yMax

Returns the maximum Y value of the RectInt.

yMin

Returns the minimum Y value of the RectInt.

Public Methods
ClampToBounds

Clamps the position and size of the RectInt to the given bounds.

Contains

Returns true if the given position is within the RectInt.

Equals

Returns true if the given RectInt is equal to this RectInt.

SetMinMax

Sets the bounds to the min and max value of the rect.

ToString

Returns the x, y, width and height of the RectInt.

Leave feedback

Description
An iterator that allows you to iterate over all positions within the RectInt.

Properties
Current

Current position of the enumerator.

Public Methods
GetEnumerator

Returns this as an iterator that allows you to iterate over all positions within the RectInt.

MoveNext

Moves the enumerator to the next position.

Reset

Resets this enumerator to its starting state.

Leave feedback

Description
O sets for rectangles, borders, etc.
Used all over the place by GUIStyle.

Properties
bottom

Bottom edge size.

horizontal

Shortcut for left + right. (Read Only)

left

Left edge size.

right

Right edge size.

top

Top edge size.

vertical

Shortcut for top + bottom. (Read Only)

Constructors
RectO set

Creates a new rectangle with o sets.

Public Methods
Add

Add the border o sets to a rect.

Remove

Remove the border o sets from a rect.

Leave feedback
SWITCH TO MANUAL

Description
Position, size, anchor and pivot information for a rectangle.
RectTransforms are used for GUI but can also be used for other things. It's used to store and manipulate the
position, size, and anchoring of a rectangle and supports various forms of scaling based on a parent
RectTransform.

Properties
anchoredPosition

The position of the pivot of this RectTransform relative to the anchor reference point.

anchoredPosition3D

The 3D position of the pivot of this RectTransform relative to the anchor reference
point.

anchorMax

The normalized position in the parent RectTransform that the upper right corner is
anchored to.

anchorMin

The normalized position in the parent RectTransform that the lower left corner is
anchored to.

o setMax

The o set of the upper right corner of the rectangle relative to the upper right anchor.

o setMin

The o set of the lower left corner of the rectangle relative to the lower left anchor.

pivot

The normalized position in this RectTransform that it rotates around.

rect

The calculated rectangle in the local space of the Transform.

sizeDelta

The size of this RectTransform relative to the distances between the anchors.

Public Methods
ForceUpdateRectTransforms

Force the recalculation of RectTransforms internal data.

GetLocalCorners

Get the corners of the calculated rectangle in the local space of its
Transform.

GetWorldCorners

Get the corners of the calculated rectangle in world space.

SetInsetAndSizeFromParentEdge

Set the distance of this rectangle relative to a speci ed edge of the parent
rectangle, while also setting its size.

SetSizeWithCurrentAnchors

Makes the RectTransform calculated rect be a given size on the speci ed
axis.

Events
reapplyDrivenProperties

Event that is invoked for RectTransforms that need to have their driven properties
reapplied.

Delegates
ReapplyDrivenProperties

Delegate used for the reapplyDrivenProperties event.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

childCount

The number of children the parent Transform has.

eulerAngles

The rotation as Euler angles in degrees.

forward

The blue axis of the transform in world space.

hasChanged

Has the transform changed since the last time the ag was set to 'false'?

hierarchyCapacity

The transform capacity of the transform's hierarchy data structure.

hierarchyCount

The number of transforms in the transform's hierarchy data structure.

localEulerAngles

The rotation as Euler angles in degrees relative to the parent transform's rotation.

localPosition

Position of the transform relative to the parent transform.

localRotation

The rotation of the transform relative to the transform rotation of the parent.

localScale

The scale of the transform relative to the parent.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read Only).

lossyScale

The global scale of the object (Read Only).

parent

The parent of the transform.

position

The position of the transform in world space.

right

The red axis of the transform in world space.

root

Returns the topmost transform in the hierarchy.

rotation

The rotation of the transform in world space stored as a Quaternion.

up

The green axis of the transform in world space.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

DetachChildren

Unparents all children.

Find

Finds a child by n and returns it.

GetChild

Returns a transform child by index.

GetSiblingIndex

Gets the sibling index.

InverseTransformDirection

Transforms a direction from world space to local space. The opposite of
Transform.TransformDirection.

InverseTransformPoint

Transforms position from world space to local space.

InverseTransformVector

Transforms a vector from world space to local space. The opposite of
Transform.TransformVector.

IsChildOf

Is this transform a child of parent?

LookAt

Rotates the transform so the forward vector points at /target/'s current position.

Rotate

Applies a rotation of eulerAngles.z degrees around the z axis, eulerAngles.x
degrees around the x axis, and eulerAngles.y degrees around the y axis (in that
order).

RotateAround

Rotates the transform about axis passing through point in world coordinates by
angle degrees.

SetAsFirstSibling

Move the transform to the start of the local transform list.

SetAsLastSibling

Move the transform to the end of the local transform list.

SetParent

Set the parent of the transform.

SetPositionAndRotation

Sets the world space position and rotation of the Transform component.

SetSiblingIndex

Sets the sibling index.

TransformDirection

Transforms direction from local space to world space.

TransformPoint

Transforms position from local space to world space.

TransformVector

Transforms vector from local space to world space.

Translate

Moves the transform in the direction and distance of translation.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
An axis that can be horizontal or vertical.

Properties
Horizontal

Horizontal.

Vertical

Vertical.

Leave feedback
SWITCH TO MANUAL

Description
Enum used to specify one edge of a rectangle.

Properties
Left

The left edge.

Right

The right edge.

Top

The top edge.

Bottom

The bottom edge.

Leave feedback

Description
Utility class containing helper methods for working with RectTransform.

Static Methods
FlipLayoutAxes

Flips the horizontal and vertical axes of the RectTransform size and
alignment, and optionally its children as well.

FlipLayoutOnAxis

Flips the alignment of the RectTransform along the horizontal or
vertical axis, and optionally its children as well.

PixelAdjustPoint

Convert a given point in screen space into a pixel correct point.

PixelAdjustRect

Given a rect transform, return the corner points in pixel accurate
coordinates.

RectangleContainsScreenPoint

Does the RectTransform contain the screen point as seen from the
given camera?

ScreenPointToLocalPointInRectangle

Transform a screen space point to a position in the local space of a
RectTransform that is on the plane of its rectangle.

ScreenPointToWorldPointInRectangle

Transform a screen space point to a position in world space that is on
the plane of the given RectTransform.

Leave feedback
SWITCH TO MANUAL

Description
The re ection probe is used to capture the surroundings into a texture which is passed to the shaders and used
for re ections.
The properties are an exact match for the values shown in the Inspector.
This class is a script interface for a re ection probe component.
Re ection probes are usually just created in the Editor, but sometimes you might want to create a re ection
probe from a script:

using UnityEngine;

public class Example : MonoBehaviour
{
void Start()
{
// Make a game object
GameObject probeGameObject = new GameObject("The Reflection Probe");

// Add the reflection probe component
ReflectionProbe probeComponent = probeGameObject.AddComponent();
rend.material.mainTexture = Resources.Load("glass") as Texture;

}
}

Static Methods
FindObjectsOfTypeAll

Returns a list of all objects of Type type.

Load

Loads an asset stored at path in a Resources folder.

LoadAll

Loads all assets in a folder or le at path in a Resources folder.

LoadAsync

Asynchronously loads an asset stored at path in a Resources folder.

UnloadAsset

Unloads assetToUnload from memory.

UnloadUnusedAssets

Unloads assets that are not used.

Leave feedback
SWITCH TO MANUAL

Description
Control of an object's position through physics simulation.
Adding a Rigidbody component to an object will put its motion under the control of Unity's physics engine. Even
without adding any code, a Rigidbody object will be pulled downward by gravity and will react to collisions with
incoming objects if the right Collider component is also present.
The Rigidbody also has a scripting API that lets you apply forces to the object and control it in a physically realistic
way. For example, a car's behaviour can be speci ed in terms of the forces applied by the wheels. Given this
information, the physics engine can handle most other aspects of the car's motion, so it will accelerate realistically
and respond correctly to collisions.
In a script, the FixedUpdate function is recommended as the place to apply forces and change Rigidbody settings
(as opposed to Update, which is used for most other frame update tasks). The reason for this is that physics
updates are carried out in measured time steps that don't coincide with the frame update. FixedUpdate is called
immediately before each physics update and so any changes made there will be processed directly.
A common problem when starting out with Rigidbodies is that the game physics appears to run in "slow motion".
This is actually due to the scale used for your models. The default gravity settings assume that one world unit
corresponds to one metre of distance. With non-physical games, it doesn't make much di erence if your models
are all 100 units long but when using physics, they will be treated as very large objects. If a large scale is used for
objects that are supposed to be small, they will appear to fall very slowly - the physics engine thinks they are very
large objects falling over very large distances. With this in mind, be sure to keep your objects more or less at their
scale in real life (so a car should be about 4 units = 4 metres, for example).

Properties
angularDrag

The angular drag of the object.

angularVelocity

The angular velocity vector of the rigidbody measured in radians per second.

centerOfMass

The center of mass relative to the transform's origin.

collisionDetectionMode

The Rigidbody's collision detection mode.

constraints

Controls which degrees of freedom are allowed for the simulation of this
Rigidbody.

detectCollisions

Should collision detection be enabled? (By default always enabled).

drag

The drag of the object.

freezeRotation

Controls whether physics will change the rotation of the object.

inertiaTensor

The diagonal inertia tensor of mass relative to the center of mass.

inertiaTensorRotation

The rotation of the inertia tensor.

interpolation

Interpolation allows you to smooth out the e ect of running physics at a xed
frame rate.

isKinematic

Controls whether physics a ects the rigidbody.

mass

The mass of the rigidbody.

maxAngularVelocity

The maximimum angular velocity of the rigidbody measured in radians per
second. (Default 7) range { 0, in nity }.

maxDepenetrationVelocity

Maximum velocity of a rigidbody when moving out of penetrating state.

position

The position of the rigidbody.

rotation

The rotation of the rigidbody.

sleepThreshold

The mass-normalized energy threshold, below which objects start going to sleep.

solverIterations

The solverIterations determines how accurately Rigidbody joints and collision
contacts are resolved. Overrides Physics.defaultSolverIterations. Must be
positive.

solverVelocityIterations

The solverVelocityIterations a ects how how accurately Rigidbody joints and
collision contacts are resolved. Overrides Physics.defaultSolverVelocityIterations.
Must be positive.

useGravity

Controls whether gravity a ects this rigidbody.

velocity

The velocity vector of the rigidbody.

worldCenterOfMass

The center of mass of the rigidbody in world space (Read Only).

Public Methods
AddExplosionForce

Applies a force to a rigidbody that simulates explosion e ects.

AddForce

Adds a force to the Rigidbody.

AddForceAtPosition

Applies force at position. As a result this will apply a torque and force on the object.

AddRelativeForce

Adds a force to the rigidbody relative to its coordinate system.

AddRelativeTorque

Adds a torque to the rigidbody relative to its coordinate system.

AddTorque

Adds a torque to the rigidbody.

ClosestPointOnBounds

The closest point to the bounding box of the attached colliders.

GetPointVelocity

The velocity of the rigidbody at the point worldPoint in global space.

GetRelativePointVelocity

The velocity relative to the rigidbody at the point relativePoint.

IsSleeping

Is the rigidbody sleeping?

MovePosition

Moves the rigidbody to position.

MoveRotation

Rotates the rigidbody to rotation.

ResetCenterOfMass

Reset the center of mass of the rigidbody.

ResetInertiaTensor

Reset the inertia tensor value and rotation.

SetDensity

Sets the mass based on the attached colliders assuming a constant density.

Sleep

Forces a rigidbody to sleep at least one frame.

SweepTest

Tests if a rigidbody would collide with anything, if it was moved through the Scene.

SweepTestAll

Like Rigidbody.SweepTest, but returns all hits.

WakeUp

Forces a rigidbody to wake up.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Rigidbody physics component for 2D sprites.
The Rigidbody2D class essentially provides the same functionality in 2D that the Rigidbody class provides in 3D.
Adding a Rigidbody2D component to a sprite puts it under the control of the physics engine. By itself, this means
that the sprite will be a ected by gravity and can be controlled from scripts using forces. By adding the
appropriate collider component, the sprite will also respond to collisions with other sprites. This behaviour comes
entirely from Unity's physics system; very little code is required to get impressive and authentic physical
behaviour and allows for "emergent" gameplay that was not explicitly coded into the game.
See Also: Rigidbody class, SpriteRenderer class, Collider2D class, Joint2D class.

Properties
angularDrag

Coe cient of angular drag.

angularVelocity

Angular velocity in degrees per second.

attachedColliderCount

Returns the number of Collider2D attached to this Rigidbody2D.

bodyType

The physical behaviour type of the Rigidbody2D.

centerOfMass

The center of mass of the rigidBody in local space.

collisionDetectionMode

The method used by the physics engine to check if two objects have collided.

constraints

Controls which degrees of freedom are allowed for the simulation of this
Rigidbody2D.

drag

Coe cient of drag.

freezeRotation

Controls whether physics will change the rotation of the object.

gravityScale

The degree to which this object is a ected by gravity.

inertia

The rigidBody rotational inertia.

interpolation

Physics interpolation used between updates.

isKinematic

Should this rigidbody be taken out of physics control?

mass

Mass of the Rigidbody.

position

The position of the rigidbody.

rotation

The rotation of the rigidbody.

sharedMaterial

The PhysicsMaterial2D that is applied to all Collider2D attached to this
Rigidbody2D.

simulated

Indicates whether the rigid body should be simulated or not by the physics
system.

sleepMode

The sleep state that the rigidbody will initially be in.

useAutoMass

Should the total rigid-body mass be automatically calculated from the
[[Collider2D.density]] of attached colliders?

useFullKinematicContacts

Should kinematic/kinematic and kinematic/static collisions be allowed?

velocity

Linear velocity of the rigidbody.

worldCenterOfMass

Gets the center of mass of the rigidBody in global space.

Public Methods
AddForce

Apply a force to the rigidbody.

AddForceAtPosition

Apply a force at a given position in space.

AddRelativeForce

Adds a force to the rigidbody2D relative to its coordinate system.

AddTorque

Apply a torque at the rigidbody's centre of mass.

Cast

All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene
starting at each collider position ignoring the colliders attached to the same
Rigidbody2D.

Distance

Calculates the minimum distance of this collider against all Collider2D attached to
this Rigidbody2D.

GetAttachedColliders

Returns all Collider2D that are attached to this Rigidbody2D.

GetContacts

Retrieves all contact points for all of the collider(s) attached to this rigidbody.

GetPoint

Get a local space point given the point point in rigidBody global space.

GetPointVelocity

The velocity of the rigidbody at the point Point in global space.

GetRelativePoint

Get a global space point given the point relativePoint in rigidBody local space.

GetRelativePointVelocity

The velocity of the rigidbody at the point Point in local space.

GetRelativeVector

Get a global space vector given the vector relativeVector in rigidBody local space.

GetVector

Get a local space vector given the vector vector in rigidBody global space.

IsAwake

Is the rigidbody "awake"?

IsSleeping

Is the rigidbody "sleeping"?

IsTouching

Checks whether the collider is touching any of the collider(s) attached to this
rigidbody or not.

IsTouchingLayers

Checks whether any of the collider(s) attached to this rigidbody are touching any
colliders on the speci ed layerMask or not.

MovePosition

Moves the rigidbody to position.

MoveRotation

Rotates the rigidbody to angle (given in degrees).

OverlapCollider

Get a list of all colliders that overlap all colliders attached to this Rigidbody2D.

OverlapPoint

Check if any of the Rigidbody2D colliders overlap a point in space.

Sleep

Make the rigidbody "sleep".

WakeUp

Disables the "sleeping" state of a rigidbody.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The runtime representation of the AnimatorController. Use this representation to change the Animator Controller
during runtime.

Properties
animationClips

Retrieves all AnimationClip used by the controller.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Scales render textures to support dynamic resolution if the target platform/graphics API supports it.
The ScalableBu erManager handles the scaling of any render textures that you have marked to be
DynamicallyScalable, when ResizeBu ers is called. All render textures marked as DynamicallyScalable are scaled
by a width and height scale factor, the reason the scale is controlled through a scale factor and not with a speci c
width and height value is because di erent render textures will be di erent sizes but will want to be scaled by a
common factor.

Static Properties
heightScaleFactor

Height scale factor to control dynamic resolution.

widthScaleFactor

Width scale factor to control dynamic resolution.

Static Methods
ResizeBu ers

Function to resize all bu ers marked as DynamicallyScalable.

Leave feedback

Description
Access to display information.
Screen class can be used to get the list of supported resolutions, switch the current resolution, hide or show the
system mouse pointer.

Static Properties
autorotateToLandscapeLeft

Allow auto-rotation to landscape left?

autorotateToLandscapeRight

Allow auto-rotation to landscape right?

autorotateToPortrait

Allow auto-rotation to portrait?

autorotateToPortraitUpsideDown

Allow auto-rotation to portrait, upside down?

currentResolution

The current screen resolution (Read Only).

dpi

The current DPI of the screen / device (Read Only).

fullScreen

Is the game running full-screen?

fullScreenMode

Set this property to one of the values in FullScreenMode to change the
display mode of your application.

height

The current height of the screen window in pixels (Read Only).

orientation

Speci es logical orientation of the screen.

resolutions

All full-screen resolutions supported by the monitor (Read Only).

safeArea

Returns the safe area of the screen in pixels (Read Only).

sleepTimeout

A power saving setting, allowing the screen to dim some time after the
last active user interaction.

width

The current width of the screen window in pixels (Read Only).

Static Methods
SetResolution

Switches the screen resolution.

Leave feedback

Description
Functionality to take Screenshots.

Static Methods
CaptureScreenshot

Captures a screenshot at path lename as a PNG le.

CaptureScreenshotAsTexture

Captures a screenshot of the game view into a Texture2D object.

Leave feedback

Description
Enumeration specifying the eye texture to capture when using ScreenCapture.CaptureScreenshot and when
stereo rendering is enabled.
The CaptureScreenshot method will default to StereoScreenCaptureMode.LeftEye. When captured in stereo
mode, the resolution of the screenshot will be the size of the game window on the main display.

Properties
LeftEye

The Left Eye is captured. This is the default setting for the CaptureScreenshot method.

RightEye

The Right Eye is captured.

BothEyes

Both the left and right eyes are captured and composited into one image.

Leave feedback
SWITCH TO MANUAL

Description
A class you can derive from if you want to create objects that don't need to be attached to game objects.
This is most useful for assets which are only meant to store data.
To make it easy to create ScriptableObject instances that are bound to assets in your project, see
CreateAssetMenuAttribute.

Static Methods
CreateInstance

Creates an instance of a scriptable object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Webplayer security related class. Not supported from 5.4.0 onwards.

Leave feedback
SWITCH TO MANUAL

Description
Shader scripts used for all rendering.
Most of the advanced rendering is controlled via Material class. Shader class is mostly used just to check whether
a shader can run on the user's hardware (isSupported property), setting up global shader properties and
keywords, and nding shaders by name (Find method).
See Also: Material class, Materials, ShaderLab documentation.

Static Properties
globalMaximumLOD

Shader LOD level for all shaders.

globalRenderPipeline

Render pipeline currently in use.

Properties
isSupported

Can this shader run on the end-users graphics card? (Read Only)

maximumLOD

Shader LOD level for this shader.

renderQueue

Render queue of this shader. (Read Only)

Static Methods
DisableKeyword

Unset a global shader keyword.

EnableKeyword

Set a global shader keyword.

Find

Finds a shader with the given name.

GetGlobalColor

Gets a global color property for all shaders previously set using SetGlobalColor.

GetGlobalFloat

Gets a global oat property for all shaders previously set using SetGlobalFloat.

GetGlobalFloatArray

Gets a global oat array for all shaders previously set using SetGlobalFloatArray.

GetGlobalInt

Gets a global int property for all shaders previously set using SetGlobalInt.

GetGlobalMatrix

Gets a global matrix property for all shaders previously set using SetGlobalMatrix.

GetGlobalMatrixArray

Gets a global matrix array for all shaders previously set using SetGlobalMatrixArray.

GetGlobalTexture

Gets a global texture property for all shaders previously set using SetGlobalTexture.

GetGlobalVector

Gets a global vector property for all shaders previously set using SetGlobalVector.

GetGlobalVectorArray

Gets a global vector array for all shaders previously set using SetGlobalVectorArray.

IsKeywordEnabled

Is global shader keyword enabled?

PropertyToID

Gets unique identi er for a shader property name.

SetGlobalBu er

Sets a global compute bu er property for all shaders.

SetGlobalColor

Sets a global color property for all shaders.

SetGlobalFloat

Sets a global oat property for all shaders.

SetGlobalFloatArray

Sets a global oat array property for all shaders.

SetGlobalInt

Sets a global int property for all shaders.

SetGlobalMatrix

Sets a global matrix property for all shaders.

SetGlobalMatrixArray

Sets a global matrix array property for all shaders.

SetGlobalTexture

Sets a global texture property for all shaders.

SetGlobalVector

Sets a global vector property for all shaders.

SetGlobalVectorArray

Sets a global vector array property for all shaders.

WarmupAllShaders

Fully load all shaders to prevent future performance hiccups.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
ShaderVariantCollection records which shader variants are actually used in each shader.
This is used for shader preloading ("warmup"), so that a game can make sure "actually required" shader variants
are loaded at startup (or level load time), to avoid shader compilation related hiccups later on in the game.
In Unity, many shaders internally have multiple "variants", to account for di erent light modes, lightmaps,
shadows and so on. These variants are indenti ed by a shader pass type, and a set of shader keywords. See
ShaderVariant.
Typical use of ShaderVariantCollection is to record the shader variants used during a play session from the editor
(under Graphics Settings), save them out as an asset, and add to the list of preloaded shaders (again in Graphics
Settings). Additionally, you could call WarmUp on a ShaderVariantCollection object manually.
ShaderVariantCollection generally replaces the old Shader.WarmupAllShaders function.

Properties
isWarmedUp

Is this ShaderVariantCollection already warmed up? (Read Only)

shaderCount

Number of shaders in this collection (Read Only).

variantCount

Number of total varians in this collection (Read Only).

Constructors
ShaderVariantCollection

Create a new empty shader variant collection.

Public Methods
Add

Adds a new shader variant to the collection.

Clear

Remove all shader variants from the collection.

Contains

Checks if a shader variant is in the collection.

Remove

Adds shader variant from the collection.

WarmUp

Fully load shaders in ShaderVariantCollection.

Inherited Members

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Identi es a speci c variant of a shader.
In Unity, many shaders internally have multiple "variants", to account for di erent light modes, lightmaps,
shadows and so on. These variants are indenti ed by a shader pass type, and a set of shader keywords. See
ShaderVariantCollection.
Note that creating a ShaderVariant will throw an ArgumentException if shader is null, pass type does not exist or
variant with the passed keywords is not found.

Properties
keywords

Array of shader keywords to use in this variant.

passType

Pass type to use in this variant.

shader

Shader to use in this variant.

Constructors
ShaderVariantCollection.ShaderVariant

Creates a ShaderVariant structure.

Leave feedback

Description
Details of the Transform name mapped to the skeleton bone of a model and its default position and rotation in
the T-pose.
The skeleton models used in Unity have multiple bones. The SkeletonBone struct has properties that are used to
describe the position, rotation and scale of each bone. The bones are not shown. A
MonoBehaviour.OnDrawGizmosSelected tool can be created to view the skeleton. An array of SkeletonBone
positions can be used to make a line model using Gizmos.DrawLine.
An array of SkeletonBones are used in HumanDescription.skeleton.

Properties
name

The name of the Transform mapped to the bone.

position

The T-pose position of the bone in local space.

rotation

The T-pose rotation of the bone in local space.

scale

The T-pose scaling of the bone in local space.

Leave feedback
SWITCH TO MANUAL

Description
The Skinned Mesh lter.

Properties
bones

The bones used to skin the mesh.

forceMatrixRecalculationPerRender

Forces the Skinned Mesh to recalculate its matricies when rendered

localBounds

AABB of this Skinned Mesh in its local space.

quality

The maximum number of bones a ecting a single vertex.

sharedMesh

The mesh used for skinning.

skinnedMotionVectors

Speci es whether skinned motion vectors should be used for this
renderer.

updateWhenO screen

If enabled, the Skinned Mesh will be updated when o screen. If
disabled, this also disables updating animations.

Public Methods
BakeMesh

Creates a snapshot of SkinnedMeshRenderer and stores it in mesh.

GetBlendShapeWeight

Returns the weight of a BlendShape for this Renderer.

SetBlendShapeWeight

Sets the weight of a BlendShape for this Renderer.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback
SWITCH TO MANUAL

Description
A script interface for the skybox component.
The skybox class has only the material property.
See Also: skybox component.

Properties
material

The material used by the skybox.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Constants for special values of Screen.sleepTimeout.
Use them to specify something other than a xed amount of seconds before dimming the screen.

Static Properties
NeverSleep

Prevent screen dimming.

SystemSetting

Set the sleep timeout to whatever the user has speci ed in the system settings.

Leave feedback
SWITCH TO MANUAL

Description
Joint that restricts the motion of a Rigidbody2D object to a single line.
See Also: Rigidbody2D, DistanceJoint2D, HingeJoint2D, SpringJoint2D, JointTranslationLimits2D.

Properties
angle

The angle of the line in space (in degrees).

autoCon gureAngle

Should the angle be calculated automatically?

jointSpeed

The current joint speed.

jointTranslation

The current joint translation.

limits

Restrictions on how far the joint can slide in each direction along the line.

limitState

Gets the state of the joint limit.

motor

Parameters for a motor force that is applied automatically to the Rigibody2D along the
line.

referenceAngle

The angle (in degrees) referenced between the two bodies used as the constraint for
the joint.

useLimits

Should motion limits be used?

useMotor

Should a motor force be applied automatically to the Rigidbody2D?

Public Methods
GetMotorForce

Gets the motor force of the joint given the speci ed timestep.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
Generic access to the Social API.
Social.Active can be used to target a speci c social platform implementation, but by default GameCenter is used
on iOS. All other platforms default to the Local implementation which can be used for testing. See Social API
Reference Manual for an overview.
The Social class should always be used as an entry point. It contains helper functions for accessing the current
active implementation and always uses the interfaces of the other Social API classes. This way it is easier to use
versions of the interfaces which have been extended beyond the generic API by the implementation.
There are various classes accociated with the Social API and all of these reside in the UnityEngine.SocialPlatforms
namespace. You need to import/use this namespace in order to use these classes.

See Also: GameCenterPlatform.

Static Properties
Active

This is the currently active social platform.

localUser

The local user (potentially not logged in).

Static Methods
CreateAchievement

Create an IAchievement instance.

CreateLeaderboard

Create an ILeaderboard instance.

LoadAchievementDescriptions

Loads the achievement descriptions accociated with this application.

LoadAchievements

Load the achievements the logged in user has already achieved or reported
progress on.

LoadScores

Load a default set of scores from the given leaderboard.

LoadUsers

Load the user pro les accociated with the given array of user IDs.

ReportProgress

Reports the progress of an achievement.

ReportScore

Report a score to a speci c leaderboard.

ShowAchievementsUI

Show a default/system view of the games achievements.

ShowLeaderboardUI

Show a default/system view of the games leaderboards.

Leave feedback

Description
The limits de ned by the CharacterJoint.

Properties
bounciness

When the joint hits the limit, it can be made to bounce o it.

contactDistance

Determines how far ahead in space the solver can "see" the joint limit.

limit

The limit position/angle of the joint (in degrees).

Leave feedback

Description
The con guration of the spring attached to the joint's limits: linear and angular. Used by CharacterJoint and
Con gurableJoint.

Properties
damper

The damping of the spring limit. In e ect when the sti ness of the sprint limit is not zero.

spring

The sti ness of the spring limit. When sti ness is zero the limit is hard, otherwise soft.

Leave feedback

Description
SortingLayer allows you to set the render order of multiple sprites easily. There is always a default SortingLayer
named "Default" which all sprites are added to initially. Added more SortingLayers to easily control the order of
rendering of groups of sprites. Layers can be ordered before or after the default layer.
See Also: Tags and Layers.

Static Properties
layers

Returns all the layers de ned in this project.

Properties
id

This is the unique id assigned to the layer. It is not an ordered running value and it should
not be used to compare with other layers to determine the sorting order.

name

Returns the name of the layer as de ned in the TagManager.

value

This is the relative value that indicates the sort order of this layer relative to the other
layers.

Static Methods
GetLayerValueFromID

Returns the nal sorting layer value. To determine the sorting order between the
various sorting layers, use this method to retrieve the nal sorting value and use
CompareTo to determine the order.

GetLayerValueFromName

Returns the nal sorting layer value. See Also: GetLayerValueFromID.

IDToName

Returns the unique id of the layer. Will return "" if an invalid id is
given.

IsValid

Returns true if the id provided is a valid layer id.

NameToID

Returns the id given the name. Will return 0 if an invalid name was given.

Leave feedback

Description
Class for handling Sparse Textures.
Sparse textures are textures where not the whole texture data can be present in memory at once. They are also
commonly called "tiled textures" or "mega textures".
Imagine a 16384x16384 texture at 32 bits per pixel - it would take 1GB of memory. The texture is broken down
into rectangular "tiles", and each tile can either be present in memory or not. You can load & unload these tiles as
needed based on distance from the camera, sectors of the world that the player has to see, etc.
Otherwise, the sparse textures behave just like any other texture in shaders - they can have mipmaps, can use all
texture ltering modes, etc. If you happen to read from a tile that's not present, you can get unde ned result (on
many GPUs the result is a black color, but that's not guaranteed).
Not all hardware and platforms support sparse textures, so you should check
SystemInfo.supportsSparseTextures before using them. For example, on DirectX systems they require DX11.2
(Windows 8.1) and a fairly recent GPU; and on OpenGL they require ARB_sparse_texture extension support.
Sparse textures only support non-compressed texture formats.
After creating the sparse texture, query the tile size with tileWidth & tileHeight. Tile sizes are platform and GPU
dependent.
Use UpdateTile or UpdateTileRaw to make a tile resident in memory and update its color data. Use UnloadTile to
unload a tile.
See Also: Sparse Textures.

Properties
isCreated

Is the sparse texture actually created? (Read Only)

tileHeight

Get sparse texture tile height (Read Only).

tileWidth

Get sparse texture tile width (Read Only).

Constructors
SparseTexture

Create a sparse texture.

Public Methods
UnloadTile

Unload sparse texture tile.

UpdateTile

Update sparse texture tile with color values.

UpdateTileRaw

Update sparse texture tile with raw pixel values.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A sphere-shaped primitive collider.
See Also: BoxCollider, CapsuleCollider, PhysicMaterial, Rigidbody.

Properties
center

The center of the sphere in the object's local space.

radius

The radius of the sphere measured in the object's local space.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback

Description
A Splat prototype is just a texture that is used by the TerrainData.
A class on a Terrain GameObject.

Properties
metallic

The metallic value of the splat layer.

normalMap

Normal map of the splat applied to the Terrain.

smoothness

The smoothness value of the splat layer when the main texture has no alpha channel.

texture

Texture of the splat applied to the Terrain.

tileO set

O set of the tile texture of the SplatPrototype.

tileSize

Size of the tile used in the texture of the SplatPrototype.

Leave feedback
SWITCH TO MANUAL

Description
The spring joint ties together 2 rigid bodies, spring forces will be automatically applied to keep the object at the
given distance.
The Spring attempts to maintain the distance it has when it starts out. So if your joint's start at a rest position
where the two rigidbodies are far apart, then the joint will attempt to maintain that distance. The minDistance
and maxDistance properties add on top of this implicit distance.

Properties
damper

The damper force used to dampen the spring force.

maxDistance

The maximum distance between the bodies relative to their initial distance.

minDistance

The minimum distance between the bodies relative to their initial distance.

spring

The spring force used to keep the two objects together.

tolerance

The maximum allowed error between the current spring length and the length de ned by
minDistance and maxDistance.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

anchor

The Position of the anchor around which the joints motion is constrained.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

axis

The Direction of the axis around which the body is constrained.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedAnchor

Position of the anchor relative to the connected Rigidbody.

connectedBody

A reference to another rigidbody this joint connects to.

connectedMassScale

The scale to apply to the inverse mass and inertia tensor of the connected
body prior to solving the constraints.

currentForce

The force applied by the solver to satisfy all constraints.

currentTorque

The torque applied by the solver to satisfy all constraints.

enableCollision

Enable collision between bodies connected with the joint.

enablePreprocessing

Toggle preprocessing for this joint.

massScale

The scale to apply to the inverse mass and inertia tensor of the body prior
to solving the constraints.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods

Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak

Called when a joint attached to the same game object broke.

Leave feedback
SWITCH TO MANUAL

Description
Joint that attempts to keep two Rigidbody2D objects a set distance apart by applying a force between them.
Note that unlike DistanceJoint2D, the length of the joint can stretch and oscillate.
See Also: DistanceJoint2D, HingeJoint2D, SliderJoint2D.

Properties
autoCon gureDistance

Should the distance be calculated automatically?

dampingRatio

The amount by which the spring force is reduced in proportion to the movement
speed.

distance

The distance the spring will try to keep between the two objects.

frequency

The frequency at which the spring oscillates around the distance distance between
the objects.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
Represents a Sprite object for use in 2D gameplay.
Sprites are 2D graphic objects used for characters, props, projectiles and other elments of 2D gameplay. The
graphics are obtained from bitmap images - Texture2D. The Sprite class primarily identi es the section of the
image that should be used for a speci c sprite. This information can then be used by a SpriteRenderer
component on a GameObject to actually display the graphic.
See Also: SpriteRenderer class.

Properties
associatedAlphaSplitTexture

Returns the texture that contains the alpha channel from the source texture.
Unity generates this texture under the hood for sprites that have alpha in the
source, and need to be compressed using techniques like ETC1.Returns NULL if
there is no associated alpha texture for the source sprite. This is the case if the
sprite has not been setup to use ETC1 compression.

border

Returns the border sizes of the sprite.

bounds

Bounds of the Sprite, speci ed by its center and extents in world space units.

packed

Returns true if this Sprite is packed in an atlas.

packingMode

If Sprite is packed (see Sprite.packed), returns its SpritePackingMode.

packingRotation

If Sprite is packed (see Sprite.packed), returns its SpritePackingRotation.

pivot

Location of the Sprite's center point in the Rect on the original Texture,
speci ed in pixels.

pixelsPerUnit

The number of pixels in the sprite that correspond to one unit in world space.
(Read Only)

rect

Location of the Sprite on the original Texture, speci ed in pixels.

texture

Get the reference to the used texture. If packed this will point to the atlas, if not
packed will point to the source sprite.

textureRect

Get the rectangle this sprite uses on its texture. Raises an exception if this
sprite is tightly packed in an atlas.

textureRectO set

Gets the o set of the rectangle this sprite uses on its texture to the original
sprite bounds. If sprite mesh type is FullRect, o set is zero.

triangles

Returns a copy of the array containing sprite mesh triangles.

uv

The base texture coordinates of the sprite mesh.

vertices

Returns a copy of the array containing sprite mesh vertex positions.

Public Methods
GetPhysicsShape

Gets a physics shape from the Sprite by its index.

GetPhysicsShapeCount

The number of physics shapes for the Sprite.

GetPhysicsShapePointCount

The number of points in the selected physics shape for the Sprite.

OverrideGeometry

Sets up new Sprite geometry.

OverridePhysicsShape

Sets up a new Sprite physics shape.

Static Methods
Create

Create a new Sprite object.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
A component for masking Sprites and Particles.
By default it will mask all Sorting Layers. A custom range of Sorting Layers can be set. If a SortingGroup is present,
it will act local to the SortingGroup.

Properties
alphaCuto

The minimum alpha value used by the mask to select the area of in uence de ned
over the mask's sprite.

backSortingLayerID

Unique ID of the sorting layer de ning the end of the custom range.

backSortingOrder

Order within the back sorting layer de ning the end of the custom range.

frontSortingLayerID

Unique ID of the sorting layer de ning the start of the custom range.

frontSortingOrder

Order within the front sorting layer de ning the start of the custom range.

isCustomRangeActive

Mask sprites from front to back sorting values only.

sprite

The Sprite used to de ne the mask.

spriteSortPoint

Determines the position of the Sprite used for sorting the SpriteMask.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback
SWITCH TO MANUAL

Description
Renders a Sprite for 2D graphics.

//This example outputs Sliders that control the red green and blue elements of a
//Attach this to a GameObject and attach a SpriteRenderer component

using UnityEngine;

public class Example : MonoBehaviour
{
SpriteRenderer m_SpriteRenderer;
//The Color to be assigned to the Renderer’s Material
Color m_NewColor;

//These are the values that the Color Sliders return
float m_Red, m_Blue, m_Green;

void Start()
{
//Fetch the SpriteRenderer from the GameObject
m_SpriteRenderer = GetComponent();
//Set the GameObject's Color quickly to a set Color (blue)
m_SpriteRenderer.color = Color.blue;
}

void OnGUI()
{
//Use the Sliders to manipulate the RGB component of Color
//Use the Label to identify the Slider
GUI.Label(new Rect(0, 30, 50, 30), "Red: ");
//Use the Slider to change amount of red in the Color
m_Red = GUI.HorizontalSlider(new Rect(35, 25, 200, 30), m_Red, 0, 1);

//The Slider manipulates the amount of green in the GameObject

GUI.Label(new Rect(0, 70, 50, 30), "Green: ");
m_Green = GUI.HorizontalSlider(new Rect(35, 60, 200, 30), m_Green, 0, 1)

//This Slider decides the amount of blue in the GameObject
GUI.Label(new Rect(0, 105, 50, 30), "Blue: ");
m_Blue = GUI.HorizontalSlider(new Rect(35, 95, 200, 30), m_Blue, 0, 1);

//Set the Color to the values gained from the Sliders
m_NewColor = new Color(m_Red, m_Green, m_Blue);

//Set the SpriteRenderer to the Color defined by the Sliders
m_SpriteRenderer.color = m_NewColor;
}
}

Properties
adaptiveModeThreshold

The current threshold for Sprite Renderer tiling.

color

Rendering color for the Sprite graphic.

drawMode

The current draw mode of the Sprite Renderer.

ipX

Flips the sprite on the X axis.

ipY

Flips the sprite on the Y axis.

maskInteraction

Speci es how the sprite interacts with the masks.

size

Property to set/get the size to render when the SpriteRenderer.drawMode is set to
SpriteDrawMode.Sliced.

sprite

The Sprite to render.

spriteSortPoint

Determines the position of the Sprite used for sorting the SpriteRenderer.

tileMode

The current tile mode of the Sprite Renderer.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback

Description
StateMachineBehaviour is a component that can be added to a state machine state. It's the base class every script
on a state derives from.
By default the Animator does instantiate a new instance of each behaviour de ne in the controller. The class
attribute SharedBetweenAnimatorsAttribute control how behaviours are instantiated.
StateMachineBehaviour has some prede ned messages: OnStateEnter, OnStateExit, OnStateIK, OnStateMove,
OnStateUpdate.

using UnityEngine;

public class AttackBehaviour : StateMachineBehaviour
{
public GameObject particle;
public float radius;
public float power;

protected GameObject clone;

override public void OnStateEnter(Animator animator, AnimatorStateInfo state
{
clone = Instantiate(particle, animator.rootPosition, Quaternion.identity
Rigidbody rb = clone.GetComponent();
rb.AddExplosionForce(power, animator.rootPosition, radius, 3.0f);
}

override public void OnStateExit(Animator animator, AnimatorStateInfo stateI
{
Destroy(clone);
}

override public void OnStateUpdate(Animator animator, AnimatorStateInfo stat
{
Debug.Log("On Attack Update ");
}

override public void OnStateMove(Animator animator, AnimatorStateInfo stateI
{
Debug.Log("On Attack Move ");
}

override public void OnStateIK(Animator animator, AnimatorStateInfo stateInf
{
Debug.Log("On Attack IK ");
}
}

Public Methods
OnStateMachineEnter

Called on the rst Update frame when making a transition to a state machine. This is
not called when making a transition into a state machine sub-state.

OnStateMachineExit

Called on the last Update frame when making a transition out of a StateMachine. This
is not called when making a transition into a StateMachine sub-state.

Messages
OnStateEnter

Called on the rst Update frame when a state machine evaluate this state.

OnStateExit

Called on the last update frame when a state machine evaluate this state.

OnStateIK

Called right after MonoBehaviour.OnAnimatorIK.

OnStateMove

Called right after MonoBehaviour.OnAnimatorMove.

OnStateUpdate

Called at each Update frame except for the rst and last frame.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

CreateInstance

Creates an instance of a scriptable object.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
Awake

This function is called when the ScriptableObject script is started.

OnDestroy

This function is called when the scriptable object will be destroyed.

OnDisable

This function is called when the scriptable object goes out of scope.

OnEnable

This function is called when the object is loaded.

Leave feedback

Description
StaticBatchingUtility can prepare your objects to take advantage of Unity's static batching.
This step is useful as a performance optimization allowing engine to reduce number of draw-calls dramatically,
but keep amount of rendered geometry intact.
By calling one of the Combine methods you will create an internal mesh which will contain combined geometry,
however each original GameObject will be present in the Scene and will be culled individually. The fact that
GameObjects can be culled individually allows run-time to render the same amount of geometry as it would
without batching, unlike combining geometry in the modeling tool. Combining geometry in the modeling tool
prevents e cient culling and results in much higher amount of geometry being rendered.
Note that you do not need to call Combine methods on objects which were already marked as "Static" in the
Editor. They will be prepared for static batching automatically during the Build Player step.
IMPORTANT: only objects with the same material can be batched, thus it is useful to share as many
textures/material as you can.

Static Methods
Combine

StaticBatchingUtility.Combine prepares all children of the staticBatchRoot for static
batching.

Leave feedback

Description
A StreamingController controls the streaming settings for an individual camera location.
The StreamingController component is used to control texture streaming settings for a camera location. This
component supports the preloading of textures in advance of a Camera becoming enabled. See SetPreloading
The QualitySettings.streamingMipmapsFeature must be enabled and active for this feature to work.
The Camera is not considered for texture streaming when this component is disabled. When this component is
enabled the Camera is considered for texture streaming if the Camera is enabled or the StreamingController is in
the preloading state.
A mipmap bias can be applied for texture streaming calculations. See streamingMipmapBias for details.
See Also: camera component.

Properties
streamingMipmapBias

O set applied to the mipmap level chosen by the texture streaming system for any
textures visible from this camera. This O set can take either a positive or negative
value.

Public Methods
CancelPreloading

Abort preloading.

IsPreloading

Used to nd out whether the StreamingController is currently preloading texture
mipmaps.

SetPreloading

Initiate preloading of streaming data for this camera.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Applies tangent forces along the surfaces of colliders.
When the source Collider2D is a trigger, the e ector will apply forces whenever the target Collider2D overlaps the
source. When the source Collider isn't a trigger, the e ector will apply forces whenever the target Collider2D is in
contact with the source only.
This e ector can be used to create constant speed elevators and moving surfaces.

Properties
forceScale

The scale of the impulse force applied while attempting to reach the surface speed.

speed

The speed to be maintained along the surface.

speedVariation

The speed variation (from zero to the variation) added to base speed to be applied.

useBounce

Should bounce be used for any contact with the surface?

useContactForce

Should the impulse force but applied to the contact point?

useFriction

Should friction be used for any contact with the surface?

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

colliderMask

The mask used to select speci c layers allowed to interact with the e ector.

useColliderMask

Should the collider-mask be used or the global collision matrix?

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Access system and hardware information.
Use this class to gure out capabilities of the underlying platform and hardware. For example, you can check
which RenderTexture formats are supported (SupportsRenderTextureFormat), how many CPU threads are
available (processorCount), and so on.

Static Properties
batteryLevel

The current battery level (Read Only).

batteryStatus

Returns the current status of the device's battery (Read Only).

copyTextureSupport

Support for various Graphics.CopyTexture cases (Read Only).

deviceModel

The model of the device (Read Only).

deviceName

The user de ned name of the device (Read Only).

deviceType

Returns the kind of device the application is running on (Read Only).

deviceUniqueIdenti er

A unique device identi er. It is guaranteed to be unique for every
device (Read Only).

graphicsDeviceID

The identi er code of the graphics device (Read Only).

graphicsDeviceName

The name of the graphics device (Read Only).

graphicsDeviceType

The graphics API type used by the graphics device (Read Only).

graphicsDeviceVendor

The vendor of the graphics device (Read Only).

graphicsDeviceVendorID

The identi er code of the graphics device vendor (Read Only).

graphicsDeviceVersion

The graphics API type and driver version used by the graphics
device (Read Only).

graphicsMemorySize

Amount of video memory present (Read Only).

graphicsMultiThreaded

Is graphics device using multi-threaded rendering (Read Only)?

graphicsShaderLevel

Graphics device shader capability level (Read Only).

graphicsUVStartsAtTop

Returns true if the texture UV coordinate convention for this
platform has Y starting at the top of the image.

hasHiddenSurfaceRemovalOnGPU

True if the GPU supports hidden surface removal.

maxCubemapSize

Maximum Cubemap texture size (Read Only).

maxTextureSize

Maximum texture size (Read Only).

npotSupport

What NPOT (non-power of two size) texture support does the GPU
provide? (Read Only)

operatingSystem

Operating system name with version (Read Only).

operatingSystemFamily

Returns the operating system family the game is running on (Read
Only).

processorCount

Number of processors present (Read Only).

processorFrequency

Processor frequency in MHz (Read Only).

processorType

Processor name (Read Only).

supportedRenderTargetCount

How many simultaneous render targets (MRTs) are supported?
(Read Only)

supports2DArrayTextures

Are 2D Array textures supported? (Read Only)

supports32bitsIndexBu er

Are 32-bit index bu ers supported? (Read Only)

supports3DRenderTextures

Are 3D (volume) RenderTextures supported? (Read Only)

supports3DTextures

Are 3D (volume) textures supported? (Read Only)

supportsAccelerometer

Is an accelerometer available on the device?

supportsAsyncCompute

Returns true when the platform supports asynchronous compute
queues and false if otherwise.Note that asynchronous compute
queues are only supported on PS4.

supportsAsyncGPUReadback

Returns true if asynchronous readback of GPU data is available for
this device and false otherwise.

supportsAudio

Is there an Audio device available for playback? (Read Only)

supportsComputeShaders

Are compute shaders supported? (Read Only)

supportsCubemapArrayTextures

Are Cubemap Array textures supported? (Read Only)

supportsGPUFence

Returns true when the platform supports GPUFences and false if
otherwise.Note that GPUFences are only supported on PS4.

supportsGyroscope

Is a gyroscope available on the device?

supportsHardwareQuadTopology

Does the hardware support quad topology? (Read Only)

supportsImageE ects

Are image e ects supported? (Read Only)

supportsInstancing

Is GPU draw call instancing supported? (Read Only)

supportsLocationService

Is the device capable of reporting its location?

supportsMipStreaming

Is streaming of texture mip maps supported? (Read Only)

supportsMotionVectors

Whether motion vectors are supported on this platform.

supportsMultisampleAutoResolve

Returns true if multisampled textures are resolved automatically

supportsMultisampledTextures

Are multisampled textures supported? (Read Only)

supportsRawShadowDepthSampling

Is sampling raw depth from shadowmaps supported? (Read Only)

supportsRenderToCubemap

Are cubemap render textures supported? (Read Only)

supportsSeparatedRenderTargetsBlend

Returns true when the platform supports di erent blend modes
when rendering to multiple render targets, or false otherwise.

supportsShadows

Are built-in shadows supported? (Read Only)

supportsSparseTextures

Are sparse textures supported? (Read Only)

supportsTextureWrapMirrorOnce

Returns true if the 'Mirror Once' texture wrap mode is supported.
(Read Only)

supportsVibration

Is the device capable of providing the user haptic feedback by
vibration?

systemMemorySize

Amount of system memory present (Read Only).

unsupportedIdenti er

Value returned by SystemInfo string properties which are not
supported on the current platform.

usesReversedZBu er

This property is true if the current platform uses a reversed depth
bu er (where values range from 1 at the near plane and 0 at far
plane), and false if the depth bu er is normal (0 is near, 1 is far).
(Read Only)

Static Methods
IsFormatSupported

Veri es that the speci ed graphics format is supported for the
speci ed usage.

SupportsBlendingOnRenderTextureFormat

Is blending supported on render texture format?

SupportsRenderTextureFormat

Is render texture format supported?

SupportsTextureFormat

Is texture format supported on this device?

Leave feedback
SWITCH TO MANUAL

Description
The joint attempts to move a Rigidbody2D to a speci c target position.
This joint is the only joint that doesn't connect two Rigidbody2D together. Instead, it only operates on the single
body it is connected to.
When connected, it will attempt to move the body to a speci ed target position. When setting a target you can
also set the anchor position which is a point relative to the Rigidbody2D where forces will be applied.
The joint moves the body using a con gurable spring that has a force limit.
An example usage for this joint might be to enable Collider2D to be dragged, selecting an anchor point and
moving the body to the position under the mouse.

Properties
anchor

The local-space anchor on the rigid-body the joint is attached to.

autoCon gureTarget

Should the target be calculated automatically?

dampingRatio

The amount by which the target spring force is reduced in proportion to the
movement speed.

frequency

The frequency at which the target spring oscillates around the target position.

maxForce

The maximum force that can be generated when trying to maintain the target joint
constraint.

target

The world-space position that the joint will attempt to move the body to.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie, the object
without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback

Description
The Terrain component renders the terrain.

Static Properties
activeTerrain

The active terrain. This is a convenience function to get to the main terrain
in the Scene.

activeTerrains

The active terrains in the Scene.

heightmapRenderTextureFormat

RenderTextureFormat of the terrain heightmap.

heightmapTextureFormat

Texture format of the terrain heightmap.

Properties
allowAutoConnect

Speci es if the terrain tile will be automatically connected to adjacent tiles.

bakeLightProbesForTrees

Speci es if an array of internal light probes should be baked for terrain
trees. Available only in editor.

basemapDistance

Heightmap patches beyond basemap distance will use a precomputed low
res basemap.

bottomNeighbor

Terrain bottom neighbor.

castShadows

Should terrain cast shadows?.

collectDetailPatches

Collect detail patches from memory.

deringLightProbesForTrees

Removes ringing from probes on trees if enabled.

detailObjectDensity

Density of detail objects.

detailObjectDistance

Detail objects will be displayed up to this distance.

drawHeightmap

Specify if terrain heightmap should be drawn.

drawInstanced

Set to true to enable the terrain instance renderer. The default value is
false.

drawTreesAndFoliage

Specify if terrain trees and details should be drawn.

editorRenderFlags

Controls what part of the terrain should be rendered.

freeUnusedRenderingResources

Whether some per-camera rendering resources for the terrain should be
freed after not being used for some frames.

groupingID

Grouping ID for auto connect.

heightmapMaximumLOD

Lets you essentially lower the heightmap resolution used for rendering.

heightmapPixelError

An approximation of how many pixels the terrain will pop in the worst case
when switching lod.

leftNeighbor

Terrain left neighbor.

legacyShininess

The shininess value of the terrain.

legacySpecular

The specular color of the terrain.

lightmapIndex

The index of the baked lightmap applied to this terrain.

lightmapScaleO set

The UV scale & o set used for a baked lightmap.

materialTemplate

The custom material used to render the terrain.

materialType

The type of the material used to render the terrain. Could be one of the
built-in types or custom. See MaterialType.

normalmapTexture

Returns the normal map texture computed from sampling the heightmap.
It is only used when terrain is rendered using instancing.

patchBoundsMultiplier

Set the terrain bounding box scale.

preserveTreePrototypeLayers

Allows you to specify how Unity chooses the layer for tree instances.

realtimeLightmapIndex

The index of the realtime lightmap applied to this terrain.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

re ectionProbeUsage

How re ection probes are used for terrain. See Re ectionProbeUsage.

rightNeighbor

Terrain right neighbor.

terrainData

The Terrain Data that stores heightmaps, terrain textures, detail meshes
and trees.

topNeighbor

Terrain top neighbor.

treeBillboardDistance

Distance from the camera where trees will be rendered as billboards only.

treeCrossFadeLength

Total distance delta that trees will use to transition from billboard
orientation to mesh orientation.

treeDistance

The maximum distance at which trees are rendered.

treeLODBiasMultiplier

The multiplier to the current LOD bias used for rendering LOD trees (i.e.
SpeedTree trees).

treeMaximumFullLODCount

Maximum number of trees rendered at full LOD.

Public Methods
AddTreeInstance

Adds a tree instance to the terrain.

ApplyDelayedHeightmapModi cation

Update the terrain's LOD and vegetation information after making
changes with TerrainData.SetHeightsDelayLOD.

Flush

Flushes any change done in the terrain so it takes e ect.

GetClosestRe ectionProbes

Fills the list with re ection probes whose AABB intersects with
terrain's AABB. Their weights are also provided. Weight shows how
much in uence the probe has on the terrain, and is used when the
blending between multiple re ection probes occurs.

GetPosition

Get the position of the terrain.

GetSplatMaterialPropertyBlock

Get the previously set splat material properties by copying to the dest
MaterialPropertyBlock object.

SampleHeight

Samples the height at the given position de ned in world space,
relative to the terrain space.

SetNeighbors

Lets you setup the connection between neighboring Terrains.

SetSplatMaterialPropertyBlock

Set the additional material properties when rendering the terrain
heightmap using the splat material.

Static Methods
CreateTerrainGameObject

Creates a Terrain including collider from TerrainData.

SetConnectivityDirty

Marks the current connectivity status as invalid.

Inherited Members
Properties
enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators

bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The type of the material used to render a terrain object. Could be one of the built-in types or custom.

Properties
BuiltInStandard

A built-in material that uses the standard physically-based lighting model. Inputs
supported: smoothness, metallic / specular, normal.

BuiltInLegacyDi use

A built-in material that uses the legacy Lambert (di use) lighting model and has
optional normal map support.

BuiltInLegacySpecular

A built-in material that uses the legacy BlinnPhong (specular) lighting model and has
optional normal map support.

Custom

Use a custom material given by Terrain.materialTemplate.

Leave feedback
SWITCH TO MANUAL

Description
A heightmap based collider.
See Also: SphereCollider, CapsuleCollider, PhysicMaterial, Rigidbody.

Properties
terrainData

The terrain that stores the heightmap.

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback

Description
The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps.
The Terrain component links to the terrain data and renders it.

Properties
alphamapHeight

Height of the alpha map.

alphamapLayers

Number of alpha map layers.

alphamapResolution

Resolution of the alpha map.

alphamapTextureCount

Returns the number of alphamap textures.

alphamapTextures

Alpha map textures used by the Terrain. Used by Terrain Inspector for undo.

alphamapWidth

Width of the alpha map.

baseMapResolution

Resolution of the base map used for rendering far patches on the terrain.

bounds

The local bounding box of the TerrainData object.

detailHeight

Detail height of the TerrainData.

detailPatchCount

The number of patches along a terrain tile edge. This is squared to make a grid of
patches.

detailPrototypes

Contains the detail texture/meshes that the terrain has.

detailResolution

Detail Resolution of the TerrainData.

detailResolutionPerPatch

Detail Resolution of each patch. A larger value will decrease the number of
batches used by detail objects.

detailWidth

Detail width of the TerrainData.

heightmapHeight

Height of the terrain in samples (Read Only).

heightmapResolution

Resolution of the heightmap.

heightmapScale

The size of each heightmap sample.

heightmapTexture

Returns the heightmap texture.

heightmapWidth

Width of the terrain in samples (Read Only).

size

The total size in world units of the terrain.

terrainLayers

Retrieves the terrain layers used by the current terrain.

thickness

The thickness of the terrain used for collision detection.

treeInstanceCount

Returns the number of tree instances.

treeInstances

Contains the current trees placed in the terrain.

treePrototypes

The list of tree prototypes this are the ones available in the inspector.

wavingGrassAmount

Amount of waving grass in the terrain.

wavingGrassSpeed

Speed of the waving grass.

wavingGrassStrength

Strength of the waving grass in the terrain.

wavingGrassTint

Color of the waving grass that the terrain has.

Public Methods
GetAlphamaps

Returns the alpha map at a position x, y given a width and height.

GetAlphamapTexture

Returns the alphamap texture at the speci ed index.

GetDetailLayer

Returns a 2D array of the detail object density in the speci c location.

GetHeight

Gets the height at a certain point x,y.

GetHeights

Get an array of heightmap samples.

GetInterpolatedHeight

Gets an interpolated height at a point x,y.

GetInterpolatedNormal

Get an interpolated normal at a given location.

GetMaximumHeightError

Returns an array of tesselation maximum height error values per renderable
terrain patch. The returned array can be modi ed and passed to
OverrideMaximumHeightError.

GetPatchMinMaxHeights

Returns an array of min max height values for all the renderable patches in a
terrain. The returned array can be modi ed and then passed to
OverrideMinMaxPatchHeights.

GetSteepness

Gets the gradient of the terrain at point (x,y).

GetSupportedLayers

Returns an array of all supported detail layer indices in the area.

GetTreeInstance

Get the tree instance at the speci ed index. It is used as a faster version of
treeInstances[index] as this function doesn't create the entire tree instances
array.

OverrideMaximumHeightError

Override the maximum tessellation height error with user provided values.
Note that the overriden values get reset when the terrain resolution is

changed and stays unchanged when the terrain heightmap is painted or
changed via script.
OverrideMinMaxPatchHeights

Override the minimum and maximum patch heights for every renderable
terrain patch. Note that the overriden values get reset when the terrain
resolution is changed and stays unchanged when the terrain heightmap is
painted or changed via script.

RefreshPrototypes

Reloads all the values of the available prototypes (ie, detail mesh assets) in
the TerrainData Object.

SetAlphamaps

Assign all splat values in the given map area.

SetBaseMapDirty

Marks the terrain data as dirty to trigger an update of the terrain basemap
texture.

SetDetailLayer

Sets the detail layer density map.

SetDetailResolution

Set the resolution of the detail map.

SetHeights

Set an array of heightmap samples.

SetHeightsDelayLOD

Set an array of heightmap samples.

SetTreeInstance

Set the tree instance with new parameters at the speci ed index. However,
TreeInstance.prototypeIndex and TreeInstance.position can not be changed
otherwise an ArgumentException will be thrown.

UpdateDirtyRegion

Triggers an update to integrate modi cations done to the heightmap outside
of unity.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Extension methods to the Terrain class, used only for the UpdateGIMaterials method used by the Global
Illumination System.

Static Methods
UpdateGIMaterials

Schedules an update of the albedo and emissive Textures of a system that contains the
Terrain.

Leave feedback
SWITCH TO MANUAL

Description
Text le assets.
You can use raw text les in your project as assets and get their contents through this class. Also, you can access
the le as a raw byte array if you want to access data from binary les. See the Text Asset manual page for further
details about importing text and binary les into your project as Text Assets.

Properties
bytes

The raw bytes of the text asset. (Read Only)

text

The text contents of the .txt le as a string. (Read Only)

Constructors
TextAsset

Create a new TextAsset with the speci ed text contents.This constructor creates a
TextAsset, which is not the same as a plain text le. When saved to disk using the
AssetDatabase class, the TextAsset should be saved with the .asset extension.

Public Methods
ToString

Returns the contents of the TextAsset.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
A struct that stores the settings for TextGeneration.

Properties
alignByGeometry

Use the extents of glyph geometry to perform horizontal alignment rather than
glyph metrics.

color

The base color for the text generation.

font

Font to use for generation.

fontSize

Font size.

fontStyle

Font style.

generateOutOfBounds

Continue to generate characters even if the text runs out of bounds.

generationExtents

Extents that the generator will attempt to t the text in.

horizontalOver ow

What happens to text when it reaches the horizontal generation bounds.

lineSpacing

The line spacing multiplier.

pivot

Generated vertices are o set by the pivot.

resizeTextForBestFit

Should the text be resized to t the con gured bounds?

resizeTextMaxSize

Maximum size for resized text.

resizeTextMinSize

Minimum size for resized text.

richText

Allow rich text markup in generation.

scaleFactor

A scale factor for the text. This is useful if the Text is on a Canvas and the canvas is
scaled.

textAnchor

How is the generated text anchored.

updateBounds

Should the text generator update the bounds from the generated text.

verticalOver ow

What happens to text when it reaches the bottom generation bounds.

Leave feedback

Description
Class that can be used to generate text for rendering.
Caches vertices, character info, and line info for memory friendlyness.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public Font font;
void Start()
{
TextGenerationSettings settings = new TextGenerationSettings();
settings.textAnchor = TextAnchor.MiddleCenter;
settings.color = Color.red;
settings.generationExtents = new Vector2(500.0F, 200.0F);
settings.pivot = Vector2.zero;
settings.richText = true;
settings.font = font;
settings.fontSize = 32;
settings.fontStyle = FontStyle.Normal;
settings.verticalOverflow = VerticalWrapMode.Overflow;
TextGenerator generator = new TextGenerator();
generator.Populate("I am a string", settings);
Debug.Log("I generated: " + generator.vertexCount + " verts!");
}
}

Properties
characterCount

The number of characters that have been generated.

characterCountVisible

The number of characters that have been generated and are included in the visible
lines.

characters

Array of generated characters.

fontSizeUsedForBestFit

The size of the font that was found if using best t mode.

lineCount

Number of text lines generated.

lines

Information about each generated text line.

rectExtents

Extents of the generated text in rect format.

vertexCount

Number of vertices generated.

verts

Array of generated vertices.

Constructors
TextGenerator

Create a TextGenerator.

Public Methods
GetCharacters

Populate the given List with UICharInfo.

GetCharactersArray

Returns the current UICharInfo.

GetLines

Populate the given list with UILineInfo.

GetLinesArray

Returns the current UILineInfo.

GetPreferredHeight

Given a string and settings, returns the preferred height for a container that would hold
this text.

GetPreferredWidth

Given a string and settings, returns the preferred width for a container that would hold
this text.

GetVertices

Populate the given list with generated Vertices.

GetVerticesArray

Returns the current UIVertex array.

Invalidate

Mark the text generator as invalid. This will force a full text generation the next time
Populate is called.

Populate

Will generate the vertices and other data for the given string with the given settings.

PopulateWithErrors

Will generate the vertices and other data for the given string with the given settings.

Leave feedback
SWITCH TO MANUAL

Description
A script interface for the text mesh component.
See Also: text mesh component.

Properties
alignment

How lines of text are aligned (Left, Right, Center).

anchor

Which point of the text shares the position of the Transform.

characterSize

The size of each character (This scales the whole text).

color

The color used to render the text.

font

The Font used.

fontSize

The font size to use (for dynamic fonts).

fontStyle

The font style to use (for dynamic fonts).

lineSpacing

How much space will be in-between lines of text.

o setZ

How far should the text be o set from the transform.position.z when drawing.

richText

Enable HTML-style tags for Text Formatting Markup.

tabSize

How much space will be inserted for a tab '\t' character. This is a multiplum of the
'spacebar' character o set.

text

The text that is displayed.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Base class for texture handling. Contains functionality that is common to both Texture2D and RenderTexture
classes.

Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Inherited Members
Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Class for texture handling.
Use this to create textures on the y or to modify existing texture assets.

Static Properties
blackTexture

Get a small texture with all black pixels.

whiteTexture

Get a small texture with all white pixels.

Properties
alphaIsTransparency

Indicates whether this texture was imported with
TextureImporter.alphaIsTransparency enabled. This setting is available only in
the Editor scripts. Note that changing this setting will have no e ect; it must be
enabled in TextureImporter instead.

desiredMipmapLevel

The mipmap level which would have been loaded by the streaming system
before memory budgets are applied.

format

The format of the pixel data in the texture (Read Only).

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture
was imported; otherwise returns false. For a dynamic Texture created from
script, always returns true. For additional information, see
TextureImporter.isReadable.

loadedMipmapLevel

Which mipmap level is currently loaded by the streaming system.

loadingMipmapLevel

Which mipmap level is in the process of being loaded by the mipmap streaming
system.

mipmapCount

How many mipmap levels are in this texture (Read Only).

requestedMipmapLevel

The mipmap level to load.

streamingMipmaps

Has mipmap streaming been enabled for this texture.

streamingMipmapsPriority

Relative priority for this texture when reducing memory size in order to hit the
memory budget.

Constructors

Texture2D

Create a new empty texture.

Public Methods
Apply

Actually apply all previous SetPixel and SetPixels changes.

ClearRequestedMipmapLevel

Resets the requestedMipmapLevel eld.

Compress

Compress texture into DXT format.

GetPixel

Returns pixel color at coordinates (x, y).

GetPixelBilinear

Returns ltered pixel color at normalized coordinates (u, v).

GetPixels

Get the pixel colors from the texture.

GetPixels32

Get a block of pixel colors in Color32 format.

GetRawTextureData

Get raw data from a texture for reading or writing.

IsRequestedMipmapLevelLoaded

Has the mipmap level requested by setting requestedMipmapLevel
nished loading?

LoadRawTextureData

Fills texture pixels with raw preformatted data.

PackTextures

Packs multiple Textures into a texture atlas.

ReadPixels

Read pixels from screen into the saved texture data.

Resize

Resizes the texture.

SetPixel

Sets pixel color at coordinates (x,y).

SetPixels

Set a block of pixel colors.

SetPixels32

Set a block of pixel colors.

UpdateExternalTexture

Updates Unity texture to use di erent native texture object.

Static Methods
CreateExternalTexture

Creates Unity Texture out of externally created native texture object.

GenerateAtlas

Packs a set of rectangles into a square atlas, with optional padding between
rectangles.

Inherited Members
Static Properties

currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Flags used to control the encoding to an EXR le.
See Also: EncodeToEXR.

Properties
None

No ag. This will result in an uncompressed 16-bit oat EXR le.

OutputAsFloat

The texture will be exported as a 32-bit oat EXR le (default is 16-bit).

CompressZIP

The texture will use the EXR ZIP compression format.

CompressRLE

The texture will use RLE (Run Length Encoding) EXR compression format (similar to Targa
RLE compression).

CompressPIZ

This texture will use Wavelet compression. This is best used for grainy images.

Leave feedback
SWITCH TO MANUAL

Description
Class for handling 2D texture arrays.
Modern graphics APIs (e.g. D3D10 and later, OpenGL ES 3.0 and later, Metal etc.) support "texture arrays", which
is an array of same size & format textures. From the shader side, they are treated as a single resource, and
sampling them needs an extra coordinate that indicates which array element to sample from.
Typically texture arrays are useful as an alternative for texture atlases, or in other cases where objects use a set of
same-sized textures (e.g. terrains).
Currently in Unity texture arrays do not have an import pipeline for them, and must be created from code, either
at runtime or in editor scripts. Using Graphics.CopyTexture is useful for fast copying of pixel data from regular 2D
textures into elements of a texture array. From editor scripts, a common way of creating serialized texture array is
to create it, ll with data (either via Graphics.CopyTexture from regular 2D textures, or via SetPixels or
SetPixels32) and save it as an asset via AssetDatabase.CreateAsset.
Note that not all platforms and GPUs support texture arrays; for example Direct3D9 and OpenGL ES 2.0 do not.
Use SystemInfo.supports2DArrayTextures to check.

Properties
depth

Number of elements in a texture array (Read Only).

format

Texture format (Read Only).

isReadable

Returns true if this texture array is Read/Write Enabled; otherwise returns false. For
dynamic textures created from script, always returns true.

Constructors
Texture2DArray

Create a new texture array.

Public Methods
Apply

Actually apply all previous SetPixels changes.

GetPixels

Returns pixel colors of a single array slice.

GetPixels32

Returns pixel colors of a single array slice.

SetPixels

Set pixel colors for the whole mip level.

SetPixels32

Set pixel colors for the whole mip level.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using

textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Class for handling 3D Textures, Use this to create 3D texture assets.
3D textures are commonly used as lookup tables by shaders, or to represent volumetric data.
Typically you'd create a 3D texture, ll it up with data (SetPixels or SetPixels32) and call Apply to upload the data
to the GPU.

Properties
depth

The depth of the texture (Read Only).

format

The format of the pixel data in the texture (Read Only).

isReadable

Returns true if this 3D texture is Read/Write Enabled; otherwise returns false. For dynamic
textures created from script, always returns true.

Constructors
Texture3D

Create a new empty 3D Texture.

Public Methods
Apply

Actually apply all previous SetPixels changes.

GetPixels

Returns an array of pixel colors representing one mip level of the 3D texture.

GetPixels32

Returns an array of pixel colors representing one mip level of the 3D texture.

SetPixels

Sets pixel colors of a 3D texture.

SetPixels32

Sets pixel colors of a 3D texture.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
The interface to get time information from Unity.

Static Properties
captureFramerate

Slows game playback time to allow screenshots to be saved between frames.

deltaTime

The time in seconds it took to complete the last frame (Read Only).

xedDeltaTime

The interval in seconds at which physics and other xed frame rate updates
(like MonoBehaviour's FixedUpdate) are performed.

xedTime

The time the latest FixedUpdate has started (Read Only). This is the time in
seconds since the start of the game.

xedUnscaledDeltaTime

The timeScale-independent interval in seconds from the last xed frame to the
current one (Read Only).

xedUnscaledTime

The TimeScale-independant time the latest FixedUpdate has started (Read
Only). This is the time in seconds since the start of the game.

frameCount

The total number of frames that have passed (Read Only).

inFixedTimeStep

Returns true if called inside a xed time step callback (like MonoBehaviour's
FixedUpdate), otherwise returns false.

maximumDeltaTime

The maximum time a frame can take. Physics and other xed frame rate
updates (like MonoBehaviour's FixedUpdate) will be performed only for this
duration of time per frame.

maximumParticleDeltaTime

The maximum time a frame can spend on particle updates. If the frame takes
longer than this, then updates are split into multiple smaller updates.

realtimeSinceStartup

The real time in seconds since the game started (Read Only).

smoothDeltaTime

A smoothed out Time.deltaTime (Read Only).

time

The time at the beginning of this frame (Read Only). This is the time in seconds
since the start of the game.

timeScale

The scale at which the time is passing. This can be used for slow motion e ects.

timeSinceLevelLoad

The time this frame has started (Read Only). This is the time in seconds since
the last level has been loaded.

unscaledDeltaTime

The timeScale-independent interval in seconds from the last frame to the
current one (Read Only).

unscaledTime

The timeScale-independant time for this frame (Read Only). This is the time in
seconds since the start of the game.

Leave feedback

Description
Structure describing the status of a nger touching the screen.
Devices can track a number of di erent pieces of data about a touch on a touchscreen, including its phase (ie,
whether it has just started, ended or moved), its position and whether the touch was a single contact or several
taps. Furthermore, the continuity of a touch between frame updates can be detected by the device, so a
consistent ID number can be reported across frames and used to determine how a particular nger is moving.
The Touch struct is used by Unity to store data relating to a single touch instance and is returned by the
Input.GetTouch function. Fresh calls to GetTouch will be required on each frame update to obtain the latest touch
information from the device but the ngerId property can be used to identify the same touch between frames.
See Also: Input.GetTouch, TouchPhase enum.

Properties
altitudeAngle

Value of 0 radians indicates that the stylus is parallel to the surface, pi/2
indicates that it is perpendicular.

azimuthAngle

Value of 0 radians indicates that the stylus is pointed along the x-axis of the
device.

deltaPosition

The position delta since last change.

deltaTime

Amount of time that has passed since the last recorded change in Touch values.

ngerId

The unique index for the touch.

maximumPossiblePressure

The maximum possible pressure value for a platform. If
Input.touchPressureSupported returns false, the value of this property will
always be 1.0f.

phase

Describes the phase of the touch.

position

The position of the touch in pixel coordinates.

pressure

The current amount of pressure being applied to a touch. 1.0f is considered to
be the pressure of an average touch. If Input.touchPressureSupported returns
false, the value of this property will always be 1.0f.

radius

An estimated value of the radius of a touch. Add radiusVariance to get the
maximum touch size, subtract it to get the minimum touch size.

radiusVariance

This value determines the accuracy of the touch radius. Add this value to the
radius to get the maximum touch size, subtract it to get the minimum touch
size.

rawPosition

The raw position used for the touch.

tapCount

Number of taps.

type

A value that indicates whether a touch was of Direct, Indirect (or remote), or
Stylus type.

Leave feedback

Description
Interface into the native iPhone, Android, Windows Phone and Windows Store Apps on-screen keyboards - it is
not available on other platforms.
This interface allows to display di erent types of the keyboard: ASCII, Numbers, URL, Email, and others.
Because the appearance of the keyboard has the potential to obscure portions of your user interface, it is up to
you to make sure that parts of your user interface are not obscured when the keyboard is being displayed.
TouchScreenKeyboard.visible and TouchScreenKeyboard.area should be used to determine if the
keyboard is being shown (activated) and what portion of the screen is using.
Windows Store Apps: On Universal Windows 10 Apps the touch screen keyboard is only supported in XAML
based applications with touch input support.

Static Properties
area

Returns portion of the screen which is covered by the keyboard.

hideInput

Will text input eld above the keyboard be hidden when the keyboard is on screen?

isSupported

Is touch screen keyboard supported.

visible

Returns true whenever any keyboard is completely visible on the screen.

Properties
active

Is the keyboard visible or sliding into the position on the screen?

canGetSelection

Speci es whether the TouchScreenKeyboard supports the selection property. (Read Only)

canSetSelection

Speci es whether the TouchScreenKeyboard supports the selection property. (Read Only)

characterLimit

How many characters the keyboard input eld is limited to. 0 = in nite.

selection

Gets or sets the character range of the selected text within the string currently being
edited.

status

Returns the status of the on-screen keyboard. (Read Only)

targetDisplay

Speci ed on which display the software keyboard will appear.

text

Returns the text displayed by the input eld of the keyboard.

type

Returns the TouchScreenKeyboardType of the keyboard.

Static Methods
Open

Opens the native keyboard provided by OS on the screen.

Leave feedback

Description
The status of the on-screen keyboard.

Properties
Visible

The on-screen keyboard is visible.

Done

The user has nished providing input.

Canceled

The on-screen keyboard was canceled.

LostFocus

The on-screen keyboard has lost focus.

Leave feedback
SWITCH TO MANUAL

Description
The trail renderer is used to make trails behind objects in the Scene as they move about.
This class is a script interface for a trail renderer component.

Properties
alignment

Select whether the trail will face the camera, or the orientation of the Transform
Component.

autodestruct

Does the GameObject of this Trail Renderer auto destruct?

colorGradient

Set the color gradient describing the color of the trail at various points along its
length.

emitting

Creates trails when the GameObject moves.

endColor

Set the color at the end of the trail.

endWidth

The width of the trail at the end of the trail.

generateLightingData

Con gures a trail to generate Normals and Tangents. With this data, Scene lighting
can a ect the trail via Normal Maps and the Unity Standard Shader, or your own
custom-built Shaders.

minVertexDistance

Set the minimum distance the trail can travel before a new vertex is added to it.

numCapVertices

Set this to a value greater than 0, to get rounded corners on each end of the trail.

numCornerVertices

Set this to a value greater than 0, to get rounded corners between each segment of
the trail.

positionCount

Get the number of line segments in the trail.

shadowBias

Apply a shadow bias to prevent self-shadowing artifacts. The speci ed value is the
proportion of the trail width at each segment.

startColor

Set the color at the start of the trail.

startWidth

The width of the trail at the spawning point.

textureMode

Choose whether the U coordinate of the trail texture is tiled or stretched.

time

How long does the trail take to fade out.

widthCurve

Set the curve describing the width of the trail at various points along its length.

widthMultiplier

Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the
nal width of the trail.

Public Methods
AddPosition

Adds a position to the trail.

AddPositions

Add an array of positions to the trail.

BakeMesh

Creates a snapshot of TrailRenderer and stores it in mesh.

Clear

Removes all points from the TrailRenderer. Useful for restarting a trail from a new
position.

GetPosition

Get the position of a vertex in the trail.

GetPositions

Get the positions of all vertices in the trail.

SetPosition

Set the position of a vertex in the trail.

SetPositions

Sets the positions of all vertices in the trail.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

allowOcclusionWhenDynamic

Controls if dynamic occlusion culling should be performed for this
renderer.

bounds

The bounding volume of the renderer (Read Only).

enabled

Makes the rendered 3D object visible if enabled.

isPartOfStaticBatch

Has this renderer been statically batched with any other renderers?

isVisible

Is this renderer visible in any camera? (Read Only)

lightmapIndex

The index of the baked lightmap applied to this renderer.

lightmapScaleO set

The UV scale & o set used for a lightmap.

lightProbeProxyVolumeOverride

If set, the Renderer will use the Light Probe Proxy Volume component
attached to the source GameObject.

lightProbeUsage

The light probe interpolation type.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read
Only).

material

Returns the rst instantiated Material assigned to the renderer.

materials

Returns all the instantiated materials of this object.

motionVectorGenerationMode

Speci es the mode for motion vector rendering.

probeAnchor

If set, Renderer will use this Transform's position to nd the light or
re ection probe.

realtimeLightmapIndex

The index of the realtime lightmap applied to this renderer.

realtimeLightmapScaleO set

The UV scale & o set used for a realtime lightmap.

receiveShadows

Does this object receive shadows?

re ectionProbeUsage

Should re ection probes be used for this Renderer?

rendererPriority

This value sorts renderers by priority. Lower values are rendered rst and
higher values are rendered last.

renderingLayerMask

Determines which rendering layer this renderer lives on.

shadowCastingMode

Does this object cast shadows?

sharedMaterial

The shared material of this object.

sharedMaterials

All the shared materials of this object.

sortingLayerID

Unique ID of the Renderer's sorting layer.

sortingLayerName

Name of the Renderer's sorting layer.

sortingOrder

Renderer's order within a sorting layer.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read
Only).

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetClosestRe ectionProbes

Returns an array of closest re ection probes with weights, weight shows how
much in uence the probe has on the renderer, this value is also used when
blending between re ection probes occur.

GetMaterials

Returns all the instantiated materials of this object.

GetPropertyBlock

Get per-Renderer or per-Material property block.

GetSharedMaterials

Returns all the shared materials of this object.

HasPropertyBlock

Returns true if the Renderer has a material property block attached via
SetPropertyBlock.

SetPropertyBlock

Lets you set or clear per-renderer or per-material parameter overrides.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnBecameInvisible

OnBecameInvisible is called when the object is no longer visible by any camera.

OnBecameVisible

OnBecameVisible is called when the object became visible by any camera.

Leave feedback
SWITCH TO MANUAL

Description
Position, rotation and scale of an object.
Every object in a Scene has a Transform. It's used to store and manipulate the position, rotation and scale of the
object. Every Transform can have a parent, which allows you to apply position, rotation and scale hierarchically.
This is the hierarchy seen in the Hierarchy pane. They also support enumerators so you can loop through children
using:

using UnityEngine;

public class Example : MonoBehaviour
{
// Moves all transform children 10 units upwards!
void Start()
{
foreach (Transform child in transform)
{
child.position += Vector3.up * 10.0f;
}
}
}

See Also: The component reference, Physics class.

Properties
childCount

The number of children the parent Transform has.

eulerAngles

The rotation as Euler angles in degrees.

forward

The blue axis of the transform in world space.

hasChanged

Has the transform changed since the last time the ag was set to 'false'?

hierarchyCapacity

The transform capacity of the transform's hierarchy data structure.

hierarchyCount

The number of transforms in the transform's hierarchy data structure.

localEulerAngles

The rotation as Euler angles in degrees relative to the parent transform's rotation.

localPosition

Position of the transform relative to the parent transform.

localRotation

The rotation of the transform relative to the transform rotation of the parent.

localScale

The scale of the transform relative to the parent.

localToWorldMatrix

Matrix that transforms a point from local space into world space (Read Only).

lossyScale

The global scale of the object (Read Only).

parent

The parent of the transform.

position

The position of the transform in world space.

right

The red axis of the transform in world space.

root

Returns the topmost transform in the hierarchy.

rotation

The rotation of the transform in world space stored as a Quaternion.

up

The green axis of the transform in world space.

worldToLocalMatrix

Matrix that transforms a point from world space into local space (Read Only).

Public Methods
DetachChildren

Unparents all children.

Find

Finds a child by n and returns it.

GetChild

Returns a transform child by index.

GetSiblingIndex

Gets the sibling index.

InverseTransformDirection

Transforms a direction from world space to local space. The opposite of
Transform.TransformDirection.

InverseTransformPoint

Transforms position from world space to local space.

InverseTransformVector

Transforms a vector from world space to local space. The opposite of
Transform.TransformVector.

IsChildOf

Is this transform a child of parent?

LookAt

Rotates the transform so the forward vector points at /target/'s current position.

Rotate

Applies a rotation of eulerAngles.z degrees around the z axis, eulerAngles.x
degrees around the x axis, and eulerAngles.y degrees around the y axis (in that
order).

RotateAround

Rotates the transform about axis passing through point in world coordinates by
angle degrees.

SetAsFirstSibling

Move the transform to the start of the local transform list.

SetAsLastSibling

Move the transform to the end of the local transform list.

SetParent

Set the parent of the transform.

SetPositionAndRotation

Sets the world space position and rotation of the Transform component.

SetSiblingIndex

Sets the sibling index.

TransformDirection

Transforms direction from local space to world space.

TransformPoint

Transforms position from local space to world space.

TransformVector

Transforms vector from local space to world space.

Translate

Moves the transform in the direction and distance of translation.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
SWITCH TO MANUAL

Description
Tree Component for the tree creator.

Properties
data

Data asociated to the Tree.

hasSpeedTreeWind

Tells if there is wind data exported from SpeedTree are saved on this component.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
Contains information about a tree placed in the Terrain game object.
This struct can be accessed from the TerrainData Object.

Properties
color

Color of this instance.

heightScale

Height scale of this instance (compared to the prototype's size).

lightmapColor

Lightmap color calculated for this instance.

position

Position of the tree.

prototypeIndex

Index of this instance in the TerrainData.treePrototypes array.

rotation

Read-only.Rotation of the tree on X-Z plane (in radians).

widthScale

Width scale of this instance (compared to the prototype's size).

Leave feedback

Description
Simple class that contains a pointer to a tree prototype.
This class is used by the TerrainData gameObject.

Properties
bendFactor

Bend factor of the tree prototype.

prefab

Retrieves the actual GameObject used by the tree.

Leave feedback

Description
Class that speci es some information about a renderable character.

Properties
charWidth

Character width.

cursorPos

Position of the character cursor in local (text generated) space.

Leave feedback

Description
Information about a generated line of text.

Properties
height

Height of the line.

leading

Space in pixels between this line and the next line.

startCharIdx

Index of the rst character in the line.

topY

The upper Y position of the line in pixels. This is used for text annotation such as the caret
and selection box in the InputField.

Leave feedback

Description
Vertex class used by a Canvas for managing vertices.

Static Properties
simpleVert

Simple UIVertex with sensible settings for use in the UI system.

Properties
color

Vertex color.

normal

Normal.

position

Vertex position.

tangent

Tangent.

uv0

The rst texture coordinate set of the mesh. Used by UI elements by default.

uv1

The second texture coordinate set of the mesh, if present.

uv2

The Third texture coordinate set of the mesh, if present.

uv3

The forth texture coordinate set of the mesh, if present.

Leave feedback

Description
Representation of 2D vectors and points.
This structure is used in some places to represent 2D positions and vectors (e.g. texture coordinates in a Mesh or
texture o sets in Material). In the majority of other cases a Vector3 is used.

Static Properties
down

Shorthand for writing Vector2(0, -1).

left

Shorthand for writing Vector2(-1, 0).

negativeIn nity

Shorthand for writing Vector2( oat.NegativeIn nity, oat.NegativeIn nity).

one

Shorthand for writing Vector2(1, 1).

positiveIn nity

Shorthand for writing Vector2( oat.PositiveIn nity, oat.PositiveIn nity).

right

Shorthand for writing Vector2(1, 0).

up

Shorthand for writing Vector2(0, 1).

zero

Shorthand for writing Vector2(0, 0).

Properties
magnitude

Returns the length of this vector (Read Only).

normalized

Returns this vector with a magnitude of 1 (Read Only).

sqrMagnitude

Returns the squared length of this vector (Read Only).

this[int]

Access the x or y component using [0] or [1] respectively.

x

X component of the vector.

y

Y component of the vector.

Constructors
Vector2

Constructs a new vector with given x, y components.

Public Methods

Equals

Returns true if the given vector is exactly equal to this vector.

Normalize

Makes this vector have a magnitude of 1.

Set

Set x and y components of an existing Vector2.

ToString

Returns a nicely formatted string for this vector.

Static Methods
Angle

Returns the unsigned angle in degrees between from and to.

ClampMagnitude

Returns a copy of vector with its magnitude clamped to maxLength.

Distance

Returns the distance between a and b.

Dot

Dot Product of two vectors.

Lerp

Linearly interpolates between vectors a and b by t.

LerpUnclamped

Linearly interpolates between vectors a and b by t.

Max

Returns a vector that is made from the largest components of two vectors.

Min

Returns a vector that is made from the smallest components of two vectors.

MoveTowards

Moves a point current towards target.

Perpendicular

Returns the 2D vector perpendicular to this 2D vector. The result is always rotated 90degrees in a counter-clockwise direction for a 2D coordinate system where the positive Y
axis goes up.

Re ect

Re ects a vector o the vector de ned by a normal.

Scale

Multiplies two vectors component-wise.

SignedAngle

Returns the signed angle in degrees between from and to.

SmoothDamp

Gradually changes a vector towards a desired goal over time.

Operators
operator -

Subtracts one vector from another.

operator *

Multiplies a vector by a number.

operator /

Divides a vector by a number.

operator +

Adds two vectors.

operator ==

Returns true if two vectors are approximately equal.

Vector2

Converts a Vector3 to a Vector2.

Vector3

Converts a Vector2 to a Vector3.

Leave feedback

Description
Representation of 2D vectors and points using integers.
This structure is used in some places to represent 2D positions and vectors that don't require the precision of
oating-point.

Static Properties
down

Shorthand for writing Vector2Int (0, -1).

left

Shorthand for writing Vector2Int (-1, 0).

one

Shorthand for writing Vector2Int (1, 1).

right

Shorthand for writing Vector2Int (1, 0).

up

Shorthand for writing Vector2Int (0, 1).

zero

Shorthand for writing Vector2Int (0, 0).

Properties
magnitude

Returns the length of this vector (Read Only).

sqrMagnitude

Returns the squared length of this vector (Read Only).

this[int]

Access the x or y component using [0] or [1] respectively.

x

X component of the vector.

y

Y component of the vector.

Public Methods
Clamp

Clamps the Vector2Int to the bounds given by min and max.

Equals

Returns true if the objects are equal.

GetHashCode

Gets the hash code for the Vector2Int.

Set

Set x and y components of an existing Vector2Int.

ToString

Returns a nicely formatted string for this vector.

Static Methods
CeilToInt

Converts a Vector2 to a Vector2Int by doing a Ceiling to each value.

Distance

Returns the distance between a and b.

FloorToInt

Converts a Vector2 to a Vector2Int by doing a Floor to each value.

Max

Returns a vector that is made from the largest components of two vectors.

Min

Returns a vector that is made from the smallest components of two vectors.

RoundToInt

Converts a Vector2 to a Vector2Int by doing a Round to each value.

Scale

Multiplies two vectors component-wise.

Operators
operator -

Subtracts one vector from another.

operator !=

Returns true if vectors di erent.

operator *

Multiplies a vector by a number.

operator +

Adds two vectors.

operator ==

Returns true if the vectors are equal.

Unknown

Converts a Vector2Int to a Vector3Int.

operator
Vector2

Converts a Vector2Int to a Vector2.

Leave feedback

Description
Representation of 3D vectors and points.
This structure is used throughout Unity to pass 3D positions and directions around. It also contains functions for
doing common vector operations.
Besides the functions listed below, other classes can be used to manipulate vectors and points as well. For
example the Quaternion and the Matrix4x4 classes are useful for rotating or transforming vectors and points.

Static Properties
back

Shorthand for writing Vector3(0, 0, -1).

down

Shorthand for writing Vector3(0, -1, 0).

forward

Shorthand for writing Vector3(0, 0, 1).

left

Shorthand for writing Vector3(-1, 0, 0).

negativeIn nity

Shorthand for writing Vector3( oat.NegativeIn nity, oat.NegativeIn nity,
oat.NegativeIn nity).

one

Shorthand for writing Vector3(1, 1, 1).

positiveIn nity

Shorthand for writing Vector3( oat.PositiveIn nity, oat.PositiveIn nity,
oat.PositiveIn nity).

right

Shorthand for writing Vector3(1, 0, 0).

up

Shorthand for writing Vector3(0, 1, 0).

zero

Shorthand for writing Vector3(0, 0, 0).

Properties
magnitude

Returns the length of this vector (Read Only).

normalized

Returns this vector with a magnitude of 1 (Read Only).

sqrMagnitude

Returns the squared length of this vector (Read Only).

this[int]

Access the x, y, z components using [0], [1], [2] respectively.

x

X component of the vector.

y

Y component of the vector.

z

Z component of the vector.

Constructors
Vector3

Creates a new vector with given x, y, z components.

Public Methods
Equals

Returns true if the given vector is exactly equal to this vector.

Set

Set x, y and z components of an existing Vector3.

ToString

Returns a nicely formatted string for this vector.

Static Methods
Angle

Returns the angle in degrees between from and to.

ClampMagnitude

Returns a copy of vector with its magnitude clamped to maxLength.

Cross

Cross Product of two vectors.

Distance

Returns the distance between a and b.

Dot

Dot Product of two vectors.

Lerp

Linearly interpolates between two vectors.

LerpUnclamped

Linearly interpolates between two vectors.

Max

Returns a vector that is made from the largest components of two vectors.

Min

Returns a vector that is made from the smallest components of two vectors.

MoveTowards

Moves a point current in a straight line towards a target point.

Normalize

Makes this vector have a magnitude of 1.

OrthoNormalize

Makes vectors normalized and orthogonal to each other.

Project

Projects a vector onto another vector.

ProjectOnPlane

Projects a vector onto a plane de ned by a normal orthogonal to the plane.

Re ect

Re ects a vector o the plane de ned by a normal.

RotateTowards

Rotates a vector current towards target.

Scale

Multiplies two vectors component-wise.

SignedAngle

Returns the signed angle in degrees between from and to.

Slerp

Spherically interpolates between two vectors.

SlerpUnclamped

Spherically interpolates between two vectors.

SmoothDamp

Gradually changes a vector towards a desired goal over time.

Operators
operator -

Subtracts one vector from another.

operator !=

Returns true if vectors di erent.

operator *

Multiplies a vector by a number.

operator /

Divides a vector by a number.

operator +

Adds two vectors.

operator ==

Returns true if two vectors are approximately equal.

Leave feedback

Description
Representation of 3D vectors and points using integers.
This structure is used in some places to represent 3D positions and vectors that don't require the precision of
oating-point.

Static Properties
down

Shorthand for writing Vector3Int (0, -1, 0).

left

Shorthand for writing Vector3Int (-1, 0, 0).

one

Shorthand for writing Vector3Int (1, 1, 1).

right

Shorthand for writing Vector3Int (1, 0, 0).

up

Shorthand for writing Vector3Int (0, 1, 0).

zero

Shorthand for writing Vector3Int (0, 0, 0).

Properties
magnitude

Returns the length of this vector (Read Only).

sqrMagnitude

Returns the squared length of this vector (Read Only).

this[int]

Access the x, y or z component using [0], [1] or [2] respectively.

x

X component of the vector.

y

Y component of the vector.

z

Z component of the vector.

Public Methods
Clamp

Clamps the Vector3Int to the bounds given by min and max.

Equals

Returns true if the objects are equal.

GetHashCode

Gets the hash code for the Vector3Int.

Set

Set x, y and z components of an existing Vector3Int.

ToString

Returns a nicely formatted string for this vector.

Static Methods
CeilToInt

Converts a Vector3 to a Vector3Int by doing a Ceiling to each value.

Distance

Returns the distance between a and b.

FloorToInt

Converts a Vector3 to a Vector3Int by doing a Floor to each value.

Max

Returns a vector that is made from the largest components of two vectors.

Min

Returns a vector that is made from the smallest components of two vectors.

RoundToInt

Converts a Vector3 to a Vector3Int by doing a Round to each value.

Scale

Multiplies two vectors component-wise.

Operators
operator -

Subtracts one vector from another.

operator !=

Returns true if vectors di erent.

operator *

Multiplies a vector by a number.

operator +

Adds two vectors.

operator ==

Returns true if the vectors are equal.

Unknown

Converts a Vector3Int to a Vector2Int.

operator
Vector3

Converts a Vector3Int to a Vector3.

Leave feedback

Description
Representation of four-dimensional vectors.
This structure is used in some places to represent four component vectors (e.g. mesh tangents, parameters for
shaders). In the majority of other cases a Vector3 is used.

Static Properties
negativeIn nity

Shorthand for writing Vector4( oat.NegativeIn nity, oat.NegativeIn nity,
oat.NegativeIn nity, oat.NegativeIn nity).

one

Shorthand for writing Vector4(1,1,1,1).

positiveIn nity

Shorthand for writing Vector4( oat.PositiveIn nity, oat.PositiveIn nity,
oat.PositiveIn nity, oat.PositiveIn nity).

zero

Shorthand for writing Vector4(0,0,0,0).

Properties
magnitude

Returns the length of this vector (Read Only).

normalized

Returns this vector with a magnitude of 1 (Read Only).

sqrMagnitude

Returns the squared length of this vector (Read Only).

this[int]

Access the x, y, z, w components using [0], [1], [2], [3] respectively.

w

W component of the vector.

x

X component of the vector.

y

Y component of the vector.

z

Z component of the vector.

Constructors
Vector4

Creates a new vector with given x, y, z, w components.

Public Methods
Equals

Returns true if the given vector is exactly equal to this vector.

Set

Set x, y, z and w components of an existing Vector4.

ToString

Return the Vector4 formatted as a string.

Static Methods
Distance

Returns the distance between a and b.

Dot

Dot Product of two vectors.

Lerp

Linearly interpolates between two vectors.

LerpUnclamped

Linearly interpolates between two vectors.

Max

Returns a vector that is made from the largest components of two vectors.

Min

Returns a vector that is made from the smallest components of two vectors.

MoveTowards

Moves a point current towards target.

Normalize
Project

Projects a vector onto another vector.

Scale

Multiplies two vectors component-wise.

Operators
operator -

Subtracts one vector from another.

operator *

Multiplies a vector by a number.

operator /

Divides a vector by a number.

operator +

Adds two vectors.

operator ==

Returns true if two vectors are approximately equal.

Vector2

Converts a Vector4 to a Vector2.

Vector3

Converts a Vector4 to a Vector3.

Vector4

Converts a Vector3 to a Vector4.

Vector4

Converts a Vector2 to a Vector4.

Leave feedback

Description
Waits until the end of the frame after all cameras and GUI is rendered, just before displaying the frame on screen.
You can use it to read the display into a texture, encode it as an image le (see Texture2D.ReadPixels and
Texture2D.Texture2D) and store it on a device.
Switching from the Game view to the Scene view will cause WaitForEndOfFrame to freeze. It will only continue
when the application is switched back to the Game view. This can only happen when the application is working in
the Unity editor.
Note: This coroutine is not invoked on the editor in batched mode. For further details please look at the
Command line arguments page in the manual.

using
using
using
using

System.IO;
UnityEngine;
UnityEngine.Networking;
System.Collections;

public class ExampleClass : MonoBehaviour
{
// Take a shot immediately
IEnumerator Start()
{
UploadPNG();
yield return null;
}

IEnumerator UploadPNG()
{
// We should only read the screen buffer after rendering is complete
yield return new WaitForEndOfFrame();

// Create a texture the size of the screen, RGB24 format
int width = Screen.width;
int height = Screen.height;
Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false)

// Read screen contents into the texture

tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
tex.Apply();

// Encode texture into PNG
byte[] bytes = tex.EncodeToPNG();
Destroy(tex);

// For testing purposes, also write to a file in the project folder
// File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", byte

// Create a Web Form
WWWForm form = new WWWForm();
form.AddField("frameCount", Time.frameCount.ToString());
form.AddBinaryData("fileUpload", bytes);

// Upload to a cgi script
var w = UnityWebRequest.Post("http://localhost/cgi-bin/env.cgi?post", fo
yield return w.SendWebRequest();
if (w.isNetworkError || w.isHttpError)
print(w.error);
else
print("Finished Uploading Screenshot");
yield return null;
}
}

using UnityEngine;
using System.Collections;

public class ExampleScript : MonoBehaviour
{
// A script that shows destination alpha channel in the game view.

Material mat;

void CreateMaterial()

{
// Unity has a built-in shader that is useful for drawing
// simple colored things. In this case, we just want to use
// a blend mode that inverts destination colors.
var shader = Shader.Find("Hidden/Internal-Colored");
mat = new Material(shader);
mat.hideFlags = HideFlags.HideAndDontSave;
// Set blend mode to show destination alpha channel.
mat.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.DstAlpha);
mat.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
// Turn off backface culling, depth writes, depth test.
mat.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off);
mat.SetInt("_ZWrite", 0);
mat.SetInt("_ZTest", (int)UnityEngine.Rendering.CompareFunction.Always);
}

public IEnumerator Start()
{
CreateMaterial();
while (true)
{
// Wait until all rendering + UI is done.
yield return new WaitForEndOfFrame();
// Draw a quad that shows alpha channel.
GL.PushMatrix();
GL.LoadOrtho();
mat.SetPass(0);
GL.Begin(GL.QUADS);
GL.Vertex3(0, 0, 0);
GL.Vertex3(1, 0, 0);
GL.Vertex3(1, 1, 0);
GL.Vertex3(0, 1, 0);
GL.End();
GL.PopMatrix();
}
yield return null;
}
}

See Also: AsyncOperation, WaitForSeconds, WaitForFixedUpdate, WaitForSecondsRealtime, WaitUntil,WaitWhile.

Inherited Members

Leave feedback

Description
Waits until next xed frame rate update function. See Also: FixedUpdate.
WaitForFixedUpdate can only be used with a yield statement in coroutines.
See Also: AsyncOperation, WaitForEndOfFrame, WaitForSeconds, WaitForSecondsRealtime, WaitUntil, WaitWhile.

Inherited Members

Leave feedback

Description
Suspends the coroutine execution for the given amount of seconds using scaled time.
The actual time suspended is equal to the given time multiplied by Time.timeScale.
See WaitForSecondsRealtime if you wish to wait using unscaled time.
WaitForSeconds can only be used with a yield statement in coroutines.
Note: There are some factors which can mean the actual amount of time waited does not precisely match the
amount of time speci ed.
- WaitForSeconds starts waiting at the end of the current frame. So, if you start a WaitForSeconds with duration 't'
in a very long frame (for example, one which has a long operation which blocks the main thread such as some
synchronous loading), the coroutine will return 't' seconds after the end of the frame, not 't' seconds after it was
called.
- WaitForSeconds will allow the coroutine to resume on the rst frame after 't' seconds has passed, not exactly
after 't' seconds has passed.

using UnityEngine;
using System.Collections;

public class WaitForSecondsExample : MonoBehaviour
{
void Start()
{
StartCoroutine(Example());
}

IEnumerator Example()
{
print(Time.time);
yield return new WaitForSeconds(5);
print(Time.time);
}
}

See Also: MonoBehaviour.StartCoroutine, AsyncOperation, WaitForEndOfFrame, WaitForFixedUpdate,
WaitForSecondsRealtime, WaitUntil, WaitWhile.

Constructors
WaitForSeconds

Creates a yield instruction to wait for a given number of seconds using scaled time.

Inherited Members

Leave feedback

Description
Suspends the coroutine execution for the given amount of seconds using unscaled time.
See WaitForSeconds if you wish to wait using scaled time.
WaitForSecondsRealtime can only be used with a yield statement in coroutines.

using UnityEngine;
using System.Collections;

public class WaitForSecondsExample : MonoBehaviour
{
void Start()
{
StartCoroutine(Example());
}

IEnumerator Example()
{
print(Time.time);
yield return new WaitForSecondsRealtime(5);
print(Time.time);
}
}

See Also MonoBehaviour.StartCoroutine.

Properties
waitTime

The given amount of seconds that the yield instruction will wait for.

Constructors
WaitForSecondsRealtime

Creates a yield instruction to wait for a given number of seconds using unscaled
time.

Inherited Members

Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
Suspends the coroutine execution until the supplied delegate evaluates to true.
WaitUntil can only be used with a yield statement in coroutines.
Supplied delegate will be executed each frame after script MonoBehaviour.Update and before
MonoBehaviour.LateUpdate. When the delegate nally evaluates to true, the coroutine will proceed with its
execution.
See Also: AsyncOperation, WaitForEndOfFrame, WaitForFixedUpdate, WaitForSeconds, WaitForSecondsRealtime,
WaitWhile.

using UnityEngine;
using System.Collections;

public class WaitUntilExample : MonoBehaviour
{
public int frame;

void Start()
{
StartCoroutine(Example());
}

IEnumerator Example()
{
Debug.Log("Waiting for princess to be rescued...");
yield return new WaitUntil(() => frame >= 10);
Debug.Log("Princess was rescued!");
}

void Update()
{
if (frame <= 10)
{
Debug.Log("Frame: " + frame);
frame++;
}

}
}

Constructors
WaitUntil

Initializes a yield instruction with a given delegate to be evaluated.

Inherited Members
Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
Suspends the coroutine execution until the supplied delegate evaluates to false.
WaitWhile can only be used with a yield statement in coroutines.
The supplied delegate will be executed each frame after MonoBehaviour.Update and before
MonoBehaviour.LateUpdate. When the delegate nally evaluates to false, the coroutine will proceed with its
execution.

using UnityEngine;
using System.Collections;

public class WaitWhileExample : MonoBehaviour
{
public int frame;

void Start()
{
StartCoroutine(Example());
}

IEnumerator Example()
{
Debug.Log("Waiting for prince/princess to rescue me...");
yield return new WaitWhile(() => frame < 10);
Debug.Log("Finally I have been rescued!");
}

void Update()
{
if (frame <= 10)
{
Debug.Log("Frame: " + frame);
frame++;
}
}
}

See Also: AsyncOperation, WaitForEndOfFrame, WaitForFixedUpdate, WaitForSeconds, WaitForSecondsRealtime,
WaitUntil.

Constructors
WaitWhile

Initializes a yield instruction with a given delegate to be evaluated.

Inherited Members
Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
A structure describing the webcam device.

Properties
availableResolutions

Possible WebCamTexture resolutions for this device.

depthCameraName

A string identi er used to create a depth data based WebCamTexture.

isAutoFocusPointSupported

Returns true if the camera supports automatic focusing on points of interest
and false otherwise.

isFrontFacing

True if camera faces the same direction a screen does, false otherwise.

kind

Property of type WebCamKind denoting the kind of webcam device.

name

A human-readable name of the device. Varies across di erent systems.

Leave feedback

Description
WebCam Textures are textures onto which the live video input is rendered.

Static Properties
devices

Return a list of available devices.

Properties
autoFocusPoint

This property allows you to set/get the auto focus point of the camera. This works
only on Android and iOS devices.

deviceName

Set this to specify the name of the device to use.

didUpdateThisFrame

Did the video bu er update this frame?

isDepth

This property is true if the texture is based on depth data.

isPlaying

Returns if the camera is currently playing.

requestedFPS

Set the requested frame rate of the camera device (in frames per second).

requestedHeight

Set the requested height of the camera device.

requestedWidth

Set the requested width of the camera device.

videoRotationAngle

Returns an clockwise angle (in degrees), which can be used to rotate a polygon so
camera contents are shown in correct orientation.

videoVerticallyMirrored

Returns if the texture image is vertically ipped.

Constructors
WebCamTexture

Create a WebCamTexture.

Public Methods
GetPixel

Returns pixel color at coordinates (x, y).

GetPixels

Get a block of pixel colors.

GetPixels32

Returns the pixels data in raw format.

Pause

Pauses the camera.

Play

Starts the camera.

Stop

Stops the camera.

Inherited Members
Static Properties
currentTextureMemory

The amount of memory currently being used by textures.

desiredTextureMemory

This amount of texture memory would be used before the texture
streaming budget is applied.

nonStreamingTextureCount

Number of non-streaming textures.

nonStreamingTextureMemory

Total amount of memory being used by non-streaming textures.

streamingMipmapUploadCount

How many times has a texture been uploaded due to texture
mipmap streaming.

streamingRendererCount

Number of renderers registered with the texture streaming system.

streamingTextureCount

Number of streaming textures.

streamingTextureDiscardUnusedMips

Force the streaming texture system to discard all unused mipmaps
immediately, rather than caching them until the texture memory
budget is exceeded.

streamingTextureForceLoadAll

Force streaming textures to load all mipmap levels.

streamingTextureLoadingCount

Number of streaming textures with mipmaps currently loading.

streamingTexturePendingLoadCount

Number of streaming textures with outstanding mipmaps to be
loaded.

targetTextureMemory

The amount of memory used by textures after the mipmap streaming
and budget are applied and loading is complete.

totalTextureMemory

The total amount of memory that would be used by all textures at
mipmap level 0.

Properties
hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

anisoLevel

Anisotropic ltering level of the texture.

dimension

Dimensionality (type) of the texture (Read Only).

lterMode

Filtering mode of the texture.

height

Height of the texture in pixels. (Read Only)

imageContentsHash

The hash value of the Texture.

isReadable

Returns true if the Read/Write Enabled checkbox was checked when the texture was
imported; otherwise returns false. For a dynamic Texture created from script, always
returns true. For additional information, see TextureImporter.isReadable.

mipMapBias

Mip map bias of the texture.

updateCount

This counter is incremented when the texture is updated.

width

Width of the texture in pixels. (Read Only)

wrapMode

Texture coordinate wrapping mode.

wrapModeU

Texture U coordinate wrapping mode.

wrapModeV

Texture V coordinate wrapping mode.

wrapModeW

Texture W coordinate wrapping mode for Texture3D.

Public Methods
GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

GetNativeTexturePtr

Retrieve a native (underlying graphics API) pointer to the texture resource.

IncrementUpdateCount

Increment the update counter.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly
recommended to use Destroy instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when
loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

SetGlobalAnisotropicFilteringLimits

Sets Anisotropic limits.

SetStreamingTextureMaterialDebugProperties

Uploads additional debug information to materials using
textures set to stream mip maps.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback

Description
WebGLInput provides support for WebGL-speci c functionalities.

Static Properties
captureAllKeyboardInput

Capture all keyboard inputs.

Leave feedback
SWITCH TO MANUAL

Description
A special collider for vehicle wheels.
Wheel collider is used to model vehicle wheels. It simulates a spring and damper suspension setup, and uses a
slip based tire friction model to calculate wheel contact forces.
Wheel's collision detection is performed by casting a ray from center downwards the local y-axis. The wheel has a
radius and can extend downwards by suspensionDistance amount.
The wheel is controlled with motorTorque, brakeTorque and steerAngle properties.
Wheel collider computes friction separately from the rest of physics engine, using a slip based friction model. This
allows for more realistic behaviour, but makes wheel colliders ignore standard PhysicMaterial settings. Simulation
of di erent road materials is done by changing the forwardFriction and sidewaysFriction based on what material
the wheel is hitting. See Also: GetGroundHit and WheelFrictionCurve.

Properties
brakeTorque

Brake torque expressed in Newton metres.

center

The center of the wheel, measured in the object's local space.

forceAppPointDistance

Application point of the suspension and tire forces measured from the base of the
resting wheel.

forwardFriction

Properties of tire friction in the direction the wheel is pointing in.

isGrounded

Indicates whether the wheel currently collides with something (Read Only).

mass

The mass of the wheel, expressed in kilograms. Must be larger than zero. Typical
values would be in range (20,80).

motorTorque

Motor torque on the wheel axle expressed in Newton metres. Positive or negative
depending on direction.

radius

The radius of the wheel, measured in local space.

rpm

Current wheel axle rotation speed, in rotations per minute (Read Only).

sidewaysFriction

Properties of tire friction in the sideways direction.

sprungMass

The mass supported by this WheelCollider.

steerAngle

Steering angle in degrees, always around the local y-axis.

suspensionDistance

Maximum extension distance of wheel suspension, measured in local space.

suspensionSpring

The parameters of wheel's suspension. The suspension attempts to reach a target
position by applying a linear force and a damping force.

wheelDampingRate

The damping rate of the wheel. Must be larger than zero.

Public Methods
Con gureVehicleSubsteps

Con gure vehicle sub-stepping parameters.

GetGroundHit

Gets ground collision data for the wheel.

GetWorldPose

Gets the world space pose of the wheel accounting for ground contact,
suspension limits, steer angle, and rotation angle (angles in degrees).

Inherited Members
Properties
attachedRigidbody

The rigidbody the collider is attached to.

bounds

The world space bounding volume of the collider (Read Only).

contactO set

Contact o set value of this collider.

enabled

Enabled Colliders will collide with other Colliders, disabled Colliders won't.

isTrigger

Is the collider a trigger?

material

The material used by the collider.

sharedMaterial

The shared physic material of this collider.

gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods
ClosestPoint

Returns a point on the collider that is closest to a given location.

ClosestPointOnBounds

The closest point to the bounding box of the attached collider.

Raycast

Casts a Ray that ignores all Colliders except this one.

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnCollisionEnter

OnCollisionEnter is called when this collider/rigidbody has begun touching another
rigidbody/collider.

OnCollisionExit

OnCollisionExit is called when this collider/rigidbody has stopped touching another
rigidbody/collider.

OnCollisionStay

OnCollisionStay is called once per frame for every collider/rigidbody that is touching
rigidbody/collider.

OnTriggerEnter

OnTriggerEnter is called when the Collider other enters the trigger.

OnTriggerExit

OnTriggerExit is called when the Collider other has stopped touching the trigger.

OnTriggerStay

OnTriggerStay is called almost all the frames for every Collider other that is touching the
trigger. The function is on the physics timer so it won't necessarily run every frame.

Leave feedback

Description
WheelFrictionCurve is used by the WheelCollider to describe friction properties of the wheel tire.
The curve takes a measure of tire slip as an input and gives a force as output. The curve is approximated by a
two-piece spline. The rst section goes from (0,0) to (extremumSlip,extremumValue), at which point the curve's
tangent is zero. The second section goes from (extremumSlip,extremumValue) to (asymptoteSlip,asymptoteValue),
where curve's tangent is again zero:

Wheel collider computes friction separately from the rest of physics engine, using a slip based friction model. It
separates the overall friction force into a "forwards" component (in the direction of rolling, and responsible for
acceleration and braking) and "sideways" component (orthogonal to rolling, responsible for keeping the car
oriented). Tire friction is described separately in these directions using WheelCollider.forwardFriction and
WheelCollider.sidewaysFriction. In both directions it is rst determined how much the tire is slipping (what is the
speed di erence between the rubber and the road). Then this slip value is used to nd out tire force exerted on
the contact.
The property of real tires is that for low slip they can exert high forces as the rubber compensates for the slip by
stretching. Later when the slip gets really high, the forces are reduced as the tire starts to slide or spin. Thus tire
friction curves have a shape like in the image above.
Because the friction for the tires is computed separately, the PhysicMaterial of the ground does not a ect the
wheels. Simulation of di erent road materials is done by changing the WheelCollider.forwardFriction and
WheelCollider.sidewaysFriction of the wheel, based on what material the wheel is hitting.
See Also: WheelCollider, WheelCollider.forwardFriction, WheelCollider.sidewaysFriction.

Properties
asymptoteSlip

Asymptote point slip (default 2).

asymptoteValue

Force at the asymptote slip (default 10000).

extremumSlip

Extremum point slip (default 1).

extremumValue

Force at the extremum slip (default 20000).

sti ness

Multiplier for the extremumValue and asymptoteValue values (default 1).

Leave feedback

Description
Contact information for the wheel, reported by WheelCollider.
Friction for the WheelCollider is computed separately from the rest of the physics, using a slip based tire friction
model. This allows for more realistic behaviour, but makes wheel colliders ignore standard PhysicMaterial
settings.
The way to simulate di erent ground materials is to query WheelCollider for its collision information (see
WheelCollider.GetGroundHit). Usually, you get the other collider the wheel is hitting, and modify the wheel's
WheelCollider.forwardFriction and WheelCollider.sidewaysFriction based on the physic material of the ground.
The other members of the WheelHit structure are usually queried for information purposes or special e ects. For
example, a "slipping tire" sound can be played if forwardSlip or sidewaysSlip exceed some threshold.
See Also: WheelCollider.GetGroundHit.

Properties
collider

The other Collider the wheel is hitting.

force

The magnitude of the force being applied for the contact.

forwardDir

The direction the wheel is pointing in.

forwardSlip

Tire slip in the rolling direction. Acceleration slip is negative, braking slip is positive.

normal

The normal at the point of contact.

point

The point of contact between the wheel and the ground.

sidewaysDir

The sideways direction of the wheel.

sidewaysSlip

Tire slip in the sideways direction.

Leave feedback
SWITCH TO MANUAL

Description
The wheel joint allows the simulation of wheels by providing a constraining suspension motion with an optional
motor.
See Also: JointSuspension2D.

Properties
jointAngle

The current joint angle (in degrees) de ned as the relative angle between the two
Rigidbody2D that the joint connects to.

jointLinearSpeed

The current joint linear speed in meters/sec.

jointSpeed

The current joint rotational speed in degrees/sec.

jointTranslation

The current joint translation.

motor

Parameters for a motor force that is applied automatically to the Rigibody2D along the
line.

suspension

Set the joint suspension con guration.

useMotor

Should a motor force be applied automatically to the Rigidbody2D?

Public Methods
GetMotorTorque

Gets the motor torque of the joint given the speci ed timestep.

Inherited Members
Properties
anchor

The joint's anchor point on the object that has the joint component.

autoCon gureConnectedAnchor

Should the connectedAnchor be calculated automatically?

connectedAnchor

The joint's anchor point on the second object (ie, the one which doesn't
have the joint component).

enabled

Enabled Behaviours are Updated, disabled Behaviours are not.

isActiveAndEnabled

Has the Behaviour had active and enabled called?

gameObject

The game object this component is attached to. A component is always
attached to a game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

attachedRigidbody

The Rigidbody2D attached to the Joint2D.

breakForce

The force that needs to be applied for this joint to break.

breakTorque

The torque that needs to be applied for this joint to break.

connectedBody

The Rigidbody2D object to which the other end of the joint is attached (ie,
the object without the joint component).

enableCollision

Should the two rigid bodies connected with this joint collide with each
other?

reactionForce

Gets the reaction force of the joint.

reactionTorque

Gets the reaction torque of the joint.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the
user?

name

The name of the object.

Public Methods
BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetReactionForce

Gets the reaction force of the joint given the speci ed timeStep.

GetReactionTorque

Gets the reaction torque of the joint given the speci ed timeStep.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Messages
OnJointBreak2D

Called when a Joint2D attached to the same game object breaks.

Leave feedback
SWITCH TO MANUAL

Description
Wind Zones add realism to the trees you create by making them wave their branches and leaves as if blown by
the wind.
Note: This only works with trees created by the tree creator or imported from SpeedTree Modeler.

Properties
mode

De nes the type of wind zone to be used (Spherical or Directional).

radius

Radius of the Spherical Wind Zone (only active if the WindZoneMode is set to
Spherical).

windMain

The primary wind force.

windPulseFrequency

De nes the frequency of the wind changes.

windPulseMagnitude

De nes how much the wind changes over time.

windTurbulence

The turbulence wind force.

Constructors
WindZone

The constructor.

Inherited Members
Properties
gameObject

The game object this component is attached to. A component is always attached to a
game object.

tag

The tag of this game object.

transform

The Transform attached to this GameObject.

hideFlags

Should the object be hidden, saved with the Scene or modi able by the user?

name

The name of the object.

Public Methods

BroadcastMessage

Calls the method named methodName on every MonoBehaviour in this game
object or any of its children.

CompareTag

Is this game object tagged with tag ?

GetComponent

Returns the component of Type type if the game object has one attached, null if
it doesn't.

GetComponentInChildren

Returns the component of Type type in the GameObject or any of its children
using depth rst search.

GetComponentInParent

Returns the component of Type type in the GameObject or any of its parents.

GetComponents

Returns all components of Type type in the GameObject.

GetComponentsInChildren

Returns all components of Type type in the GameObject or any of its children.

GetComponentsInParent

Returns all components of Type type in the GameObject or any of its parents.

SendMessage

Calls the method named methodName on every MonoBehaviour in this game
object.

SendMessageUpwards

Calls the method named methodName on every MonoBehaviour in this game
object and on every ancestor of the behaviour.

GetInstanceID

Returns the instance id of the object.

ToString

Returns the name of the GameObject.

Static Methods
Destroy

Removes a gameobject, component or asset.

DestroyImmediate

Destroys the object obj immediately. You are strongly recommended to use Destroy
instead.

DontDestroyOnLoad

Makes the object target not be destroyed automatically when loading a new Scene.

FindObjectOfType

Returns the rst active loaded object of Type type.

FindObjectsOfType

Returns a list of all active loaded objects of Type type.

Instantiate

Clones the object original and returns the clone.

Operators
bool

Does the object exist?

operator !=

Compares if two objects refer to a di erent object.

operator ==

Compares two object references to see if they refer to the same object.

Leave feedback
Obsolete

Description
Simple access to web pages.
This is a small utility module for retrieving the contents of URLs.
You start a download in the background by calling WWW(url) which returns a new WWW object.
You can inspect the isDone property to see if the download has completed or yield the download object to
automatically wait until it is (without blocking the rest of the game).
Use it if you want to get some data from a web server for integration with a game such as highscore lists or calling
home for some reason. There is also functionality to create textures from images downloaded from the web and
to stream & load new web player data les.
The WWW class can be used to send both GET and POST requests to the server. The WWW class will use GET by
default and POST if you supply a postData parameter.
See Also: WWWForm for a way to build valid form data for the postData parameter.
Note: URLs passed to WWW class must be '%' escaped.
Notes http://, https:// and le:// protocols are supported on iPhone. ftp:// protocol support is limited to
anonymous downloads only. Other protocols are not supported.
Note: When using le protocol on Windows and Windows Store Apps for accessing local les, you have to specify
le:/// (with three slashes).

// Get the latest webcam shot from outside "Friday's" in Times Square
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
public string url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jp
IEnumerator Start()
{
using (WWW www = new WWW(url))
{
yield return www;
Renderer renderer = GetComponent();

renderer.material.mainTexture = www.texture;
}
}
}

Inherited Members
Properties
keepWaiting

Indicates if coroutine should be kept suspended.

Leave feedback

Description
Helper class to generate form data to post to web servers using the UnityWebRequest or WWW classes.

using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class WWWFormImage : MonoBehaviour
{

public string screenShotURL= "http://www.my-server.com/cgi-bin/screenshot.pl

// Use this for initialization
void Start()
{
StartCoroutine(UploadPNG());
}

IEnumerator UploadPNG()
{
// We should only read the screen after all rendering is complete
yield return new WaitForEndOfFrame();

// Create a texture the size of the screen, RGB24 format
int width = Screen.width;
int height = Screen.height;
var tex = new Texture2D( width, height, TextureFormat.RGB24, false );

// Read screen contents into the texture
tex.ReadPixels( new Rect(0, 0, width, height), 0, 0 );
tex.Apply();

// Encode texture into PNG
byte[] bytes = tex.EncodeToPNG();
Destroy( tex );

// Create a Web Form
WWWForm form = new WWWForm();
form.AddField("frameCount", Time.frameCount.ToString());
form.AddBinaryData("fileUpload", bytes, "screenShot.png", "image/png");

// Upload to a cgi script
using (var w = UnityWebRequest.Post(screenShotURL, form))
{
yield return w.SendWebRequest();
if (w.isNetworkError || w.isHttpError) {
print(w.error);
}
else {
print("Finished Uploading Screenshot");
}
}
}
}

Here is a sample script that retrieves the high scores stored in a table in an SQL database.

using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class WWWFormScore : MonoBehaviour
{
string highscore_url = "http://www.my-site.com/highscores.pl";
string playName = "Player 1";
int score = -1;

// Use this for initialization
IEnumerator Start()
{
// Create a form object for sending high score data to the server
WWWForm form = new WWWForm();

// Assuming the perl script manages high scores for different games

form.AddField( "game", "MyGameName" );

// The name of the player submitting the scores
form.AddField( "playerName", playName );

// The score
form.AddField( "score", score );

// Create a download object
var download = UnityWebRequest.Post(highscore_url, form);

// Wait until the download is done
yield return download.SendWebRequest();

if (download.isNetworkError || download.isHttpError)
{
print( "Error downloading: " + download.error );
}
else
{
// show the highscores
Debug.Log(download.downloadHandler.text);
}
}
}

Here is a sample Perl script that processes the high scores stored in a table in an SQL database.

#!/usr/bin/perl
# The SQL database needs to have a table called highscores
# that looks something like this:
#
#
CREATE TABLE highscores (
#
game varchar(255) NOT NULL,
#
player varchar(255) NOT NULL,
#
score integer NOT NULL
#
);
#
use strict;

use CGI;
use DBI;

# Read form data etc.
my $cgi = new CGI;

# The results from the high score script will be in plain text
print $cgi->header("text/plain");

my $game = $cgi->param('game');
my $playerName = $cgi->param('playerName');
my $score = $cgi->param('score');

exit 0 unless $game; # This parameter is required

# Connect to a database
my $dbh = DBI->connect( 'DBI:mysql:databasename', 'username', 'password' )
|| die "Could not connect to database: $DBI::errstr";

# Insert the player score if there are any
if( $playerName && $score) {
$dbh->do( "insert into highscores (game, player, score) values(?,?,?)",
undef, $game, $playerName, $score );
}

# Fetch the high scores
my $sth = $dbh->prepare(
'SELECT player, score FROM highscores WHERE game=? ORDER BY score desc LIMIT
$sth->execute($game);
while (my $r = $sth->fetchrow_arrayref) {
print join(':',@$r),"\n"
}

Properties
data

(Read Only) The raw data to pass as the POST request body when sending the form.

headers

(Read Only) Returns the correct request headers for posting the form using the WWW

class.

Constructors
WWWForm

Creates an empty WWWForm object.

Public Methods
AddBinaryData

Add binary data to the form.

AddField

Add a simple eld to the form.

Leave feedback

Description
Base class for all yield instructions.
See WaitForSeconds, WaitForFixedUpdate, Coroutine and MonoBehaviour.StartCoroutine for more information.

Leave feedback

Description
This element can lter raycasts. If the top level element is hit it can further 'check' if the location is valid.

Public Methods
IsRaycastLocationValid

Given a point and a camera is the raycast valid.

Leave feedback

Description
Interface for objects used as resolvers on ExposedReferences.

Public Methods
ClearReferenceValue

Remove a value for the given reference.

GetReferenceValue

Retrieves a value for the given identi er.

SetReferenceValue

Assigns a value for an ExposedReference.

Leave feedback
Implements interfaces:ILogHandler

Description
Interface for custom logger implementation.
See Also: Logger, Debug.unityLogger ILogHandler.

Properties
lterLogType

To selective enable debug log message.

logEnabled

To runtime toggle debug logging [ON/OFF].

logHandler

Set Logger.ILogHandler.

Public Methods
IsLogTypeAllowed

Check logging is enabled based on the LogType.

Log

Logs message to the Unity Console using default logger.

LogError

A variant of ILogger.Log that logs an error message.

LogException

A variant of ILogger.Log that logs an exception message.

LogFormat

Logs a formatted message.

LogWarning

A variant of Logger.Log that logs an warning message.

Leave feedback

Description
Interface for custom log handler implementation.
ILogHandler interface to ease unit-testing and mocking of loggers.

using
using
using
using

UnityEngine;
System.Collections;
System.IO;
System;

public class MyFileLogHandler : ILogHandler
{
private FileStream m_FileStream;
private StreamWriter m_StreamWriter;
private ILogHandler m_DefaultLogHandler = Debug.unityLogger.logHandler;

public MyFileLogHandler()
{
string filePath = Application.persistentDataPath + "/MyLogs.txt";

m_FileStream = new FileStream(filePath, FileMode.OpenOrCreate, FileAcces
m_StreamWriter = new StreamWriter(m_FileStream);

// Replace the default debug log handler
Debug.unityLogger.logHandler = this;
}

public void LogFormat(LogType logType, UnityEngine.Object context, string fo
{
m_StreamWriter.WriteLine(String.Format(format, args));
m_StreamWriter.Flush();
m_DefaultLogHandler.LogFormat(logType, context, format, args);
}

public void LogException(Exception exception, UnityEngine.Object context)
{

m_DefaultLogHandler.LogException(exception, context);
}
}

public class MyGameClass : MonoBehaviour
{
private static ILogger logger = Debug.unityLogger;
private static string kTAG = "MyGameTag";
private MyFileLogHandler myFileLogHandler;

void Start()
{
myFileLogHandler = new MyFileLogHandler();

logger.Log(kTAG, "MyGameClass Start.");
}
}

Public Methods
LogException

A variant of ILogHandler.LogFormat that logs an exception message.

LogFormat

Logs a formatted message.

Leave feedback

Description
Interface to receive callbacks upon serialization and deserialization.
Unity's serializer is able to serialize most datatypes, but not all of them. In these cases, there are two callbacks
available for you to manually process these datatypes so that Unity can serialize and deserialise them.
Care needs to be taken whilst within these callbacks, as Unity's serializer runs on a di erent thread to most of the
Unity API. It's advisable to only process the manipulation of datatypes, keeping the processing burden as low as
possible.
Serialization can occur during all kinds of operations. For example, when using Instantiate() to clone an object,
Unity serializes and deserializes the original object in order to nd internal references to the original object, so
that it can replace them with references to the cloned object. In this situation, you can also employ the callbacks
to update any internal references using types that Unity can't serialize.
Currently the callback interface only works with classes; it won't work with structs.

using UnityEngine;
using System;
using System.Collections.Generic;

public class SerializationCallbackScript : MonoBehaviour, ISerializationCallback
{
public List _keys = new List { 3, 4, 5 };
public List _values = new List { "I", "Love", "Unity" };

//Unity doesn't know how to serialize a Dictionary
public Dictionary _myDictionary = new Dictionary(

public void OnBeforeSerialize()
{
_keys.Clear();
_values.Clear();

foreach (var kvp in _myDictionary)
{
_keys.Add(kvp.Key);
_values.Add(kvp.Value);

}
}

public void OnAfterDeserialize()
{
_myDictionary = new Dictionary();

for (int i = 0; i != Math.Min(_keys.Count, _values.Count); i++)
_myDictionary.Add(_keys[i], _values[i]);
}

void OnGUI()
{
foreach (var kvp in _myDictionary)
GUILayout.Label("Key: " + kvp.Key + " value: " + kvp.Value);
}
}

Public Methods
OnAfterDeserialize

Implement this method to receive a callback after Unity deserializes your object.

OnBeforeSerialize

Implement this method to receive a callback before Unity serializes your object.

Leave feedback

Description
Enum mask of possible shader channel properties that can also be included when the Canvas mesh is created.

Properties
None

No additional shader parameters are needed.

TexCoord1

Include UV1 on the mesh vertices.

TexCoord2

Include UV2 on the mesh vertices.

TexCoord3

Include UV3 on the mesh vertices.

Normal

Include the normals on the mesh vertices.

Tangent

Include the Tangent on the mesh vertices.

Leave feedback

Description
ActivityIndicator Style (Android Speci c).

Properties
DontShow

Do not show ActivityIndicator.

Large

Large (android.R.attr.progressBarStyleLarge).

InversedLarge

Large Inversed (android.R.attr.progressBarStyleLargeInverse).

Small

Small (android.R.attr.progressBarStyleSmall).

InversedSmall

Small Inversed (android.R.attr.progressBarStyleSmallInverse).

Leave feedback

Description
Used by Animation.Play function.

Properties
Blend

Animations will be blended.

Additive

Animations will be added.

Leave feedback

Description
This enum controlls culling of Animation component.
When culling is enabled, Unity might stop animating if it thinks that the results of the animation won't be visible to
the user. This could save you some performance if you have things animating outside of the viewport, whose
animation is only important when the user can actually see the thing that is being animated. When Animation
component is culled it won't do anything: it won't update animation states, execute events or sample animations.

Properties
AlwaysAnimate

Animation culling is disabled - object is animated even when o screen.

BasedOnRenderers

Animation is disabled when renderers are not visible.

Leave feedback

Description
The type of the parameter.
Can be bool, oat, int or trigger.

Properties
Float

Float type parameter.

Int

Int type parameter.

Bool

Boolean type parameter.

Trigger

Trigger type parameter.

Leave feedback

Description
Culling mode for the Animator.

Properties
AlwaysAnimate

Always animate the entire character. Object is animated even when o screen.

CullUpdateTransforms

Retarget, IK and write of Transforms are disabled when renderers are not visible.

CullCompletely

Animation is completely disabled when renderers are not visible.

Leave feedback

Description
The mode of the Animator's recorder.
The recorder can either be O ine, in Playback or in Record.

Properties
O ine

The Animator recorder is o ine.

Playback

The Animator recorder is in Playback.

Record

The Animator recorder is in Record.

Leave feedback

Description
The update mode of the Animator.

Properties
Normal

Normal update of the animator.

AnimatePhysics

Updates the animator during the physic loop in order to have the animation system
synchronized with the physics engine.

UnscaledTime

Animator updates independently of Time.timeScale.

Leave feedback

Description
Anisotropic ltering mode.
See Also: QualitySettings.anisotropicFiltering.

Properties
Disable

Disable anisotropic ltering for all textures.

Enable

Enable anisotropic ltering, as set for each texture.

ForceEnable

Enable anisotropic ltering for all textures.

Leave feedback

Description
Application installation mode (Read Only).

Properties
Unknown

Application install mode unknown.

Store

Application installed via online store.

DeveloperBuild

Application installed via developer build.

Adhoc

Application installed via ad hoc distribution.

Enterprise

Application installed via enterprise distribution.

Editor

Application running in editor.

Leave feedback

Description
Application sandbox type.

Properties
Unknown

Application sandbox type is unknown.

NotSandboxed

Application not running in a sandbox.

Sandboxed

Application is running in a sandbox.

SandboxBroken

Application is running in broken sandbox.

Leave feedback

Description
Enumeration of all the muscles in an arm.
These muscles are a sub-part of a human part.
See Also: HumanPartDof.

Properties
ShoulderDownUp

The shoulder down-up muscle.

ShoulderFrontBack

The shoulder front-back muscle.

ArmDownUp

The arm down-up muscle.

ArmFrontBack

The arm front-back muscle.

ArmRollInOut

The arm roll in-out muscle.

ForeArmCloseOpen

The forearm close-open muscle.

ForeArmRollInOut

The forearm roll in-out muscle.

HandDownUp

The hand down-up muscle.

HandInOut

The hand in-out muscle.

LastArmDof

The last value of the ArmDof enum.

Leave feedback

Description
Determines how the audio clip is loaded in.
Determines whether the audio clip will be either loaded in memory in compressed form, such that every playback
will decode the data on the y ("CompressedInMemory"), decompressed at Scene startup such that the clip can
be played back at very low CPU usage and the audio data in ir can be modi ed ("DecompressOnLoad"), or
streamed directly from the disk which will typically result in the lowest memory usage, as only the data for a short
stream bu er needs to be kept in memory ("Streaming").

Properties
DecompressOnLoad

The audio data is decompressed when the audio clip is loaded.

CompressedInMemory

The audio data of the clip will be kept in memory in compressed form.

Streaming

Streams audio data from disk.

Leave feedback

Description
An enum containing di erent compression types.
This enum is used within the AudioImporter to de ne what type of compression will be used for an imported
AudioClip.

Properties
PCM

Uncompressed pulse-code modulation.

Vorbis

Vorbis compression format.

ADPCM

Adaptive di erential pulse-code modulation.

MP3

MPEG Audio Layer III.

VAG

Sony proprietary hardware format.

HEVAG

Sony proprietory hardware codec.

XMA

Xbox One proprietary hardware format.

AAC

AAC Audio Compression.

GCADPCM

Nintendo ADPCM audio compression format.

ATRAC9

Sony proprietary hardware format.

Leave feedback

Description
Value describing the current load state of the audio data associated with an AudioClip.

Properties
Unloaded

Value returned by AudioClip.loadState for an AudioClip that has no audio data loaded and
where loading has not been initiated yet.

Loading

Value returned by AudioClip.loadState for an AudioClip that is currently loading audio
data.

Loaded

Value returned by AudioClip.loadState for an AudioClip that has succeeded loading its
audio data.

Failed

Value returned by AudioClip.loadState for an AudioClip that has failed loading its audio
data.

Leave feedback

Description
Reverb presets used by the Reverb Zone class and the audio reverb lter.
Component for audio sources.

Properties
O

No reverb preset selected.

Generic

Generic preset.

PaddedCell

Padded cell preset.

Room

Room preset.

Bathroom

Bathroom preset.

Livingroom

Livingroom preset.

Stoneroom

Stoneroom preset.

Auditorium

Auditorium preset.

Concerthall

Concert hall preset.

Cave

Cave preset.

Arena

Arena preset.

Hangar

Hangar preset.

CarpetedHallway

Carpeted hallway preset.

Hallway

Hallway preset.

StoneCorridor

Stone corridor preset.

Alley

Alley preset.

Forest

Forest preset.

City

City preset.

Mountains

Mountains preset.

Quarry

Quarry preset.

Plain

Plain preset.

ParkingLot

Parking Lot preset.

SewerPipe

Sewer pipe preset.

Underwater

Underwater presset.

Drugged

Drugged preset.

Dizzy

Dizzy preset.

Psychotic

Psychotic preset.

User

User de ned preset.

Leave feedback

Description
Rollo modes that a 3D sound can have in an audio source.

Properties
Logarithmic

Use this mode when you want a real-world rollo .

Linear

Use this mode when you want to lower the volume of your sound over the distance.

Custom

Use this when you want to use a custom rollo .

Leave feedback

Description
This de nes the curve type of the di erent custom curves that can be queried and set within the AudioSource.
The AudioSource can hold a number of custom distance curves, this enum is used within the AudioSource API to
di erentiate between them.

Properties
CustomRollo

Custom Volume Rollo .

SpatialBlend

The Spatial Blend.

ReverbZoneMix

Reverb Zone Mix.

Spread

The 3D Spread.

Leave feedback

Description
These are speaker types de ned for use with AudioSettings.speakerMode.
Your project's default speaker mode can be set in the Audiomanager through Edit->Project Settings->Audio.
See Also: AudioSettings, Audio Manager.

Properties
Raw

Channel count is una ected.

Mono

Channel count is set to 1. The speakers are monaural.

Stereo

Channel count is set to 2. The speakers are stereo. This is the editor default.

Quad

Channel count is set to 4. 4 speaker setup. This includes front left, front right, rear left,
rear right.

Surround

Channel count is set to 5. 5 speaker setup. This includes front left, front right, center, rear
left, rear right.

Mode5point1

Channel count is set to 6. 5.1 speaker setup. This includes front left, front right, center,
rear left, rear right and a subwoofer.

Mode7point1

Channel count is set to 8. 7.1 speaker setup. This includes front left, front right, center,
rear left, rear right, side left, side right and a subwoofer.

Prologic

Channel count is set to 2. Stereo output, but data is encoded in a way that is picked up by
a Prologic/Prologic2 decoder and split into a 5.1 speaker setup.

Leave feedback

Description
Type of the imported(native) data.

Properties
UNKNOWN

3rd party / unknown plugin format.

ACC

Acc - not supported.

AIFF

Ai .

IT

Impulse tracker.

MOD

Protracker / Fasttracker MOD.

MPEG

MP2/MP3 MPEG.

OGGVORBIS

Ogg vorbis.

S3M

ScreamTracker 3.

WAV

Microsoft WAV.

XM

FastTracker 2 XM.

XMA

Xbox360 XMA.

VAG

VAG.

AUDIOQUEUE

iPhone hardware decoder, supports AAC, ALAC and MP3. Extracodecdata is a pointer to
an FMOD_AUDIOQUEUE_EXTRACODECDATA structure.

Leave feedback

Description
Describes when an AudioSource or AudioListener is updated.

Properties
Auto

Updates the source or listener in the FixedUpdate loop if it is attached to a Rigidbody,
dynamic Update otherwise.

Fixed

Updates the source or listener in the FixedUpdate loop.

Dynamic

Updates the source or listener in the dynamic Update loop.

Leave feedback

Description
IK Goal.
Used to set and get IK weights, position and rotation. See Also: Animator.SetIKPosition,
Animator.SetIKPositionWeight, Animator.SetIKRotation and Animator.SetIKRotationWeight.

Properties
LeftFoot

The left foot.

RightFoot

The right foot.

LeftHand

The left hand.

RightHand

The right hand.

Leave feedback

Description
IK Hint.
Used to set and get IK weights and position. See Also: Animator.GetIKHintPosition,
Animator.GetIKHintPositionWeight, Animator.SetIKHintPosition, and Animator.SetIKHintPositionWeight.

Properties
LeftKnee

The left knee IK hint.

RightKnee

The right knee IK hint.

LeftElbow

The left elbow IK hint.

RightElbow

The right elbow IK hint.

Leave feedback

Description
Avatar body part.

Properties
Root

The Root.

Body

The Body.

Head

The Head.

LeftLeg

The Left Leg.

RightLeg

The Right Leg.

LeftArm

The Left Arm.

RightArm

The Right Arm.

LeftFingers

Left Fingers.

RightFingers

Right Fingers.

LeftFootIK

Left Foot IK.

RightFootIK

Right Foot IK.

LeftHandIK

Left Hand IK.

RightHandIK

Right Hand IK.

LastBodyPart

Total number of body parts.

Leave feedback

Description
Target.
See Also: Animator.SetTarget and Animator.MatchTarget.

Properties
Root

The root, the position of the game object.

Body

The body, center of mass.

LeftFoot

The left foot.

RightFoot

The right foot.

LeftHand

The left hand.

RightHand

The right hand.

Leave feedback

Description
Enumeration for SystemInfo.batteryStatus which represents the current status of the device's battery.

Properties
Unknown

The device's battery status cannot be determined. If battery status is not available on your
target platform, SystemInfo.batteryStatus will return this value.

Charging

Device is plugged in and charging.

Discharging

Device is unplugged and discharging.

NotCharging

Device is plugged in, but is not charging.

Full

Device is plugged in and the battery is full.

Leave feedback

Description
Blend weights.
How many bones a ect each vertex. See Also: QualitySettings.blendWeights.

Properties
OneBone

One bone a ects each vertex.

TwoBones

Two bones a ect each vertex.

FourBones

Four bones a ect each vertex.

Leave feedback

Description
Enumeration of all the muscles in the body.
These muscles are a sub-part of a human part.
See Also: HumanPartDof.

Properties
SpineFrontBack

The spine front-back muscle.

SpineLeftRight

The spine left-right muscle.

SpineRollLeftRight

The spine roll left-right muscle.

ChestFrontBack

The chest front-back muscle.

ChestLeftRight

The chest left-right muscle.

ChestRollLeftRight

The chest roll left-right muscle.

UpperChestFrontBack

The upper chest front-back muscle.

UpperChestLeftRight

The upper chest left-right muscle.

UpperChestRollLeftRight

The upper chest roll left-right muscle.

LastBodyDof

The last value of the BodyDof enum.

Leave feedback

Description
Values for Camera.clearFlags, determining what to clear when rendering a Camera.
See Also: camera component.

Properties
Skybox

Clear with the skybox.

SolidColor

Clear with a background color.

Depth

Clear only the depth bu er.

Nothing

Don't clear anything.

Leave feedback

Description
Describes di erent types of camera.

Properties
Game

Used to indicate a regular in-game camera.

SceneView

Used to indicate that a camera is used for rendering the Scene View in the Editor.

Preview

Used to indicate a camera that is used for rendering previews in the Editor.

VR

Used to indicate that a camera is used for rendering VR (in edit mode) in the Editor.

Re ection

Used to indicate a camera that is used for rendering re ection probes.

Leave feedback

Description
The direction that the capsule sides can extend.
See Also: :CapsuleCollider::direction.

Properties
Vertical

The capsule sides extend vertically.

Horizontal

The capsule sides extend horizontally.

Leave feedback

Description
Values to determine the type of input value to be expect from one entry of ClusterInput.

Properties
Button

Device that return a binary result of pressed or not pressed.

Axis

Device is an analog axis that provides continuous value represented by a oat.

Tracker

Device that provide position and orientation values.

CustomProvidedInput

A user customized input.

Leave feedback

Description
The collision detection mode constants used for Rigidbody.collisionDetectionMode.

//This script allows you to switch collision detection mode at the press of the
//Attach this script to a GameObject and make sure it has a Rigidbody component
//If it doesn't have a Rigidbody component, click the GameObject, go to its Insp
//Create another GameObject. Make sure it has a Collider, so you can test collis

using UnityEngine;

public class Example : MonoBehaviour
{
Rigidbody m_Rigidbody;
public float m_Speed;

void Start()
{
//Fetch the Rigidbody of the GameObject (make sure this is attached in t
m_Rigidbody = GetComponent();
//Make sure the Rigidbody can't rotate or move in the z axis for this ex
m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotation | Rigidbod
}

void Update()
{
//Change the GameObject's movement in the X axis
float translationX = Input.GetAxis("Horizontal") * m_Speed;
//Change the GameObject's movement in the Y axis
float translationY = Input.GetAxis("Vertical") * m_Speed;

//Move the GameObject
transform.Translate(new Vector3(translationX, translationY, 0));

//Press the space key to switch the collision detection mode
if (Input.GetKeyDown(KeyCode.Space))
SwitchCollisionDetectionMode();

}

//Detect when there is a collision starting
void OnCollisionEnter(Collision collision)
{
//Ouput the Collision to the console
Debug.Log("Collision : " + collision.gameObject.name);
}

//Detect when there is are ongoing Collisions
void OnCollisionStay(Collision collision)
{
//Output the Collision to the console
Debug.Log("Stay : " + collision.gameObject.name);
}

//Switch between the different Collision Detection Modes
void SwitchCollisionDetectionMode()
{
switch (m_Rigidbody.collisionDetectionMode)
{
//If the current mode is continuous, switch it to continuous dynamic
case CollisionDetectionMode.Continuous:
m_Rigidbody.collisionDetectionMode = CollisionDetectionMode.Cont
break;
//If the current mode is continuous dynamic, switch it to continuous
case CollisionDetectionMode.ContinuousDynamic:
m_Rigidbody.collisionDetectionMode = CollisionDetectionMode.Cont
break;

// If the curren mode is continuous speculative, switch it to discre
case CollisionDetectionMode.ContinuousSpeculative:
m_Rigidbody.collisionDetectionMode = CollisionDetectionMode.Disc
break;

//If the current mode is discrete, switch it to continuous mode
case CollisionDetectionMode.Discrete:
m_Rigidbody.collisionDetectionMode = CollisionDetectionMode.Cont
break;
}

}
}

Properties
Discrete

Continuous collision detection is o for this Rigidbody.

Continuous

Continuous collision detection is on for colliding with static mesh geometry.

ContinuousDynamic

Continuous collision detection is on for colliding with static and dynamic geometry.

ContinuousSpeculative

Speculative continuous collision detection is on for static and dynamic geometries

Leave feedback

Description
Controls how collisions are detected when a Rigidbody2D moves.
See Also: [[Rigidbody2D::collisionDetectionMode]].

Properties
Discrete

When a Rigidbody2D moves, only collisions at the new position are detected.

Continuous

Ensures that all collisions are detected when a Rigidbody2D moves.

Leave feedback

Description
CollisionFlags is a bitmask returned by CharacterController.Move.
It gives you a broad overview of where your character collided with any other objects.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
void Update()
{
CharacterController controller = GetComponent();

if (controller.collisionFlags == CollisionFlags.None)
{
print("Free floating!");
}

if ((controller.collisionFlags & CollisionFlags.Sides) != 0)
{
print("Touching sides!");
}

if (controller.collisionFlags == CollisionFlags.Sides)
{
print("Only touching sides, nothing else!");
}

if ((controller.collisionFlags & CollisionFlags.Above) != 0)
{
print("Touching Ceiling!");
}

if (controller.collisionFlags == CollisionFlags.Above)
{

print("Only touching Ceiling, nothing else!");
}

if ((controller.collisionFlags & CollisionFlags.Below) != 0)
{
print("Touching ground!");
}

if (controller.collisionFlags == CollisionFlags.Below)
{
print("Only touching ground, nothing else!");
}
}
}

Properties
None

CollisionFlags is a bitmask returned by CharacterController.Move.

Sides

CollisionFlags is a bitmask returned by CharacterController.Move.

Above

CollisionFlags is a bitmask returned by CharacterController.Move.

Below

CollisionFlags is a bitmask returned by CharacterController.Move.

Leave feedback

Description
Represents a color gamut.

Properties
sRGB

sRGB color gamut.

Rec709

Rec. 709 color gamut.

Rec2020

Rec. 2020 color gamut.

DisplayP3

Display-P3 color gamut.

HDR10

HDR10 high dynamic range color gamut.

DolbyHDR

DolbyHDR high dynamic range color gamut.

Leave feedback

Description
Color space for player settings.
This enum is used to indicate color space used in project (PlayerSettings.colorSpace) and sprite atlases
(AtlasSettings.colorSpace).
See Also: Linear and Gamma rendering, RenderTextureReadWrite.

Properties
Uninitialized

Uninitialized color space.

Gamma

Gamma color space.

Linear

Linear color space.

Leave feedback

Description
ComputeBu er type.
Di erent types of compute bu ers map to di erent usage and declarations in HLSL shaders. Default type is
"structured bu er" (StructuredBuffer or RWStructuredBuffer).
See Also: ComputeBu er, ComputeShader, Material.SetBu er.

Properties
Default

Default ComputeBu er type (structured bu er).

Raw

Raw ComputeBu er type (byte address bu er).

Append

Append-consume ComputeBu er type.

Counter

ComputeBu er with a counter.

IndirectArguments

ComputeBu er used for Graphics.DrawProceduralIndirect,
ComputeShader.DispatchIndirect or Graphics.DrawMeshInstancedIndirect arguments.

Leave feedback

Description
Constrains movement for a Con gurableJoint along the 6 axes.

Properties
Locked

Motion along the axis will be locked.

Limited

Motion along the axis will be limited by the respective limit.

Free

Motion along the axis will be completely free and completely unconstrained.

Leave feedback
Obsolete

Description
The various test results the connection tester may return with.

Leave feedback

Description
Cubemap face.
Used by Cubemap.GetPixel and Cubemap.SetPixel.

Properties
Unknown

Cubemap face is unknown or unspeci ed.

PositiveX

Right facing side (+x).

NegativeX

Left facing side (-x).

PositiveY

Upwards facing side (+y).

NegativeY

Downward facing side (-y).

PositiveZ

Forward facing side (+z).

NegativeZ

Backward facing side (-z).

Leave feedback

Description
How the cursor should behave.
These are a various modes that control the behaviour of the Cursor. A default cursor must be set in
PlayerSettings > Default Cursor.

//This script makes Buttons that control the Cursor's lock state. Note that the

using UnityEngine;

public class Example : MonoBehaviour
{
void Update()
{
//Press the space bar to apply no locking to the Cursor
if (Input.GetKey(KeyCode.Space))
Cursor.lockState = CursorLockMode.None;
}

void OnGUI()
{
//Press this button to lock the Cursor
if (GUI.Button(new Rect(0, 0, 100, 50), "Lock Cursor"))
{
Cursor.lockState = CursorLockMode.Locked;
}

//Press this button to confine the Cursor within the screen
if (GUI.Button(new Rect(125, 0, 100, 50), "Confine Cursor"))
{
Cursor.lockState = CursorLockMode.Confined;
}
}
}

Properties

None

Cursor behavior is unmodi ed.

Locked

Lock cursor to the center of the game window.

Con ned

Con ne cursor to the game window.

Leave feedback

Description
Determines whether the mouse cursor is rendered using software rendering or, on supported platforms,
hardware rendering.
See Cursor for supported platforms.

Properties
Auto

Use hardware cursors on supported platforms.

ForceSoftware

Force the use of software cursors.

Leave feedback

Description
Specify the source of a Custom Render Texture initialization.
See Also: CustomRenderTexture.

Properties
TextureAndColor

Custom Render Texture is initialized by a Texture multiplied by a Color.

Material

Custom Render Texture is initalized with a Material.

Leave feedback

Description
Frequency of update or initialization of a Custom Render Texture.
See Also: CustomRenderTexture.

Properties
OnLoad

Initialization/Update will occur once at load time and then can be triggered again by script.

Realtime

Initialization/Update will occur at every frame.

OnDemand

Initialization/Update will only occur when triggered by the script.

Leave feedback

Description
Space in which coordinates are provided for Update Zones.
See Also: CustomRenderTexture.

Properties
Normalized

Coordinates are normalized. (0, 0) is top left and (1, 1) is bottom right.

Pixel

Coordinates are expressed in pixels. (0, 0) is top left (width, height) is bottom right.

Leave feedback

Description
Depth texture generation mode for Camera.
The ags can be combined, so you can set a Camera to generate any combination of: Depth, Depth+Normals, and
MotionVector textures if needed.
See Also: Using camera's depth textures, Camera.depthTextureMode.

Properties
None

Do not generate depth texture (Default).

Depth

Generate a depth texture.

DepthNormals

Generate a depth + normals texture.

MotionVectors

Speci es whether motion vectors should be rendered (if possible).

Leave feedback

Description
Render mode for detail prototypes.

Properties
GrassBillboard

The detail prototype will be rendered as billboards that are always facing the camera.

VertexLit

Will show the prototype using di use shading.

Grass

The detail prototype will use the grass shader.

Leave feedback

Description
Describes physical orientation of the device as determined by the OS.
If device is physically situated between discrete positions, as when (for example) rotated diagonally, system will
report Unknown orientation.

Properties
Unknown

The orientation of the device cannot be determined.

Portrait

The device is in portrait mode, with the device held upright and the home button at the
bottom.

PortraitUpsideDown

The device is in portrait mode but upside down, with the device held upright and the
home button at the top.

LandscapeLeft

The device is in landscape mode, with the device held upright and the home button on
the right side.

LandscapeRight

The device is in landscape mode, with the device held upright and the home button on
the left side.

FaceUp

The device is held parallel to the ground with the screen facing upwards.

FaceDown

The device is held parallel to the ground with the screen facing downwards.

Leave feedback

Description
Enumeration for SystemInfo.deviceType, denotes a coarse grouping of kinds of devices.
Universal Windows Platform: tablets are treated as desktop machines, thus DeviceType.Handheld will only be
returned for Windows Phones and IoT family devices.

//Attach this script to a GameObject
//This script checks what device type the Application is running on and outputs

using UnityEngine;

public class DeviceTypeExample : MonoBehaviour
{
//This is the Text for the Label at the top of the screen
string m_DeviceType;

void Update()
{
//Output the device type to the console window
Debug.Log("Device type : " + m_DeviceType);

//Check if the device running this is a console
if (SystemInfo.deviceType == DeviceType.Console)
{
//Change the text of the label
m_DeviceType = "Console";
}

//Check if the device running this is a desktop
if (SystemInfo.deviceType == DeviceType.Desktop)
{
m_DeviceType = "Desktop";
}

//Check if the device running this is a handheld
if (SystemInfo.deviceType == DeviceType.Handheld)

{
m_DeviceType = "Handheld";
}

//Check if the device running this is unknown
if (SystemInfo.deviceType == DeviceType.Unknown)
{
m_DeviceType = "Unknown";
}
}
}

Properties
Unknown

Device type is unknown. You should never see this in practice.

Handheld

A handheld device like mobile phone or a tablet.

Console

A stationary gaming console.

Desktop

Desktop or laptop computer.

Leave feedback

Description
An enumeration of transform properties that can be driven on a RectTransform by an object.
See Also: RectTransform.reapplyDrivenProperties.

Properties
None

Deselects all driven properties.

All

Selects all driven properties.

AnchoredPositionX

Selects driven property RectTransform.anchoredPosition.x.

AnchoredPositionY

Selects driven property RectTransform.anchoredPosition.y.

AnchoredPositionZ

Selects driven property RectTransform.anchoredPosition3D.z.

Rotation

Selects driven property Transform.localRotation.

ScaleX

Selects driven property Transform.localScale.x.

ScaleY

Selects driven property Transform.localScale.y.

ScaleZ

Selects driven property Transform.localScale.z.

AnchorMinX

Selects driven property RectTransform.anchorMin.x.

AnchorMinY

Selects driven property RectTransform.anchorMin.y.

AnchorMaxX

Selects driven property RectTransform.anchorMax.x.

AnchorMaxY

Selects driven property RectTransform.anchorMax.y.

SizeDeltaX

Selects driven property RectTransform.sizeDelta.x.

SizeDeltaY

Selects driven property RectTransform.sizeDelta.y.

PivotX

Selects driven property RectTransform.pivot.x.

PivotY

Selects driven property RectTransform.pivot.y.

AnchoredPosition

Selects driven property RectTransform.anchoredPosition.

AnchoredPosition3D

Selects driven property RectTransform.anchoredPosition3D.

Scale

Selects driven property combining ScaleX, ScaleY && ScaleZ.

AnchorMin

Selects driven property combining AnchorMinX and AnchorMinY.

AnchorMax

Selects driven property combining AnchorMaxX and AnchorMaxY.

Anchors

Selects driven property combining AnchorMinX, AnchorMinY, AnchorMaxX and
AnchorMaxY.

SizeDelta

Selects driven property combining SizeDeltaX and SizeDeltaY.

Pivot

Selects driven property combining PivotX and PivotY.

Leave feedback

Description
Describe the unit of a duration.

Properties
Fixed

A xed duration is a duration expressed in seconds.

Normalized

A normalized duration is a duration expressed in percentage.

Leave feedback

Description
The mode used to apply E ector2D forces.

Properties
Constant

The force is applied at a constant rate.

InverseLinear

The force is applied inverse-linear relative to a point.

InverseSquared

The force is applied inverse-squared relative to a point.

Leave feedback

Description
Selects the source and/or target to be used by an E ector2D.

Properties
Rigidbody

The source/target is de ned by the Rigidbody2D.

Collider

The source/target is de ned by the Collider2D.

Leave feedback

Description
Types of modi er key that can be active during a keystroke event.
See Also: Event, GUI Scripting Guide.

Properties
None

No modi er key pressed during a keystroke event.

Shift

Shift key.

Control

Control key.

Alt

Alt key.

Command

Command key (Mac).

Numeric

Num lock key.

CapsLock

Caps lock key.

FunctionKey

Function key.

Leave feedback

Description
Types of UnityGUI input and processing events.
Use this to tell which type of event has taken place in the GUI. Types of Events include mouse clicking, mouse
dragging, button pressing, the mouse entering or exiting the window, and the scroll wheel as well as others
mentioned below.
See Also: Event.type, Event, GUI Scripting Guide.

//Attach this script to a GameObject
//This script is a basic overview of some of the Event Types available. It outpu

using UnityEngine;

public class Example : MonoBehaviour
{
void OnGUI()
{
Event m_Event = Event.current;

if (m_Event.type == EventType.MouseDown)
{
Debug.Log("Mouse Down.");
}

if (m_Event.type == EventType.MouseDrag)
{
Debug.Log("Mouse Dragged.");
}

if (m_Event.type == EventType.MouseUp)
{
Debug.Log("Mouse Up.");
}
}
}

Properties
MouseDown

Mouse button was pressed.

MouseUp

Mouse button was released.

MouseMove

Mouse was moved (Editor views only).

MouseDrag

Mouse was dragged.

KeyDown

A keyboard key was pressed.

KeyUp

A keyboard key was released.

ScrollWheel

The scroll wheel was moved.

Repaint

A repaint event. One is sent every frame.

Layout

A layout event.

DragUpdated

Editor only: drag & drop operation updated.

DragPerform

Editor only: drag & drop operation performed.

DragExited

Editor only: drag & drop operation exited.

Ignore

Event should be ignored.

Used

Already processed event.

ValidateCommand

Validates a special command (e.g. copy & paste).

ExecuteCommand

Execute a special command (eg. copy & paste).

ContextClick

User has right-clicked (or control-clicked on the mac).

MouseEnterWindow

Mouse entered a window (Editor views only).

MouseLeaveWindow

Mouse left a window (Editor views only).

Leave feedback

Description
Spectrum analysis windowing types.
Use this to reduce leakage of signals across frequency bands.

Properties
Rectangular

W[n] = 1.0.

Triangle

W[n] = TRI(2n/N).

Hamming

W[n] = 0.54 - (0.46 * COS(n/N) ).

Hanning

W[n] = 0.5 * (1.0 - COS(n/N) ).

Blackman

W[n] = 0.42 - (0.5 * COS(n/N) ) + (0.08 * COS(2.0 * n/N) ).

BlackmanHarris

W[n] = 0.35875 - (0.48829 * COS(1.0 * n/N)) + (0.14128 * COS(2.0 * n/N)) - (0.01168 *
COS(3.0 * n/N)).

Leave feedback

Description
Filtering mode for textures. Corresponds to the settings in a texture inspector.
See Also: Texture. lterMode, texture assets.

//This script changes the filter mode of your Texture you attach when you press
//Attach this script to a GameObject
//Click on the GameObject and attach a Texture to the My Texture field in the In
//Apply the Texture to GameObjects (click and drag the Texture onto a GameObject

using UnityEngine;

public class Example : MonoBehaviour
{
//Remember to assign a Texture in the Inspector window to ensure this works
public Texture m_MyTexture;

void Update()
{
//Press the space key to switch between Filter Modes
if (Input.GetKeyDown(KeyCode.Space))
{
//Switch the Texture's Filter Mode
m_MyTexture.filterMode = SwitchFilterModes();
//Output the current Filter Mode to the console
Debug.Log("Filter mode : " + m_MyTexture.filterMode);
}
}

//Switch between Filter Modes when the user clicks the Button
FilterMode SwitchFilterModes()
{
//Switch the Filter Mode of the Texture when user clicks the Button
switch (m_MyTexture.filterMode)
{
//If the FilterMode is currently Bilinear, switch it to Point on the
case FilterMode.Bilinear:
m_MyTexture.filterMode = FilterMode.Point;

break;

//If the FilterMode is currently Point, switch it to Trilinear on th
case FilterMode.Point:
m_MyTexture.filterMode = FilterMode.Trilinear;
break;

//If the FilterMode is currently Trilinear, switch it to Bilinear on
case FilterMode.Trilinear:
m_MyTexture.filterMode = FilterMode.Bilinear;
break;
}
//Return the new Texture FilterMode
return m_MyTexture.filterMode;
}
}

Properties
Point

Point ltering - texture pixels become blocky up close.

Bilinear

Bilinear ltering - texture samples are averaged.

Trilinear

Trilinear ltering - texture samples are averaged and also blended between mipmap
levels.

Leave feedback

Description
Enumeration of all the muscles in a nger.
These muscles are a sub-part of a human part.
See Also: HumanPartDof.

Properties
ProximalDownUp

The proximal down-up muscle.

ProximalInOut

The proximal in-out muscle.

IntermediateCloseOpen

The intermediate close-open muscle.

DistalCloseOpen

The distal close-open muscle.

LastFingerDof

The last value of the FingerDof enum.

Leave feedback

Description
Used by GUIUtility.GetControlID to inform the IMGUI system if a given control can get keyboard focus. This allows
the IMGUI system to give focus appropriately when a user presses tab for cycling between controls.

Properties
Keyboard

This control can receive keyboard focus.

Passive

This control can not receive keyboard focus.

Leave feedback

Description
Fog mode to use.
See Also: RenderSettings.fogMode, Lighting Window.

Properties
Linear

Linear fog.

Exponential

Exponential fog.

ExponentialSquared

Exponential squared fog (default).

Leave feedback

Description
Font Style applied to GUI Texts, Text Meshes or GUIStyles.

Properties
Normal

No special style is applied.

Bold

Bold style applied to your texts.

Italic

Italic style applied to your texts.

BoldAndItalic

Bold and Italic styles applied to your texts.

Leave feedback

Description
Use ForceMode to specify how to apply a force using Rigidbody.AddForce.
The AddForce function impacts how your GameObject moves by allowing you to de ne your own force vector, as
well as choosing how to apply this force to the GameObject (this GameObject must have a Rigidbody component
attached).
ForceMode allows you to choose from four di erent ways to a ect the GameObject using this Force: Acceleration,
Force, Impulse, and VelocityChange.

using UnityEngine;

public class ForceModeExample : MonoBehaviour
{
//Use to switch between Force Modes
enum ModeSwitching { Start, Impulse, Acceleration, Force, VelocityChange };
ModeSwitching m_ModeSwitching;

Vector3 m_StartPos, m_StartForce;
Vector3 m_NewForce;
Rigidbody m_Rigidbody;

string m_ForceXString = string.Empty;
string m_ForceYString = string.Empty;

float m_ForceX, m_ForceY;
float m_Result;

void Start()
{
//You get the Rigidbody component you attach to the GameObject
m_Rigidbody = GetComponent();

//This starts at first mode (nothing happening yet)
m_ModeSwitching = ModeSwitching.Start;

//Initialising the force which is used on GameObject in various ways
m_NewForce = new Vector3(-5.0f, 1.0f, 0.0f);

//Initialising floats
m_ForceX = 0;
m_ForceY = 0;

//The forces typed in from the text fields (the ones you can manipulate
m_ForceXString = "0";
m_ForceYString = "0";

//The GameObject's starting position and Rigidbody position
m_StartPos = transform.position;
m_StartForce = m_Rigidbody.transform.position;
}

void FixedUpdate()
{
//If the current mode is not the starting mode (or the GameObject is not
if (m_ModeSwitching != ModeSwitching.Start)
{
//The force changes depending what you input into the text fields
m_NewForce = new Vector3(m_ForceX, m_ForceY, 0);
}

//Here, switching modes depend on button presses in the Game mode
switch (m_ModeSwitching)
{
//This is the starting mode which resets the GameObject
case ModeSwitching.Start:
//This resets the GameObject and Rigidbody to their starting pos
transform.position = m_StartPos;
m_Rigidbody.transform.position = m_StartForce;

//This resets the velocity of the Rigidbody
m_Rigidbody.velocity = new Vector3(0f, 0f, 0f);
break;

//These are the modes ForceMode can force on a Rigidbody
//This is Acceleration mode
case ModeSwitching.Acceleration:
//The function converts the text fields into floats and updates
MakeCustomForce();

//Use Acceleration as the force on the Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.Acceleration);
break;

//This is Force Mode, using a continuous force on the Rigidbody cons
case ModeSwitching.Force:
//Converts the text fields into floats and updates the force app
MakeCustomForce();

//Use Force as the force on GameObject’s Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.Force);
break;

//This is Impulse Mode, which involves using the Rigidbody’s mass to
case ModeSwitching.Impulse:
//The function converts the text fields into floats and updates
MakeCustomForce();

//Use Impulse as the force on GameObject
m_Rigidbody.AddForce(m_NewForce, ForceMode.Impulse);
break;

//This is VelocityChange which involves ignoring the mass of the Gam
case ModeSwitching.VelocityChange:
//Converts the text fields into floats and updates the force app
MakeCustomForce();

//Make a Velocity change on the Rigidbody
m_Rigidbody.AddForce(m_NewForce, ForceMode.VelocityChange);
break;
}
}

//The function outputs buttons, text fields, and other interactable UI eleme
void OnGUI()
{
//Getting the inputs from each text field and storing them as strings
m_ForceXString = GUI.TextField(new Rect(300, 10, 200, 20), m_ForceXStrin
m_ForceYString = GUI.TextField(new Rect(300, 30, 200, 20), m_ForceYStrin

//Press the button to reset the GameObject and Rigidbody
if (GUI.Button(new Rect(100, 0, 150, 30), "Reset"))
{
//This switches to the start/reset case
m_ModeSwitching = ModeSwitching.Start;
}

//When you press the Acceleration button, switch to Acceleration mode
if (GUI.Button(new Rect(100, 30, 150, 30), "Apply Acceleration"))
{
//Switch to Acceleration (apply acceleration force to GameObject)
m_ModeSwitching = ModeSwitching.Acceleration;
}

//If you press the Impulse button
if (GUI.Button(new Rect(100, 60, 150, 30), "Apply Impulse"))
{
//Switch to impulse (apply impulse forces to GameObject)
m_ModeSwitching = ModeSwitching.Impulse;
}

//If you press the Force Button, switch to Force state
if (GUI.Button(new Rect(100, 90, 150, 30), "Apply Force"))
{
//Switch to Force (apply force to GameObject)
m_ModeSwitching = ModeSwitching.Force;
}

//Press the button to switch to VelocityChange state
if (GUI.Button(new Rect(100, 120, 150, 30), "Apply Velocity Change"))
{
//Switch to velocity changing
m_ModeSwitching = ModeSwitching.VelocityChange;

}
}

//Changing strings to floats for the forces
float ConvertToFloat(string Name)
{
float.TryParse(Name, out m_Result);
return m_Result;
}

//Set the converted float from the text fields as the forces to apply to the
void MakeCustomForce()
{
//This converts the strings to floats
m_ForceX = ConvertToFloat(m_ForceXString);
m_ForceY = ConvertToFloat(m_ForceYString);
}
}

Properties
Force

Add a continuous force to the rigidbody, using its mass.

Acceleration

Add a continuous acceleration to the rigidbody, ignoring its mass.

Impulse

Add an instant force impulse to the rigidbody, using its mass.

VelocityChange

Add an instant velocity change to the rigidbody, ignoring its mass.

Leave feedback

Description
Option for how to apply a force using Rigidbody2D.AddForce.
Use this to apply a certain type of force to a 2D RigidBody. There are two types of forces to apply: Force mode and
Impulse Mode. For a 3D Rigidbody see ForceMode.

//This script adds force to a Rigidbody. The kind of force is determined by whic

//Create a Sprite and attach a Rigidbody2D component to it
//Attach this script to the Sprite

using UnityEngine;
using UnityEngine.EventSystems;

public class AddingForce : MonoBehaviour
{
//Use to switch between Force Modes
enum ModeSwitching { Start, Impulse, Force };
ModeSwitching m_ModeSwitching;

//Use this to change the different kinds of force
ForceMode2D m_ForceMode;
//Start position of the RigidBody, use to reset
Vector2 m_StartPosition;

//Use to apply force to RigidBody
Vector2 m_NewForce;

//Use to manipulate the RigidBody of a GameObject
Rigidbody2D m_Rigidbody;

void Start()
{
//Fetch the RigidBody component attached to the GameObject

m_Rigidbody = GetComponent();
//Start at first mode (nothing happening yet)
m_ModeSwitching = ModeSwitching.Start;

//Initialising the force to use on the RigidBody in various ways
m_NewForce = new Vector2(-5.0f, 1.0f);

//This is the RigidBody's starting position
m_StartPosition = m_Rigidbody.transform.position;
}

void Update()
{
//Switching modes depending on button presses
switch (m_ModeSwitching)
{
//This is the starting mode which resets the GameObject
case ModeSwitching.Start:

//Reset to starting position of RigidBody
m_Rigidbody.transform.position = m_StartPosition;
//Reset the velocity of the RigidBody
m_Rigidbody.velocity = new Vector2(0f, 0f);
break;

//This is the Force Mode
case ModeSwitching.Force:
//Make the GameObject travel upwards
m_NewForce = new Vector2(0, 1.0f);
//Use Force mode as force on the RigidBody
m_Rigidbody.AddForce(m_NewForce, ForceMode2D.Force);
break;

//This is the Impulse Mode
case ModeSwitching.Impulse:
//Make the GameObject travel upwards
m_NewForce = new Vector2(0f, 1.0f);
//Use Impulse mode as a force on the RigidBody
m_Rigidbody.AddForce(m_NewForce, ForceMode2D.Impulse);
break;

}
}

//These are the Buttons for telling what Force to apply as well as resetting
void OnGUI()
{
//If reset button pressed
if (GUI.Button(new Rect(100, 0, 150, 30), "Reset"))
{
//Switch to start/reset case

m_ModeSwitching = ModeSwitching.Start;
}

//Impulse button pressed
if (GUI.Button(new Rect(100, 60, 150, 30), "Apply Impulse"))
{
//Switch to Impulse mode (apply impulse forces to GameObject)

m_ModeSwitching = ModeSwitching.Impulse;
}

//Force Button Pressed
if (GUI.Button(new Rect(100, 90, 150, 30), "Apply Force"))
{
//Switch to Force mode (apply force to GameObject)
m_ModeSwitching = ModeSwitching.Force;
}
}
}

Properties
Force

Add a force to the Rigidbody2D, using its mass.

Impulse

Add an instant force impulse to the rigidbody2D, using its mass.

Leave feedback

Description
Platform agnostic fullscreen mode. Not all platforms support all modes.
This de nes how full screen modes are handled on all platforms.

Properties
ExclusiveFullScreen

Exclusive Mode.

FullScreenWindow

Fullscreen window.

MaximizedWindow

Maximized window.

Windowed

Windowed.

Leave feedback

Description
Describes options for displaying movie playback controls.
Windows Store Apps: OS doesn't provide a Stop button control because of this Unity will stop a video if Escape
or Back Button is pressed if video is launched with FullScreenMovieControlMode.Full or
FullScreenMovieControlMode.Minimal parameters.

Properties
Full

Display the standard controls for controlling movie playback.

Minimal

Display minimal set of controls controlling movie playback.

CancelOnInput

Do not display any controls, but cancel movie playback if input occurs.

Hidden

Do not display any controls.

Leave feedback

Description
Describes scaling modes for displaying movies.

Properties
None

Do not scale the movie.

AspectFit

Scale the movie until one dimension ts on the screen exactly.

AspectFill

Scale the movie until the movie lls the entire screen.

Fill

Scale the movie until both dimensions t the screen exactly.

Leave feedback

Description
Select how gradients will be evaluated.

Properties
Blend

Find the 2 keys adjacent to the requested evaluation time, and linearly interpolate
between them to obtain a blended color.

Fixed

Return a xed color, by nding the rst key whose time value is greater than the
requested evaluation time.

Leave feedback

Description
Enumeration of all the muscles in the head.
These muscles are a sub-part of a human part.
See Also: HumanPartDof.

Properties
NeckFrontBack

The neck front-back muscle.

NeckLeftRight

The neck left-right muscle.

NeckRollLeftRight

The neck roll left-right muscle.

HeadFrontBack

The head front-back muscle.

HeadLeftRight

The head left-right muscle.

HeadRollLeftRight

The head roll left-right muscle.

LeftEyeDownUp

The left eye down-up muscle.

LeftEyeInOut

The left eye in-out muscle.

RightEyeDownUp

The right eye down-up muscle.

RightEyeInOut

The right eye in-out muscle.

JawDownUp

The jaw down-up muscle.

JawLeftRight

The jaw left-right muscle.

LastHeadDof

The last value of the HeadDof enum.

Leave feedback

Description
Bit mask that controls object destruction, saving and visibility in inspectors.
See Also: HideFlags.HideAndDontSave, SA.Object.hideFlags.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
// Creates a material that is explicitly created & destroyed by the componen
// Resources.UnloadUnusedAssets will not unload it, and it will not be edita
private Material ownedMaterial;
void OnEnable()
{
ownedMaterial = new Material(Shader.Find("Diffuse"));
ownedMaterial.hideFlags = HideFlags.HideAndDontSave;
GetComponent().sharedMaterial = ownedMaterial;
}

// Objects created as hide and don't save must be explicitly destroyed by th
void OnDisable()
{
DestroyImmediate(ownedMaterial);
}
}

Properties
None

A normal, visible object. This is the default.

HideInHierarchy

The object will not appear in the hierarchy.

HideInInspector

It is not possible to view it in the inspector.

DontSaveInEditor

The object will not be saved to the Scene in the editor.

NotEditable

The object is not be editable in the inspector.

DontSaveInBuild

The object will not be saved when building a player.

DontUnloadUnusedAsset

The object will not be unloaded by Resources.UnloadUnusedAssets.

DontSave

The object will not be saved to the Scene. It will not be destroyed when a new
Scene is loaded. It is a shortcut for HideFlags.DontSaveInBuild |
HideFlags.DontSaveInEditor | HideFlags.DontUnloadUnusedAsset.

HideAndDontSave

The GameObject is not shown in the Hierarchy, not saved to to Scenes, and not
unloaded by Resources.UnloadUnusedAssets.

Leave feedback

Description
Wrapping modes for text that reaches the horizontal boundary.

Properties
Wrap

Text will word-wrap when reaching the horizontal boundary.

Over ow

Text can exceed the horizontal boundary.

Leave feedback

Description
Human Body Bones.
See Also: Animator.GetBoneTransform.

Properties
Hips

This is the Hips bone.

LeftUpperLeg

This is the Left Upper Leg bone.

RightUpperLeg

This is the Right Upper Leg bone.

LeftLowerLeg

This is the Left Knee bone.

RightLowerLeg

This is the Right Knee bone.

LeftFoot

This is the Left Ankle bone.

RightFoot

This is the Right Ankle bone.

Spine

This is the rst Spine bone.

Chest

This is the Chest bone.

UpperChest

This is the Upper Chest bone.

Neck

This is the Neck bone.

Head

This is the Head bone.

LeftShoulder

This is the Left Shoulder bone.

RightShoulder

This is the Right Shoulder bone.

LeftUpperArm

This is the Left Upper Arm bone.

RightUpperArm

This is the Right Upper Arm bone.

LeftLowerArm

This is the Left Elbow bone.

RightLowerArm

This is the Right Elbow bone.

LeftHand

This is the Left Wrist bone.

RightHand

This is the Right Wrist bone.

LeftToes

This is the Left Toes bone.

RightToes

This is the Right Toes bone.

LeftEye

This is the Left Eye bone.

RightEye

This is the Right Eye bone.

Jaw

This is the Jaw bone.

LeftThumbProximal

This is the left thumb 1st phalange.

LeftThumbIntermediate

This is the left thumb 2nd phalange.

LeftThumbDistal

This is the left thumb 3rd phalange.

LeftIndexProximal

This is the left index 1st phalange.

LeftIndexIntermediate

This is the left index 2nd phalange.

LeftIndexDistal

This is the left index 3rd phalange.

LeftMiddleProximal

This is the left middle 1st phalange.

LeftMiddleIntermediate

This is the left middle 2nd phalange.

LeftMiddleDistal

This is the left middle 3rd phalange.

LeftRingProximal

This is the left ring 1st phalange.

LeftRingIntermediate

This is the left ring 2nd phalange.

LeftRingDistal

This is the left ring 3rd phalange.

LeftLittleProximal

This is the left little 1st phalange.

LeftLittleIntermediate

This is the left little 2nd phalange.

LeftLittleDistal

This is the left little 3rd phalange.

RightThumbProximal

This is the right thumb 1st phalange.

RightThumbIntermediate

This is the right thumb 2nd phalange.

RightThumbDistal

This is the right thumb 3rd phalange.

RightIndexProximal

This is the right index 1st phalange.

RightIndexIntermediate

This is the right index 2nd phalange.

RightIndexDistal

This is the right index 3rd phalange.

RightMiddleProximal

This is the right middle 1st phalange.

RightMiddleIntermediate

This is the right middle 2nd phalange.

RightMiddleDistal

This is the right middle 3rd phalange.

RightRingProximal

This is the right ring 1st phalange.

RightRingIntermediate

This is the right ring 2nd phalange.

RightRingDistal

This is the right ring 3rd phalange.

RightLittleProximal

This is the right little 1st phalange.

RightLittleIntermediate

This is the right little 2nd phalange.

RightLittleDistal

This is the right little 3rd phalange.

LastBone

This is the Last bone index delimiter.

Leave feedback

Description
Enumeration of all the parts in a human.
A human part is a region de ning a set of muscles in a human, to get a speci c muscle, it has to be used with
another DoF enumerations.
See Also: BodyDof, HeadDof, LegDof, ArmDof, and FingerDof.

Properties
Body

The human body part.

Head

The human head part.

LeftLeg

The human left leg part.

RightLeg

The human right leg part.

LeftArm

The human left arm part.

RightArm

The human right arm part.

LeftThumb

The human left thumb nger part.

LeftIndex

The human left index nger part.

LeftMiddle

The human left middle nger part.

LeftRing

The human left ring nger part.

LeftLittle

The human left little nger part.

RightThumb

The human right thumb nger part.

RightIndex

The human right index nger part.

RightMiddle

The human right middle nger part.

RightRing

The human right ring nger part.

RightLittle

The human right little nger part.

Leave feedback

Description
How image and text is placed inside GUIStyle.

Properties
ImageLeft

Image is to the left of the text.

ImageAbove

Image is above the text.

ImageOnly

Only the image is displayed.

TextOnly

Only the text is displayed.

Leave feedback

Description
Controls IME input.

Properties
Auto

Enable IME input only when a text eld is selected (default).

On

Enable IME input.

O

Disable IME input.

Leave feedback
Obsolete

Description
The Con gurableJoint attempts to attain position / velocity targets based on this ag.

Leave feedback

Description
Represents the state of a joint limit.
See Also: DistanceJoint2D, HingeJoint2D, SliderJoint2D.

Properties
Inactive

Represents a state where the joint limit is inactive.

LowerLimit

Represents a state where the joint limit is at the speci ed lower limit.

UpperLimit

Represents a state where the joint limit is at the speci ed upper limit.

EqualLimits

Represents a state where the joint limit is at the speci ed lower and upper limits (they are
identical).

Leave feedback

Description
Determines how to snap physics joints back to its constrained position when it drifts o too much.
See Also: Con gurableJoint.

Properties
None

Don't snap at all.

PositionAndRotation

Snap both position and rotation.

Leave feedback

Description
Key codes returned by Event.keyCode. These map directly to a physical key on the keyboard.
Key codes can be used to detect key down and key up events, using Input.GetKeyDown and Input.GetKeyUp:

using UnityEngine;

public class KeyCodeExample : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
Debug.Log("Space key was pressed.");
}

if (Input.GetKeyUp(KeyCode.Space))
{
Debug.Log("Space key was released.");
}
}
}

Keyboard events can also be captured within OnGUI:

using UnityEngine;

public class KeyCodeOnGUIExample : MonoBehaviour
{
void OnGUI()
{
if (Event.current.Equals(Event.KeyboardEvent(KeyCode.Space.ToString())))
{
Debug.Log("Space key is pressed.");
}
}
}

The Input pages provide details about accessing keyboard, mouse and joystick input.

Properties
None

Not assigned (never returned as the result of a keystroke).

Backspace

The backspace key.

Delete

The forward delete key.

Tab

The tab key.

Clear

The Clear key.

Return

Return key.

Pause

Pause on PC machines.

Escape

Escape key.

Space

Space key.

Keypad0

Numeric keypad 0.

Keypad1

Numeric keypad 1.

Keypad2

Numeric keypad 2.

Keypad3

Numeric keypad 3.

Keypad4

Numeric keypad 4.

Keypad5

Numeric keypad 5.

Keypad6

Numeric keypad 6.

Keypad7

Numeric keypad 7.

Keypad8

Numeric keypad 8.

Keypad9

Numeric keypad 9.

KeypadPeriod

Numeric keypad '.'.

KeypadDivide

Numeric keypad '/'.

KeypadMultiply

Numeric keypad '*'.

KeypadMinus

Numeric keypad '-'.

KeypadPlus

Numeric keypad '+'.

KeypadEnter

Numeric keypad enter.

KeypadEquals

Numeric keypad '='.

UpArrow

Up arrow key.

DownArrow

Down arrow key.

RightArrow

Right arrow key.

LeftArrow

Left arrow key.

Insert

Insert key key.

Home

Home key.

End

End key.

PageUp

Page up.

PageDown

Page down.

F1

F1 function key.

F2

F2 function key.

F3

F3 function key.

F4

F4 function key.

F5

F5 function key.

F6

F6 function key.

F7

F7 function key.

F8

F8 function key.

F9

F9 function key.

F10

F10 function key.

F11

F11 function key.

F12

F12 function key.

F13

F13 function key.

F14

F14 function key.

F15

F15 function key.

Alpha0

The '0' key on the top of the alphanumeric keyboard.

Alpha1

The '1' key on the top of the alphanumeric keyboard.

Alpha2

The '2' key on the top of the alphanumeric keyboard.

Alpha3

The '3' key on the top of the alphanumeric keyboard.

Alpha4

The '4' key on the top of the alphanumeric keyboard.

Alpha5

The '5' key on the top of the alphanumeric keyboard.

Alpha6

The '6' key on the top of the alphanumeric keyboard.

Alpha7

The '7' key on the top of the alphanumeric keyboard.

Alpha8

The '8' key on the top of the alphanumeric keyboard.

Alpha9

The '9' key on the top of the alphanumeric keyboard.

Exclaim

Exclamation mark key '!'.

DoubleQuote

Double quote key '"'.

Hash

Hash key '#'.

Dollar

Dollar sign key '$'.

Percent

Percent '%' key.

Ampersand

Ampersand key '&'.

Quote

Quote key '.

LeftParen

Left Parenthesis key '('.

RightParen

Right Parenthesis key ')'.

Asterisk

Asterisk key '*'.

Plus

Plus key '+'.

Comma

Comma ',' key.

Minus

Minus '-' key.

Period

Period '.' key.

Slash

Slash '/' key.

Colon

Colon ':' key.

Semicolon

Semicolon ';' key.

Less

Less than '<' key.

Equals

Equals '=' key.

Greater

Greater than '>' key.

Question

Question mark '?' key.

At

At key '@'.

LeftBracket

Left square bracket key '['.

Backslash

Backslash key '\'.

RightBracket

Right square bracket key ']'.

Caret

Caret key '^'.

Underscore

Underscore '_' key.

BackQuote

Back quote key '`'.

A

'a' key.

B

'b' key.

C

'c' key.

D

'd' key.

E

'e' key.

F

'f' key.

G

'g' key.

H

'h' key.

I

'i' key.

J

'j' key.

K

'k' key.

L

'l' key.

M

'm' key.

N

'n' key.

O

'o' key.

P

'p' key.

Q

'q' key.

R

'r' key.

S

's' key.

T

't' key.

U

'u' key.

V

'v' key.

W

'w' key.

X

'x' key.

Y

'y' key.

Z

'z' key.

LeftCurlyBracket

Left curly bracket key '{'.

Pipe

Pipe '|' key.

RightCurlyBracket

Right curly bracket key '}'.

Tilde

Tilde '~' key.

Numlock

Numlock key.

CapsLock

Capslock key.

ScrollLock

Scroll lock key.

RightShift

Right shift key.

LeftShift

Left shift key.

RightControl

Right Control key.

LeftControl

Left Control key.

RightAlt

Right Alt key.

LeftAlt

Left Alt key.

LeftCommand

Left Command key.

LeftApple

Left Command key.

LeftWindows

Left Windows key.

RightCommand

Right Command key.

RightApple

Right Command key.

RightWindows

Right Windows key.

AltGr

Alt Gr key.

Help

Help key.

Print

Print key.

SysReq

Sys Req key.

Break

Break key.

Menu

Menu key.

Mouse0

The Left (or primary) mouse button.

Mouse1

Right mouse button (or secondary mouse button).

Mouse2

Middle mouse button (or third button).

Mouse3

Additional (fourth) mouse button.

Mouse4

Additional ( fth) mouse button.

Mouse5

Additional (or sixth) mouse button.

Mouse6

Additional (or seventh) mouse button.

JoystickButton0

Button 0 on any joystick.

JoystickButton1

Button 1 on any joystick.

JoystickButton2

Button 2 on any joystick.

JoystickButton3

Button 3 on any joystick.

JoystickButton4

Button 4 on any joystick.

JoystickButton5

Button 5 on any joystick.

JoystickButton6

Button 6 on any joystick.

JoystickButton7

Button 7 on any joystick.

JoystickButton8

Button 8 on any joystick.

JoystickButton9

Button 9 on any joystick.

JoystickButton10

Button 10 on any joystick.

JoystickButton11

Button 11 on any joystick.

JoystickButton12

Button 12 on any joystick.

JoystickButton13

Button 13 on any joystick.

JoystickButton14

Button 14 on any joystick.

JoystickButton15

Button 15 on any joystick.

JoystickButton16

Button 16 on any joystick.

JoystickButton17

Button 17 on any joystick.

JoystickButton18

Button 18 on any joystick.

JoystickButton19

Button 19 on any joystick.

Joystick1Button0

Button 0 on rst joystick.

Joystick1Button1

Button 1 on rst joystick.

Joystick1Button2

Button 2 on rst joystick.

Joystick1Button3

Button 3 on rst joystick.

Joystick1Button4

Button 4 on rst joystick.

Joystick1Button5

Button 5 on rst joystick.

Joystick1Button6

Button 6 on rst joystick.

Joystick1Button7

Button 7 on rst joystick.

Joystick1Button8

Button 8 on rst joystick.

Joystick1Button9

Button 9 on rst joystick.

Joystick1Button10

Button 10 on rst joystick.

Joystick1Button11

Button 11 on rst joystick.

Joystick1Button12

Button 12 on rst joystick.

Joystick1Button13

Button 13 on rst joystick.

Joystick1Button14

Button 14 on rst joystick.

Joystick1Button15

Button 15 on rst joystick.

Joystick1Button16

Button 16 on rst joystick.

Joystick1Button17

Button 17 on rst joystick.

Joystick1Button18

Button 18 on rst joystick.

Joystick1Button19

Button 19 on rst joystick.

Joystick2Button0

Button 0 on second joystick.

Joystick2Button1

Button 1 on second joystick.

Joystick2Button2

Button 2 on second joystick.

Joystick2Button3

Button 3 on second joystick.

Joystick2Button4

Button 4 on second joystick.

Joystick2Button5

Button 5 on second joystick.

Joystick2Button6

Button 6 on second joystick.

Joystick2Button7

Button 7 on second joystick.

Joystick2Button8

Button 8 on second joystick.

Joystick2Button9

Button 9 on second joystick.

Joystick2Button10

Button 10 on second joystick.

Joystick2Button11

Button 11 on second joystick.

Joystick2Button12

Button 12 on second joystick.

Joystick2Button13

Button 13 on second joystick.

Joystick2Button14

Button 14 on second joystick.

Joystick2Button15

Button 15 on second joystick.

Joystick2Button16

Button 16 on second joystick.

Joystick2Button17

Button 17 on second joystick.

Joystick2Button18

Button 18 on second joystick.

Joystick2Button19

Button 19 on second joystick.

Joystick3Button0

Button 0 on third joystick.

Joystick3Button1

Button 1 on third joystick.

Joystick3Button2

Button 2 on third joystick.

Joystick3Button3

Button 3 on third joystick.

Joystick3Button4

Button 4 on third joystick.

Joystick3Button5

Button 5 on third joystick.

Joystick3Button6

Button 6 on third joystick.

Joystick3Button7

Button 7 on third joystick.

Joystick3Button8

Button 8 on third joystick.

Joystick3Button9

Button 9 on third joystick.

Joystick3Button10

Button 10 on third joystick.

Joystick3Button11

Button 11 on third joystick.

Joystick3Button12

Button 12 on third joystick.

Joystick3Button13

Button 13 on third joystick.

Joystick3Button14

Button 14 on third joystick.

Joystick3Button15

Button 15 on third joystick.

Joystick3Button16

Button 16 on third joystick.

Joystick3Button17

Button 17 on third joystick.

Joystick3Button18

Button 18 on third joystick.

Joystick3Button19

Button 19 on third joystick.

Joystick4Button0

Button 0 on forth joystick.

Joystick4Button1

Button 1 on forth joystick.

Joystick4Button2

Button 2 on forth joystick.

Joystick4Button3

Button 3 on forth joystick.

Joystick4Button4

Button 4 on forth joystick.

Joystick4Button5

Button 5 on forth joystick.

Joystick4Button6

Button 6 on forth joystick.

Joystick4Button7

Button 7 on forth joystick.

Joystick4Button8

Button 8 on forth joystick.

Joystick4Button9

Button 9 on forth joystick.

Joystick4Button10

Button 10 on forth joystick.

Joystick4Button11

Button 11 on forth joystick.

Joystick4Button12

Button 12 on forth joystick.

Joystick4Button13

Button 13 on forth joystick.

Joystick4Button14

Button 14 on forth joystick.

Joystick4Button15

Button 15 on forth joystick.

Joystick4Button16

Button 16 on forth joystick.

Joystick4Button17

Button 17 on forth joystick.

Joystick4Button18

Button 18 on forth joystick.

Joystick4Button19

Button 19 on forth joystick.

Joystick5Button0

Button 0 on fth joystick.

Joystick5Button1

Button 1 on fth joystick.

Joystick5Button2

Button 2 on fth joystick.

Joystick5Button3

Button 3 on fth joystick.

Joystick5Button4

Button 4 on fth joystick.

Joystick5Button5

Button 5 on fth joystick.

Joystick5Button6

Button 6 on fth joystick.

Joystick5Button7

Button 7 on fth joystick.

Joystick5Button8

Button 8 on fth joystick.

Joystick5Button9

Button 9 on fth joystick.

Joystick5Button10

Button 10 on fth joystick.

Joystick5Button11

Button 11 on fth joystick.

Joystick5Button12

Button 12 on fth joystick.

Joystick5Button13

Button 13 on fth joystick.

Joystick5Button14

Button 14 on fth joystick.

Joystick5Button15

Button 15 on fth joystick.

Joystick5Button16

Button 16 on fth joystick.

Joystick5Button17

Button 17 on fth joystick.

Joystick5Button18

Button 18 on fth joystick.

Joystick5Button19

Button 19 on fth joystick.

Joystick6Button0

Button 0 on sixth joystick.

Joystick6Button1

Button 1 on sixth joystick.

Joystick6Button2

Button 2 on sixth joystick.

Joystick6Button3

Button 3 on sixth joystick.

Joystick6Button4

Button 4 on sixth joystick.

Joystick6Button5

Button 5 on sixth joystick.

Joystick6Button6

Button 6 on sixth joystick.

Joystick6Button7

Button 7 on sixth joystick.

Joystick6Button8

Button 8 on sixth joystick.

Joystick6Button9

Button 9 on sixth joystick.

Joystick6Button10

Button 10 on sixth joystick.

Joystick6Button11

Button 11 on sixth joystick.

Joystick6Button12

Button 12 on sixth joystick.

Joystick6Button13

Button 13 on sixth joystick.

Joystick6Button14

Button 14 on sixth joystick.

Joystick6Button15

Button 15 on sixth joystick.

Joystick6Button16

Button 16 on sixth joystick.

Joystick6Button17

Button 17 on sixth joystick.

Joystick6Button18

Button 18 on sixth joystick.

Joystick6Button19

Button 19 on sixth joystick.

Joystick7Button0

Button 0 on seventh joystick.

Joystick7Button1

Button 1 on seventh joystick.

Joystick7Button2

Button 2 on seventh joystick.

Joystick7Button3

Button 3 on seventh joystick.

Joystick7Button4

Button 4 on seventh joystick.

Joystick7Button5

Button 5 on seventh joystick.

Joystick7Button6

Button 6 on seventh joystick.

Joystick7Button7

Button 7 on seventh joystick.

Joystick7Button8

Button 8 on seventh joystick.

Joystick7Button9

Button 9 on seventh joystick.

Joystick7Button10

Button 10 on seventh joystick.

Joystick7Button11

Button 11 on seventh joystick.

Joystick7Button12

Button 12 on seventh joystick.

Joystick7Button13

Button 13 on seventh joystick.

Joystick7Button14

Button 14 on seventh joystick.

Joystick7Button15

Button 15 on seventh joystick.

Joystick7Button16

Button 16 on seventh joystick.

Joystick7Button17

Button 17 on seventh joystick.

Joystick7Button18

Button 18 on seventh joystick.

Joystick7Button19

Button 19 on seventh joystick.

Joystick8Button0

Button 0 on eighth joystick.

Joystick8Button1

Button 1 on eighth joystick.

Joystick8Button2

Button 2 on eighth joystick.

Joystick8Button3

Button 3 on eighth joystick.

Joystick8Button4

Button 4 on eighth joystick.

Joystick8Button5

Button 5 on eighth joystick.

Joystick8Button6

Button 6 on eighth joystick.

Joystick8Button7

Button 7 on eighth joystick.

Joystick8Button8

Button 8 on eighth joystick.

Joystick8Button9

Button 9 on eighth joystick.

Joystick8Button10

Button 10 on eighth joystick.

Joystick8Button11

Button 11 on eighth joystick.

Joystick8Button12

Button 12 on eighth joystick.

Joystick8Button13

Button 13 on eighth joystick.

Joystick8Button14

Button 14 on eighth joystick.

Joystick8Button15

Button 15 on eighth joystick.

Joystick8Button16

Button 16 on eighth joystick.

Joystick8Button17

Button 17 on eighth joystick.

Joystick8Button18

Button 18 on eighth joystick.

Joystick8Button19

Button 19 on eighth joystick.

Leave feedback

Description
Enumeration of all the muscles in a leg.
These muscles are a sub-part of a human part.
See Also: HumanPartDof.

Properties
UpperLegFrontBack

The upper leg front-back muscle.

UpperLegInOut

The upper leg in-out muscle.

UpperLegRollInOut

The upper leg roll in-out muscle.

LegCloseOpen

The leg close-open muscle.

LegRollInOut

The leg roll in-out muscle.

FootCloseOpen

The foot close-open muscle.

FootInOut

The foot in-out muscle.

ToesUpDown

The toes up-down muscle.

LastLegDof

The last value of the LegDof enum.

Leave feedback

Description
Enum describing what part of a light contribution can be baked.

Properties
Realtime

Realtime lights cast run time light and shadows. They can change position, orientation,
color, brightness, and many other properties at run time. No lighting gets baked into
lightmaps or light probes..

Baked

Baked lights cannot move or change in any way during run time. All lighting for static
objects gets baked into lightmaps. Lighting and shadows for dynamic objects gets baked
into Light Probes.

Mixed

Mixed lights allow a mix of realtime and baked lighting, based on the Mixed Lighting Mode
used. These lights cannot move, but can change color and intensity at run time. Changes
to color and intensity only a ect direct lighting as indirect lighting gets baked. If using
Subtractive mode, changes to color or intensity are not calculated at run time on static
objects.

Leave feedback

Description
Lightmap (and lighting) con guration mode, controls how lightmaps interact with lighting and what kind of
information they store.

Properties
NonDirectional

Light intensity (no directional information), encoded as 1 lightmap.

CombinedDirectional

Directional information for direct light is combined with directional information for
indirect light, encoded as 2 lightmaps.

Leave feedback

Description
Single, dual, or directional lightmaps rendering mode, used only in GIWork owMode.Legacy
See Also: LightmapSettings.lightmapsModeLegacy.

Properties
Single

Single, traditional lightmap rendering mode.

Dual

Dual lightmap rendering mode.

Directional

Directional rendering mode.

Leave feedback

Description
How the Light is rendered.
See Also: light component.

Properties
Auto

Automatically choose the render mode.

ForcePixel

Force the Light to be a pixel light.

ForceVertex

Force the Light to be a vertex light.

Leave feedback

Description
Allows mixed lights to control shadow caster culling when Shadowmasks are present.

Properties
Default

Use the global Shadowmask Mode from the quality settings.

NonLightmappedOnly

Render only non-lightmapped objects into the shadow map. This corresponds with
the Shadowmask mode.

Everything

Render all shadow casters into the shadow map. This corresponds with the distance
Shadowmask mode.

Leave feedback

Description
Shadow casting options for a Light.
See Also: light component.

Properties
None

Do not cast shadows (default).

Hard

Cast "hard" shadows (with no shadow ltering).

Soft

Cast "soft" shadows (with 4x PCF ltering).

Leave feedback

Description
The type of a Light.
See Also: Light.type, light component.

Properties
Spot

The light is a spot light.

Directional

The light is a directional light.

Point

The light is a point light.

Rectangle

The light is a rectangle shaped area light. It a ects only baked lightmaps and lightprobes.

Disc

The light is a disc shaped area light. It a ects only baked lightmaps and lightprobes.

Leave feedback

Description
Control the direction lines face, when using the LineRenderer or TrailRenderer.

Properties
View

Lines face the camera.

TransformZ

Lines face the Z axis of the Transform Component.

Leave feedback

Description
Choose how textures are applied to Lines and Trails.

Properties
Stretch

Map the texture once along the entire length of the line.

Tile

Repeat the texture along the line, based on its length in world units. To set the tiling
rate, use Material.SetTextureScale.

DistributePerSegment

Map the texture once along the entire length of the line, assuming all vertices are
evenly spaced.

RepeatPerSegment

Repeat the texture along the line, repeating at a rate of once per line segment. To
adjust the tiling rate, use Material.SetTextureScale.

Leave feedback

Description
Describes location service status.

Properties
Stopped

Location service is stopped.

Initializing

Location service is initializing, some time later it will switch to.

Running

Location service is running and locations could be queried.

Failed

Location service failed (user denied access to location service).

Leave feedback

Description
The LOD fade modes. Modes other than LODFadeMode.None will result in Unity calculating a blend factor for
blending/interpolating between two neighbouring LODs and pass it to your shader.

Properties
None

Indicates the LOD fading is turned o .

CrossFade

Perform cross-fade style blending between the current LOD and the next LOD if the
distance to camera falls in the range speci ed by the LOD.fadeTransitionWidth of each
LOD.

SpeedTree

By specifying this mode, your LODGroup will perform a SpeedTree-style LOD fading
scheme: * For all the mesh LODs other than the last (most crude) mesh LOD, the fade
factor is calculated as the percentage of the object's current screen height, compared to
the whole range of the LOD. It is 1, if the camera is right at the position where the
previous LOD switches out and 0, if the next LOD is just about to switch in. * For the last
mesh LOD and the billboard LOD, the cross-fade mode is used.

Leave feedback

Description
The type of the log message in Debug.unityLogger.Log or delegate registered with
Application.RegisterLogCallback.
See Also: Logger, ILogger, Debug.unityLogger, Application.RegisterLogCallback.

Properties
Error

LogType used for Errors.

Assert

LogType used for Asserts. (These could also indicate an error inside Unity itself.)

Warning

LogType used for Warnings.

Log

LogType used for regular log messages.

Exception

LogType used for Exceptions.

Leave feedback
Obsolete

Description
Describes status messages from the master server as returned in OnMasterServerEvent.

Leave feedback

Description
How the material interacts with lightmaps and lightprobes.
See Also: Material.globalIlluminationFlags.

Properties
None

The emissive lighting does not a ect Global Illumination at all.

RealtimeEmissive

The emissive lighting will a ect realtime Global Illumination. It emits lighting into realtime
lightmaps and realtime lightprobes.

BakedEmissive

The emissive lighting a ects baked Global Illumination. It emits lighting into baked
lightmaps and baked lightprobes.

EmissiveIsBlack

The emissive lighting is guaranteed to be black. This lets the lightmapping system know
that it doesn't have to extract emissive lighting information from the material and can
simply assume it is completely black.

AnyEmissive

Helper Mask to be used to query the enum only based on whether realtime GI or baked GI
is set, ignoring all other bits.

Leave feedback

Description
Cooking options that are available with MeshCollider.

Properties
None

No optional cooking steps will be run.

CookForFasterSimulation

Toggle between cooking for faster simulation or faster cooking time.

EnableMeshCleaning

Toggle cleaning of the mesh.

WeldColocatedVertices

Toggle the removal of equal vertices.

Leave feedback

Description
Topology of Mesh faces.
Normally meshes are composed of triangles (three vertex indices per face), but in some cases you might want to
render complex things that are made up from lines or points. Creating a Mesh with that topology and using it to
render is usually the most e cient way.
See Also: Mesh.SetIndices function.

Properties
Triangles

Mesh is made from triangles.

Quads

Mesh is made from quads.

Lines

Mesh is made from lines.

LineStrip

Mesh is a line strip.

Points

Mesh is made from points.

Leave feedback

Description
Enum describing what lighting mode to be used with Mixed lights.
Summary of the baked data associated with each mode:
IndirectOnly
Lightmaps
- direct: no
- occlusion: no
Light probes
- direct: no
- occlusion: no
Shadowmask
Lightmaps
- direct: no
- occlusion: yes
Light probes
- direct: no
- occlusion: yes
Subtractive
Lightmaps
- direct: yes
- occlusion: no
Light probes
- direct: no
- occlusion: yes.

Properties
IndirectOnly

Mixed lights provide realtime direct lighting while indirect light is baked into lightmaps
and light probes.

Shadowmask

Mixed lights provide realtime direct lighting. Indirect lighting gets baked into lightmaps
and light probes. Shadowmasks and light probe occlusion get generated for baked
shadows. The Shadowmask Mode used at run time can be set in the Quality Settings
panel.

Subtractive

Mixed lights provide baked direct and indirect lighting for static objects. Dynamic objects
receive realtime direct lighting and cast shadows on static objects using the main
directional light in the Scene.



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
Linearized                      : No
Page Count                      : 2723
PDF Version                     : 1.4
Producer                        : macOS Version 10.14 (Build 18A391) Quartz PDFContext
Creator                         : Chromium
Create Date                     : 2018:10:29 00:31:22Z
Modify Date                     : 2018:10:29 00:31:22Z
EXIF Metadata provided by EXIF.tools

Navigation menu