Class CinemachineLensPresets
User-definable named presets for lenses. This is a Singleton asset, available in editor only
Inherited Members
Namespace: Cinemachine.Editor
Assembly: com.unity.cinemachine.editor.dll
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[Serializable]
public sealed class CinemachineLensPresets : ScriptableObject
Fields
m_PhysicalPresets
The array containing Preset definitions, for physical cameras
Declaration
[Tooltip("The array containing Preset definitions, for physical cameras")]
public CinemachineLensPresets.PhysicalPreset[] m_PhysicalPresets
Field Value
Type | Description |
---|---|
Physical |
m_Presets
The array containing Preset definitions for nonphysical cameras
Declaration
[Tooltip("The array containing Preset definitions, for nonphysical cameras")]
public CinemachineLensPresets.Preset[] m_Presets
Field Value
Type | Description |
---|---|
Preset[] |
Properties
Instance
Get the singleton instance of this object. Creates asset if nonexistant
Declaration
public static CinemachineLensPresets Instance { get; }
Property Value
Type | Description |
---|---|
Cinemachine |
InstanceIfExists
Get the singleton instance of this object, or null if it doesn't exist
Declaration
public static CinemachineLensPresets InstanceIfExists { get; }
Property Value
Type | Description |
---|---|
Cinemachine |
Methods
GetMatchingPhysicalPreset(float)
Get the index of the physical preset that matches the lens settings
Declaration
public int GetMatchingPhysicalPreset(float focalLength)
Parameters
Type | Name | Description |
---|---|---|
float | focalLength | Focal length to match |
Returns
Type | Description |
---|---|
int | the preset index, or -1 if no matching preset |
GetMatchingPreset(float)
Get the index of the preset that matches the lens settings
Declaration
public int GetMatchingPreset(float verticalFOV)
Parameters
Type | Name | Description |
---|---|---|
float | verticalFOV | Vertical field of view |
Returns
Type | Description |
---|---|
int | the preset index, or -1 if no matching preset |