Corgi Engine
v9.0
|
A class that handles camera follow for Cinemachine powered cameras More...
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... | |
A class that handles camera follow for Cinemachine powered cameras
|
protectedvirtual |
On Awake we grab our components
|
protectedvirtual |
Makes the camera zoom in or out based on the current target speed
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
On late update, we handle our zoom level
|
protectedvirtual |
On disable we stop listening for events
|
protectedvirtual |
On enable we start listening for events
|
virtual |
When getting game events, acts on them
corgiEngineEvent |
|
virtual |
Acts on MMCameraEvents when caught
cameraEvent |
|
protectedvirtual |
Modifies the orthographic zoom
|
protectedvirtual |
Modifies the zoom if the camera is in perspective mode
|
protectedvirtual |
|
virtual |
Sets the virtual camera's priority
priority |
|
virtual |
Sets a new target for this camera to track
character |
|
protectedvirtual |
On Start we assign our bounding volume
|
virtual |
Starts following the LevelManager's main player
|
virtual |
Stops following any target
|
virtual |
Teleports the camera's transform to the target's position
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.CharacterSpeed = new Vector2(0f, 16f) |
the min and max speed to consider for this character (when dealing with the zoom)
bool MoreMountains.CorgiEngine.CinemachineCameraController.ConfineCameraToLevelBounds = true |
whether this camera should be confined by the bounds determined in the LevelManager or not
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
bool MoreMountains.CorgiEngine.CinemachineCameraController.FollowsAPlayer = true |
if this is true, this camera will follow a player
float MoreMountains.CorgiEngine.CinemachineCameraController.InitialOrthographicZoom = 5f |
the initial zoom value when using an orthographic zoom
float MoreMountains.CorgiEngine.CinemachineCameraController.InitialPerspectiveZoom = 5f |
the initial zoom to apply to the camera when in perspective mode
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
float MoreMountains.CorgiEngine.CinemachineCameraController.ManualUpDownLookDistance = 3 |
How high (or low) from the Player the camera should move when looking up/down.
Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.OrthographicZoom = new Vector2(5f, 9f) |
the minimum & maximum orthographic camera zoom
float MoreMountains.CorgiEngine.CinemachineCameraController.OrthographicZoomSpeed = 0.4f |
the speed at which the orthographic camera zooms
Vector2 MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoom = new Vector2(10f, 15f) |
the min and max perspective camera zooms
PerspectiveZoomMethods MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoomMethod = PerspectiveZoomMethods.FramingTransposerDistance |
the zoom method for this camera
float MoreMountains.CorgiEngine.CinemachineCameraController.PerspectiveZoomSpeed = 0.4f |
the speed at which the perspective camera zooms
bool MoreMountains.CorgiEngine.CinemachineCameraController.StartFollowingBtn |
bool MoreMountains.CorgiEngine.CinemachineCameraController.StopFollowingBtn |
Character MoreMountains.CorgiEngine.CinemachineCameraController.TargetCharacter |
the target character this camera follows
CorgiController MoreMountains.CorgiEngine.CinemachineCameraController.TargetController |
the controller bound to the character this camera follows
bool MoreMountains.CorgiEngine.CinemachineCameraController.UseOrthographicZoom = false |
Whether this camera should zoom in or out as the character moves.
bool MoreMountains.CorgiEngine.CinemachineCameraController.UsePerspectiveZoom = false |
if this is true, perspective zoom will be processed every frame
|
getset |
True if the camera should follow the player.