Camera
Class, inherits from Behaviour
A Camera is a device through which the player views the world.
A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top
is (pixelWidth,pixelHeight). The z position is in world units from the camera.
A viewport space point is normalized and relative to the camera. The bottom-left of the camera is
(0,0); the top-right is (1,1). The z position is in world units from the camera.
A world space point is defined in global coordinates (eg. Transform.position).
See Also: camera component.
Variables
| fieldOfView |
The field of view of the camera in degrees.
|
| nearClipPlane |
The near clipping plane distance.
|
| farClipPlane |
The far clipping plane distance.
|
| orthographicSize |
Camera's half-size when in orthographic mode.
|
| orthographic |
Is the camera orthographic (true) or perspective (false)?
|
| depth |
Camera's depth in the camera rendering order.
|
| aspect |
The aspect ratio (width divided by height).
|
| cullingMask |
This is used to render parts of the scene selectively.
|
| backgroundColor |
The color with which the screen will be cleared.
|
| rect |
Where on the screen is the camera rendered in normalized coordinates.
|
| pixelRect |
Where on the screen is the camera rendered in pixel coordinates.
|
| targetTexture |
Destination render texture (Unity Pro only).
|
| pixelWidth |
How wide is the camera in pixels (Read Only).
|
| pixelHeight |
How tall is the camera in pixels (Read Only).
|
| cameraToWorldMatrix |
Matrix that transforms from camera space to world space (Read Only).
|
| worldToCameraMatrix |
Matrix that transforms from world to camera space.
|
| projectionMatrix |
Set a custom projection matrix.
|
| velocity |
Get the world-space speed of the camera (Read Only).
|
| clearFlags |
How the camera clears the background.
|
Functions
Messages Sent
| OnPreCull |
OnPreCull is called before a camera culls the scene.
|
| OnPreRender |
OnPreRender is called before a camera starts rendering the scene.
|
| OnPostRender |
OnPostRender is called after a camera has finished rendering the scene.
|
| OnRenderImage |
OnRenderImage is called after all rendering is complete to render image
|
| OnRenderObject |
OnRenderObject is used to render your own objects using Graphics.DrawMeshNow or other functions.
|
| OnWillRenderObject |
OnWillRenderObject is called once for each camera if the object is visible.
|
Class Variables
| main |
The first enabled camera tagged "MainCamera" (Read Only).
|
| current |
The camera we are currently rendering with, for low-level render control only (Read Only).
|
| allCameras |
Returns all enabled cameras in the scene.
|
Inherited members
Inherited Variables
Inherited Functions
Inherited Class Functions
|
operator bool |
Does the object exist?
|
|
Instantiate |
Clones the object original and returns the clone.
|
|
Destroy |
Removes a gameobject, component or asset.
|
|
DestroyImmediate |
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
|
|
FindObjectsOfType |
Returns a list of all active loaded objects of Type type.
|
|
FindObjectOfType |
Returns the first active loaded object of Type type.
|
|
operator == |
Compares if two objects refer to the same
|
|
operator != |
Compares if two objects refer to a different object
|
|
DontDestroyOnLoad |
Makes the object target not be destroyed automatically when loading a new scene.
|
|