Corgi Engine  v8.8
MoreMountains.CorgiEngine.CinemachineCameraController Class Reference

A class that handles camera follow for Cinemachine powered cameras More...

Inheritance diagram for MoreMountains.CorgiEngine.CinemachineCameraController:
MoreMountains.CorgiEngine.CorgiMonoBehaviour MoreMountains.Tools.MMEventListener< MMCameraEvent > MoreMountains.Tools.MMEventListener< CorgiEngineEvent >

Public Types

enum  PerspectiveZoomMethods { PerspectiveZoomMethods.FieldOfView, PerspectiveZoomMethods.FramingTransposerDistance }
 

Public Member Functions

virtual void SetTarget (Character character)
 Sets a new target for this camera to track More...
 
virtual void StartFollowing ()
 Starts following the LevelManager's main player More...
 
virtual void StopFollowing ()
 Stops following any target More...
 
virtual void OnMMEvent (MMCameraEvent cameraEvent)
 Acts on MMCameraEvents when caught More...
 
virtual void TeleportCameraToTarget ()
 Teleports the camera's transform to the target's position More...
 
virtual void SetPriority (int priority)
 Sets the virtual camera's priority More...
 
virtual void OnMMEvent (CorgiEngineEvent corgiEngineEvent)
 When getting game events, acts on them More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMCameraEvent >
void OnMMEvent (T eventType)
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< CorgiEngineEvent >
void OnMMEvent (T eventType)
 

Public Attributes

bool FollowsAPlayer = true
 if this is true, this camera will follow a player More...
 
bool ConfineCameraToLevelBounds = true
 whether this camera should be confined by the bounds determined in the LevelManager or not More...
 
float ManualUpDownLookDistance = 3
 How high (or low) from the Player the camera should move when looking up/down. More...
 
Vector2 CharacterSpeed = new Vector2(0f, 16f)
 the min and max speed to consider for this character (when dealing with the zoom) More...
 
Character TargetCharacter
 the target character this camera follows More...
 
CorgiController TargetController
 the controller bound to the character this camera follows More...
 
bool UseOrthographicZoom = false
 Whether this camera should zoom in or out as the character moves. More...
 
Vector2 OrthographicZoom = new Vector2(5f, 9f)
 the minimum & maximum orthographic camera zoom More...
 
float InitialOrthographicZoom = 5f
 the initial zoom value when using an orthographic zoom More...
 
float OrthographicZoomSpeed = 0.4f
 the speed at which the orthographic camera zooms More...
 
bool UsePerspectiveZoom = false
 if this is true, perspective zoom will be processed every frame More...
 
PerspectiveZoomMethods PerspectiveZoomMethod = PerspectiveZoomMethods.FramingTransposerDistance
 the zoom method for this camera More...
 
Vector2 PerspectiveZoom = new Vector2(10f, 15f)
 the min and max perspective camera zooms More...
 
float InitialPerspectiveZoom = 5f
 the initial zoom to apply to the camera when in perspective mode More...
 
float PerspectiveZoomSpeed = 0.4f
 the speed at which the perspective camera zooms More...
 
bool InstantRepositionCameraOnRespawn = false
 if this is true, the camera will teleport to the player's location on respawn, otherwise it'll move there at its regular speed More...
 
bool DisableVirtualCameraOnStopFollow = true
 if this is true, the controller will disable the virtual camera on stop follow. It will be re-enabled on start follow orders More...
 
bool StartFollowingBtn
 
bool StopFollowingBtn
 

Protected Member Functions

virtual void Awake ()
 On Awake we grab our components More...
 
virtual void Initialization ()
 
virtual void Start ()
 On Start we assign our bounding volume More...
 
virtual void InitializeConfiner ()
 
virtual void LateUpdate ()
 On late update, we handle our zoom level More...
 
virtual void HandleZoom ()
 Makes the camera zoom in or out based on the current target speed More...
 
virtual void PerformOrthographicZoom ()
 Modifies the orthographic zoom More...
 
virtual void PerformPerspectiveZoom ()
 Modifies the zoom if the camera is in perspective mode More...
 
virtual void SetPerspectiveZoom (float newZoom)
 
virtual void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 

Protected Attributes

CinemachineVirtualCamera _virtualCamera
 
CinemachineConfiner _confiner
 
CinemachineFramingTransposer _framingTransposer
 
float _currentZoom
 
bool _initialized = false
 

Properties

bool FollowsPlayer [get, set]
 True if the camera should follow the player. More...
 

Detailed Description

A class that handles camera follow for Cinemachine powered cameras

Member Enumeration Documentation

◆ PerspectiveZoomMethods

Enumerator
FieldOfView 
FramingTransposerDistance 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.Awake ( )
protectedvirtual

On Awake we grab our components

◆ HandleZoom()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.HandleZoom ( )
protectedvirtual

Makes the camera zoom in or out based on the current target speed

◆ Initialization()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.Initialization ( )
protectedvirtual

◆ InitializeConfiner()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.InitializeConfiner ( )
protectedvirtual

◆ LateUpdate()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.LateUpdate ( )
protectedvirtual

On late update, we handle our zoom level

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.OnEnable ( )
protectedvirtual

On enable we start listening for events

◆ OnMMEvent() [1/2]

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.OnMMEvent ( CorgiEngineEvent  corgiEngineEvent)
virtual

When getting game events, acts on them

Parameters
corgiEngineEvent

◆ OnMMEvent() [2/2]

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.OnMMEvent ( MMCameraEvent  cameraEvent)
virtual

Acts on MMCameraEvents when caught

Parameters
cameraEvent

◆ PerformOrthographicZoom()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.PerformOrthographicZoom ( )
protectedvirtual

Modifies the orthographic zoom

◆ PerformPerspectiveZoom()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.PerformPerspectiveZoom ( )
protectedvirtual

Modifies the zoom if the camera is in perspective mode

◆ SetPerspectiveZoom()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.SetPerspectiveZoom ( float  newZoom)
protectedvirtual

◆ SetPriority()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.SetPriority ( int  priority)
virtual

Sets the virtual camera's priority

Parameters
priority

◆ SetTarget()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.SetTarget ( Character  character)
virtual

Sets a new target for this camera to track

Parameters
character

◆ Start()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.Start ( )
protectedvirtual

On Start we assign our bounding volume

◆ StartFollowing()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.StartFollowing ( )
virtual

Starts following the LevelManager's main player

◆ StopFollowing()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.StopFollowing ( )
virtual

Stops following any target

◆ TeleportCameraToTarget()

virtual void MoreMountains.CorgiEngine.CinemachineCameraController.TeleportCameraToTarget ( )
virtual

Teleports the camera's transform to the target's position

Member Data Documentation

◆ _confiner

CinemachineConfiner MoreMountains.CorgiEngine.CinemachineCameraController._confiner
protected

◆ _currentZoom

float MoreMountains.CorgiEngine.CinemachineCameraController._currentZoom
protected

◆ _framingTransposer

CinemachineFramingTransposer MoreMountains.CorgiEngine.CinemachineCameraController._framingTransposer
protected

◆ _initialized

bool MoreMountains.CorgiEngine.CinemachineCameraController._initialized = false
protected

◆ _virtualCamera

CinemachineVirtualCamera MoreMountains.CorgiEngine.CinemachineCameraController._virtualCamera
protected

◆ CharacterSpeed

Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.CharacterSpeed = new Vector2(0f, 16f)

the min and max speed to consider for this character (when dealing with the zoom)

◆ ConfineCameraToLevelBounds

bool MoreMountains.CorgiEngine.CinemachineCameraController.ConfineCameraToLevelBounds = true

whether this camera should be confined by the bounds determined in the LevelManager or not

◆ DisableVirtualCameraOnStopFollow

bool MoreMountains.CorgiEngine.CinemachineCameraController.DisableVirtualCameraOnStopFollow = true

if this is true, the controller will disable the virtual camera on stop follow. It will be re-enabled on start follow orders

◆ FollowsAPlayer

bool MoreMountains.CorgiEngine.CinemachineCameraController.FollowsAPlayer = true

if this is true, this camera will follow a player

◆ InitialOrthographicZoom

float MoreMountains.CorgiEngine.CinemachineCameraController.InitialOrthographicZoom = 5f

the initial zoom value when using an orthographic zoom

◆ InitialPerspectiveZoom

float MoreMountains.CorgiEngine.CinemachineCameraController.InitialPerspectiveZoom = 5f

the initial zoom to apply to the camera when in perspective mode

◆ InstantRepositionCameraOnRespawn

bool MoreMountains.CorgiEngine.CinemachineCameraController.InstantRepositionCameraOnRespawn = false

if this is true, the camera will teleport to the player's location on respawn, otherwise it'll move there at its regular speed

◆ ManualUpDownLookDistance

float MoreMountains.CorgiEngine.CinemachineCameraController.ManualUpDownLookDistance = 3

How high (or low) from the Player the camera should move when looking up/down.

◆ OrthographicZoom

Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.OrthographicZoom = new Vector2(5f, 9f)

the minimum & maximum orthographic camera zoom

◆ OrthographicZoomSpeed

float MoreMountains.CorgiEngine.CinemachineCameraController.OrthographicZoomSpeed = 0.4f

the speed at which the orthographic camera zooms

◆ PerspectiveZoom

Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoom = new Vector2(10f, 15f)

the min and max perspective camera zooms

◆ PerspectiveZoomMethod

PerspectiveZoomMethods MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoomMethod = PerspectiveZoomMethods.FramingTransposerDistance

the zoom method for this camera

◆ PerspectiveZoomSpeed

float MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoomSpeed = 0.4f

the speed at which the perspective camera zooms

◆ StartFollowingBtn

bool MoreMountains.CorgiEngine.CinemachineCameraController.StartFollowingBtn

◆ StopFollowingBtn

bool MoreMountains.CorgiEngine.CinemachineCameraController.StopFollowingBtn

◆ TargetCharacter

Character MoreMountains.CorgiEngine.CinemachineCameraController.TargetCharacter

the target character this camera follows

◆ TargetController

CorgiController MoreMountains.CorgiEngine.CinemachineCameraController.TargetController

the controller bound to the character this camera follows

◆ UseOrthographicZoom

bool MoreMountains.CorgiEngine.CinemachineCameraController.UseOrthographicZoom = false

Whether this camera should zoom in or out as the character moves.

◆ UsePerspectiveZoom

bool MoreMountains.CorgiEngine.CinemachineCameraController.UsePerspectiveZoom = false

if this is true, perspective zoom will be processed every frame

Property Documentation

◆ FollowsPlayer

bool MoreMountains.CorgiEngine.CinemachineCameraController.FollowsPlayer
getset

True if the camera should follow the player.


The documentation for this class was generated from the following file: