Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Camera

class in UnityEngine

/

Hereda de:Behaviour

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

Una cámara es un dispositivo mediante el cual el jugador ve el mundo.

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 Estáticas

allCamerasReturns all enabled cameras in the scene.
allCamerasCountThe number of cameras in the current scene.
currentThe camera we are currently rendering with, for low-level render control only (Read Only).
mainThe first enabled camera tagged "MainCamera" (Read Only).
onPostRenderEvent that is fired after any camera finishes rendering.
onPreCullOnPreRender se llama antes de que la cámara comience a renderizar la escena.
onPreRenderOnPreRender se llama antes de que la cámara comience a renderizar la escena.

Variables

actualRenderingPathThe rendering path that is currently being used (Read Only).The actual rendering path might be different from the user-specified renderingPath if the underlying gpu/platform does not support the requested one, or some other situation caused a fallback (for example, deferred rendering is not supported with orthographic projection cameras).
aspectThe aspect ratio (width divided by height).
backgroundColorThe color with which the screen will be cleared.
cameraToWorldMatrixMatrix that transforms from camera space to world space (Read Only).
cameraTypeIdentifies what kind of camera this is.
clearFlagsHow the camera clears the background.
clearStencilAfterLightingPassShould the camera clear the stencil buffer after the deferred light pass?
commandBufferCountNumber of command buffers set up on this camera (Read Only).
cullingMaskThis is used to render parts of the scene selectively.
depthCamera's depth in the camera rendering order.
depthTextureModeHow and if camera generates a depth texture.
eventMaskMask to select which layers can trigger events on the camera.
farClipPlaneThe far clipping plane distance.
fieldOfViewThe field of view of the camera in degrees.
hdrHigh dynamic range rendering.
layerCullDistancesPer-layer culling distances.
layerCullSphericalHow to perform per-layer culling for a Camera.
nearClipPlaneThe near clipping plane distance.
opaqueSortModeOpaque object sorting mode.
orthographicIs the camera orthographic (true) or perspective (false)?
orthographicSizeCamera's half-size when in orthographic mode.
pixelHeightHow tall is the camera in pixels (Read Only).
pixelRectWhere on the screen is the camera rendered in pixel coordinates.
pixelWidthHow wide is the camera in pixels (Read Only).
projectionMatrixDefinir una matriz de proyección a medida.
rectWhere on the screen is the camera rendered in normalized coordinates.
renderingPathThe rendering path that should be used, if possible.In some situations, it may not be possible to use the rendering path specified, in which case the renderer will automatically use a different path. For example, if the underlying gpu/platform does not support the requested one, or some other situation caused a fallback (for example, deferred rendering is not supported with orthographic projection cameras).For this reason, we also provide the read-only property actualRenderingPath which allows you to discover which path is actually being used.
stereoConvergenceDistance to a point where virtual eyes converge.
stereoEnabledStereoscopic rendering.
stereoMirrorModeRender only once and use resulting image for both eyes.
stereoSeparationDistancia entre los ojos virtuales.
targetDisplaySet the target display for this Camera.
targetTextureDestination render texture.
transparencySortModeTransparent object sorting mode.
useOcclusionCullingWhether or not the Camera will use occlusion culling during rendering.
velocityGet the world-space speed of the camera (Read Only).
worldToCameraMatrixMatrix that transforms from world to camera space.

Funciones Públicas

AddCommandBufferAdd a command buffer to be executed at a specified place.
CalculateObliqueMatrixCalculates and returns oblique near-plane projection matrix.
CopyFromMakes this camera's settings match other camera.
GetCommandBuffersGet command buffers to be executed at a specified place.
RemoveAllCommandBuffersRemove all command buffers set on this camera.
RemoveCommandBufferRemove command buffer from execution at a specified place.
RemoveCommandBuffersRemove command buffers from execution at a specified place.
RenderRenderizar la cámara manualmente.
RenderToCubemapRender into a static cubemap from this camera.
RenderWithShaderRender the camera with shader replacement.
ResetAspectRevert the aspect ratio to the screen's aspect ratio.
ResetFieldOfViewReset to the default field of view.
ResetProjectionMatrixMake the projection reflect normal camera's parameters.
ResetReplacementShaderRemove shader replacement from camera.
ResetStereoProjectionMatricesUse the default projection matrix for both stereo eye. Only work in 3D flat panel display.
ResetStereoViewMatricesUse the default view matrix for both stereo eye. Only work in 3D flat panel display.
ResetWorldToCameraMatrixMake the rendering position reflect the camera's position in the scene.
ScreenPointToRayReturns a ray going from camera through a screen point.
ScreenToViewportPointTransforms position from screen space into viewport space.
ScreenToWorldPointTransforms position from screen space into world space.
SetReplacementShaderMake the camera render with shader replacement.
SetStereoProjectionMatricesDefine the projection matrix for both stereo eye. Only work in 3D flat panel display.
SetStereoViewMatricesDefine the view matrices for both stereo eye. Only work in 3D flat panel display.
SetTargetBuffersSets the Camera to render to the chosen buffers of one or more RenderTextures.
ViewportPointToRayReturns a ray going from camera through a viewport point.
ViewportToScreenPointTransforms position from viewport space into screen space.
ViewportToWorldPointTransforms position from viewport space into world space.
WorldToScreenPointTransforms position from world space into screen space.
WorldToViewportPointTransforms position from world space into viewport space.

Funciones Estáticas

GetAllCamerasFills an array of Camera with the current cameras in the scene, without allocating a new array.

Mensajes

OnPostRenderOnPostRender is called after a camera has finished rendering the scene.
OnPreCullOnPreCull is called before a camera culls the scene.
OnPreRenderOnPreRender se llama antes de que la cámara comience a renderizar la escena.
OnRenderImageOnRenderImage is called after all rendering is complete to render image.
OnRenderObjectOnRenderObject is called after camera has rendered the scene.
OnWillRenderObjectOnWillRenderObject is called once for each camera if the object is visible.

Delegados

CameraCallbackDelegate type for camera callbacks.

Miembros heredados

Variables

enabledEnabled Behaviours are Updated, disabled Behaviours are not.
isActiveAndEnabledHas the Behaviour had enabled called.
gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagEl tag de este game object.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameEl nombre del objeto.

Funciones Públicas

BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringDevuelve el nombre del objeto.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateDevuelve el nombre del objeto.

Operadores

bool¿Existe el objeto?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.