Class CameraStateExtensions
Extension methods for CameraState.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
public static class CameraStateExtensions
Methods
FindCustomBlendable(CameraState, Object)
Returns the index of the custom blendable that is associated with the input.
Declaration
public static int FindCustomBlendable(this CameraState s, Object custom)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Object | custom | The object with which the returned custom blendable index is associated. |
Returns
Type | Description |
---|---|
int | The index of the custom blendable that is associated with the input. |
GetCorrectedOrientation(CameraState)
Orientation with correction applied.
Declaration
public static Quaternion GetCorrectedOrientation(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Returns
Type | Description |
---|---|
Quaternion | Orientation with correction applied. |
GetCorrectedPosition(CameraState)
Position with correction applied.
Declaration
public static Vector3 GetCorrectedPosition(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Returns
Type | Description |
---|---|
Vector3 | Position with correction applied. |
GetCustomBlendable(CameraState, int)
Get a custom blendable that will be applied to the camera.
The base system manages but otherwise ignores this data - it is intended for
extension modules
Declaration
public static CameraState.CustomBlendableItems.Item GetCustomBlendable(this CameraState s, int index)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
int | index | Which one to get. Must be in range [0...NumCustomBlendables) |
Returns
Type | Description |
---|---|
CameraState.CustomBlendableItems.Item | The custom blendable at the specified index. |
GetFinalOrientation(CameraState)
Orientation with correction and dutch applied. This is what the final camera gets.
Declaration
public static Quaternion GetFinalOrientation(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check |
Returns
Type | Description |
---|---|
Quaternion | Orientation with correction and dutch applied. |
GetFinalPosition(CameraState)
Position with correction applied. This is what the final camera gets.
Declaration
public static Vector3 GetFinalPosition(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Returns
Type | Description |
---|---|
Vector3 | Position with correction applied. |
GetNumCustomBlendables(CameraState)
Get the number of custom blendable items that have been added to this CameraState
Declaration
public static int GetNumCustomBlendables(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Returns
Type | Description |
---|---|
int | The number of custom blendable items added. |
HasLookAt(CameraState)
Returns true if this state has a valid ReferenceLookAt value.
Declaration
public static bool HasLookAt(this CameraState s)
Parameters
Type | Name | Description |
---|---|---|
CameraState | s | State to check. |
Returns
Type | Description |
---|---|
bool | True, if state has a valid ReferenceLookAt value. False, otherwise. |
IsTargetOffscreen(CameraState)
Checks whether the LookAt point falls within the camera's frustum
Declaration
public static bool IsTargetOffscreen(this CameraState state)
Parameters
Type | Name | Description |
---|---|---|
CameraState | state | Camera state to check |
Returns
Type | Description |
---|---|
bool | True if target is outside the camera frustum |