Class CameraController
Control the camera, mainly used as a reference to the main camera through the singleton instance, and to handle mouse wheel zooming
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
CameraController
Namespace: CreatorKitCodeInternal
Assembly: Assembly-CSharp.dll
Syntax
public class CameraController : MonoBehaviour
Fields
GameplayCamera
Declaration
public Camera GameplayCamera
Field Value
Type | Description |
---|---|
UnityEngine.Camera |
m_CurrentDistance
Declaration
protected float m_CurrentDistance
Field Value
Type | Description |
---|---|
System.Single |
m_FramingTransposer
Declaration
protected CinemachineFramingTransposer m_FramingTransposer
Field Value
Type | Description |
---|---|
Cinemachine.CinemachineFramingTransposer |
MaxAngle
Angle in degree (down compared to horizon) the camera will look at when at the farthest of the character
Declaration
public float MaxAngle
Field Value
Type | Description |
---|---|
System.Single |
MaxDistance
Distance at which the camera is from the character when at the max zoom level
Declaration
public float MaxDistance
Field Value
Type | Description |
---|---|
System.Single |
MinAngle
Angle in degree (down compared to horizon) the camera will look at when at the closest of the character
Declaration
public float MinAngle
Field Value
Type | Description |
---|---|
System.Single |
MinDistance
Distance at which the camera is from the character when at the closest zoom level
Declaration
public float MinDistance
Field Value
Type | Description |
---|---|
System.Single |
Properties
Camera
Declaration
public CinemachineVirtualCamera Camera { get; protected set; }
Property Value
Type | Description |
---|---|
Cinemachine.CinemachineVirtualCamera |
Instance
Declaration
public static CameraController Instance { get; set; }
Property Value
Type | Description |
---|---|
CameraController |
Methods
Zoom(Single)
Zoom of the given distance. Note that distance need to be a param between 0...1,a d the distance is a ratio
Declaration
public void Zoom(float distance)
Parameters
Type | Name | Description |
---|---|---|
System.Single | distance | The distance to zoom, need to be in range [0..1] (will be clamped) |