Class CinemachineLensPresets
User-definable named presets for lenses. This is a Singleton asset, available in editor only
Inheritance
Namespace: Cinemachine.Editor
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[Serializable]
public sealed class CinemachineLensPresets : ScriptableObject
Fields
m_PhysicalPresets
The array containing Preset definitions, for physical cameras
Declaration
public CinemachineLensPresets.PhysicalPreset[] m_PhysicalPresets
Field Value
Type | Description |
---|---|
CinemachineLensPresets.PhysicalPreset[] |
m_Presets
The array containing Preset definitions for nonphysical cameras
Declaration
public CinemachineLensPresets.Preset[] m_Presets
Field Value
Type | Description |
---|---|
CinemachineLensPresets.Preset[] |
Properties
Instance
Get the singleton instance of this object. Creates asset if nonexistant
Declaration
public static CinemachineLensPresets Instance { get; }
Property Value
Type | Description |
---|---|
CinemachineLensPresets |
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 |
---|---|
CinemachineLensPresets |
Methods
GetMatchingPhysicalPreset(Single)
Get the index of the physical preset that matches the lens settings
Declaration
public int GetMatchingPhysicalPreset(float focalLength)
Parameters
Type | Name | Description |
---|---|---|
System.Single | focalLength |
Returns
Type | Description |
---|---|
System.Int32 | the preset index, or -1 if no matching preset |
GetMatchingPreset(Single)
Get the index of the preset that matches the lens settings
Declaration
public int GetMatchingPreset(float fov)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fov |
Returns
Type | Description |
---|---|
System.Int32 | the preset index, or -1 if no matching preset |