Third Person Cover Shooter  1.6
CoverShooter.MobileCamera Class Reference

Manages the camera object by setting an appropriate position depending on the target object's state. More...

Inheritance diagram for CoverShooter.MobileCamera:
CoverShooter.BaseCamera CoverShooter.CharacterCamera

Public Attributes

Vector3 CalmOffset = new Vector3(-3, 9, -3)
 Camera offset from the target character when there are no enemies around. More...
 
Vector3 DangerOffset = new Vector3(-4, 14, -4)
 Camera offset from the target character when there are enemies around. More...
 
float OffsetSpeed = 2f
 Speed to move between different offsets. More...
 
float ZoomDelay = 0.5f
 Time in seconds to go back to the calm offset after there are no more enemies around. More...
 
float FOV = 45
 Field of view. More...
 
EnemyDistanceRange EnemyDistances = new EnemyDistanceRange(5, 10)
 Min and max enemy distance. More...
 
MobileCameraTargetOffsets TargetOffsets
 Target offsets for each character direction. More...
 
- Public Attributes inherited from CoverShooter.BaseCamera
CharacterMotor Target
 Target character motor. More...
 
Action TargetChanged
 Executed on every camera target change. More...
 

Protected Member Functions

override void Update ()
 

Properties

Vector3 Forward [get]
 Forward/up direction for the character. More...
 
Vector3 Right [get]
 Right direction for the character. More...
 

Additional Inherited Members

- Public Member Functions inherited from CoverShooter.BaseCamera
TargetComponent< T > ()
 Get cached component of the target object. More...
 
override void DeferUpdate (ICharacterController controller)
 Asks the camera to call UpdateAfterCamera on the given controller after the camera does it's update. More...
 
override void UpdateForCharacterMotor ()
 Update performed after the character motor does it's thing. More...
 

Detailed Description

Manages the camera object by setting an appropriate position depending on the target object's state.

For camera to work you have to link it to the target object that has a Character Motor attached. Camera shifts a bit depending on the orientation of the character. It also zooms out when enemies are close by in order to display a wider combat area.

Member Function Documentation

◆ Update()

override void CoverShooter.MobileCamera.Update ( )
protectedvirtual

Reimplemented from CoverShooter.BaseCamera.

Member Data Documentation

◆ CalmOffset

Vector3 CoverShooter.MobileCamera.CalmOffset = new Vector3(-3, 9, -3)

Camera offset from the target character when there are no enemies around.

◆ DangerOffset

Vector3 CoverShooter.MobileCamera.DangerOffset = new Vector3(-4, 14, -4)

Camera offset from the target character when there are enemies around.

◆ EnemyDistances

EnemyDistanceRange CoverShooter.MobileCamera.EnemyDistances = new EnemyDistanceRange(5, 10)

Min and max enemy distance.

Enemies outside of the range are not considered when zooming.

◆ FOV

float CoverShooter.MobileCamera.FOV = 45

Field of view.

◆ OffsetSpeed

float CoverShooter.MobileCamera.OffsetSpeed = 2f

Speed to move between different offsets.

◆ TargetOffsets

MobileCameraTargetOffsets CoverShooter.MobileCamera.TargetOffsets
Initial value:
= new MobileCameraTargetOffsets(new Vector3(1, 0, 1),
new Vector3(-1, 0, -1),
new Vector3(-1, 0, 1),
new Vector3(1, 0, -1))

Target offsets for each character direction.

Targets are relative to the character's position.

◆ ZoomDelay

float CoverShooter.MobileCamera.ZoomDelay = 0.5f

Time in seconds to go back to the calm offset after there are no more enemies around.

Property Documentation

◆ Forward

Vector3 CoverShooter.MobileCamera.Forward
get

Forward/up direction for the character.

◆ Right

Vector3 CoverShooter.MobileCamera.Right
get

Right direction for the character.


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