Infinite Runner Engine v1.9
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.InfiniteRunnerEngine.CameraBehavior Class Reference

Add this class to your main camera to have it zoom in or out, follow the player, etc... More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.CameraBehavior:

Public Member Functions

virtual void Shake (Vector3 shakeParameters)
 Use this method to shake the camera, passing in a Vector3 for intensity, duration and decay More...
 
virtual void ResetCamera ()
 Resets the camera to its initial position and size. More...
 

Public Attributes

Vector3 MinimumZoom
 the minimum possible position for the camera More...
 
float MinimumZoomOrthographic =3f
 the minimum ortho zoom More...
 
Vector3 MaximumZoom
 the maximum possible position for the camera More...
 
float MaximumZoomOrthographic =5f
 the maximum ortho zoom More...
 
bool FollowsPlayerX =false
 true if the camera should follow the player on the X axis (not recommended for most infinite runners. More...
 
bool FollowsPlayerY = true
 true if the camera should follow the player on the y axis More...
 
bool FollowsPlayerZ = false
 true if the camera should follow the player on the z axis More...
 
float CameraSpeed
 
bool CameraCanOnlyMoveWithinBounds = true
 bounds More...
 
Vector2 BottomLeftBounds
 the position of the bottom left corner of the camera's bounding box More...
 
Vector2 TopRightBounds
 the position of the top right corner of the camera's bounding box More...
 
Transform TargetOverride
 

Protected Member Functions

virtual void Start ()
 Triggers initialization. More...
 
virtual void Initialize ()
 Initializes the components of the camera and its various private variables More...
 
virtual void Update ()
 Every frame More...
 
virtual void GetLevelBounds ()
 Gets the levelbounds coordinates to lock the camera into the level More...
 
virtual void OnDrawGizmosSelected ()
 When the camera is selected in scene view More...
 

Protected Attributes

Vector3 _initialPosition
 initial position, size, camera component and player's position More...
 
float _initialSize
 
Camera _camera
 
Vector3 _playerPosition
 
Vector3 _currentZoomOffset
 
float _xMin
 
float _xMax
 
float _yMin
 
float _yMax
 
Vector3 _newCameraPosition
 
Vector2 _topRightBounds
 
Vector2 _bottomLeftBounds
 
Vector2 _boundsTopRight
 
Vector2 _boundsBottomRight
 
Vector2 _boundsBottomLeft
 
Vector2 _boundsTopLeft
 
float _shakeIntensity
 
float _shakeDecay
 
float _shakeDuration
 

Detailed Description

Add this class to your main camera to have it zoom in or out, follow the player, etc...

Member Function Documentation

◆ GetLevelBounds()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.GetLevelBounds ( )
protectedvirtual

Gets the levelbounds coordinates to lock the camera into the level

◆ Initialize()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.Initialize ( )
protectedvirtual

Initializes the components of the camera and its various private variables

◆ OnDrawGizmosSelected()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.OnDrawGizmosSelected ( )
protectedvirtual

When the camera is selected in scene view

◆ ResetCamera()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.ResetCamera ( )
virtual

Resets the camera to its initial position and size.

◆ Shake()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.Shake ( Vector3  shakeParameters)
virtual

Use this method to shake the camera, passing in a Vector3 for intensity, duration and decay

Parameters
shakeParametersShake parameters : intensity, duration and decay.

◆ Start()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.Start ( )
protectedvirtual

Triggers initialization.

◆ Update()

virtual void MoreMountains.InfiniteRunnerEngine.CameraBehavior.Update ( )
protectedvirtual

Every frame

Member Data Documentation

◆ _bottomLeftBounds

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._bottomLeftBounds
protected

◆ _boundsBottomLeft

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._boundsBottomLeft
protected

◆ _boundsBottomRight

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._boundsBottomRight
protected

◆ _boundsTopLeft

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._boundsTopLeft
protected

◆ _boundsTopRight

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._boundsTopRight
protected

◆ _camera

Camera MoreMountains.InfiniteRunnerEngine.CameraBehavior._camera
protected

◆ _currentZoomOffset

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior._currentZoomOffset
protected

◆ _initialPosition

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior._initialPosition
protected

initial position, size, camera component and player's position

◆ _initialSize

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._initialSize
protected

◆ _newCameraPosition

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior._newCameraPosition
protected

◆ _playerPosition

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior._playerPosition
protected

◆ _shakeDecay

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._shakeDecay
protected

◆ _shakeDuration

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._shakeDuration
protected

◆ _shakeIntensity

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._shakeIntensity
protected

◆ _topRightBounds

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior._topRightBounds
protected

◆ _xMax

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._xMax
protected

◆ _xMin

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._xMin
protected

◆ _yMax

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._yMax
protected

◆ _yMin

float MoreMountains.InfiniteRunnerEngine.CameraBehavior._yMin
protected

◆ BottomLeftBounds

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior.BottomLeftBounds

the position of the bottom left corner of the camera's bounding box

◆ CameraCanOnlyMoveWithinBounds

bool MoreMountains.InfiniteRunnerEngine.CameraBehavior.CameraCanOnlyMoveWithinBounds = true

bounds

if true, the camera won't be able to escape its bounding box

◆ CameraSpeed

float MoreMountains.InfiniteRunnerEngine.CameraBehavior.CameraSpeed

◆ FollowsPlayerX

bool MoreMountains.InfiniteRunnerEngine.CameraBehavior.FollowsPlayerX =false

true if the camera should follow the player on the X axis (not recommended for most infinite runners.

◆ FollowsPlayerY

bool MoreMountains.InfiniteRunnerEngine.CameraBehavior.FollowsPlayerY = true

true if the camera should follow the player on the y axis

◆ FollowsPlayerZ

bool MoreMountains.InfiniteRunnerEngine.CameraBehavior.FollowsPlayerZ = false

true if the camera should follow the player on the z axis

◆ MaximumZoom

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior.MaximumZoom

the maximum possible position for the camera

◆ MaximumZoomOrthographic

float MoreMountains.InfiniteRunnerEngine.CameraBehavior.MaximumZoomOrthographic =5f

the maximum ortho zoom

◆ MinimumZoom

Vector3 MoreMountains.InfiniteRunnerEngine.CameraBehavior.MinimumZoom

the minimum possible position for the camera

◆ MinimumZoomOrthographic

float MoreMountains.InfiniteRunnerEngine.CameraBehavior.MinimumZoomOrthographic =3f

the minimum ortho zoom

◆ TargetOverride

Transform MoreMountains.InfiniteRunnerEngine.CameraBehavior.TargetOverride

◆ TopRightBounds

Vector2 MoreMountains.InfiniteRunnerEngine.CameraBehavior.TopRightBounds

the position of the top right corner of the camera's bounding box


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