Third Person Cover Shooter
1.6
|
Manages the camera object by setting an appropriate orientation depending on the target object's state. More...
Public Member Functions | |
void | Shake (float intensity, float time) |
Shakes the camera in certain intensity for a certain time. More... | |
Vector3 | CalculateAimTarget (bool includeRecoil) |
Calculates target position to be aimed at in the world. More... | |
void | UpdatePosition () |
Update camera position and orientation based on the latest known information. More... | |
override void | UpdateForCharacterMotor () |
Update performed after the character motor does it's thing. More... | |
Public Member Functions inherited from CoverShooter.BaseCamera | |
T | 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... | |
Static Public Member Functions | |
static void | Shake (Vector3 position, float intensity, float time) |
Shakes the main camera due to an explosion at a position. More... | |
static void | Shake (CharacterMotor motor, float intensity, float time) |
Shakes the main camera in certain intensity for a certain time. More... | |
Public Attributes | |
bool | AvoidObstacles = true |
Is the camera adjusting itself so there are no colliders between it and the target. More... | |
bool | IgnoreObstaclesWhenZooming = true |
Should the AvoidObstacles be ignored when the character is zooming in. More... | |
float | Zoom = 10 |
Reduction in field of view when zooming in without a scope. More... | |
bool | ShakingAffectsAim = true |
Does camera shake affect aiming. More... | |
bool | AskForSmoothRotations = true |
Should the camera ask for smoother rotation animations when zooming in. More... | |
CameraStates | States = CameraStates.GetDefault() |
Camera settings for all gameplay situations. More... | |
float | Horizontal |
Horizontal orientation of the camera in degrees. More... | |
float | Vertical |
Vertical orientation of the camera in degrees. More... | |
float | VerticalRecoil |
Vertical recoil offset in degrees. More... | |
float | HorizontalRecoil |
Horizontal recoil offset in degrees. 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 | |
float | StateFOV [get] |
Field of view as defined by the current camera state. More... | |
string | State [get] |
Current state name. More... | |
float | CrosshairAlpha [get] |
Alpha transparency of a crosshair that's drawn for this camera. More... | |
float | ShakeOffset [get] |
Current maximum shake angle offset. More... | |
Manages the camera object by setting an appropriate orientation 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. The camera component also maintains and draws a crosshair. It hides the crosshair if the character is unarmed or unable to fire at a wall because is too close. The visibility of crosshair also can be turned off manually by setting Is Crosshair Enabled value to false when your game needs so.
Vector3 CoverShooter.ThirdPersonCamera.CalculateAimTarget | ( | bool | includeRecoil | ) |
Calculates target position to be aimed at in the world.
|
static |
Shakes the main camera due to an explosion at a position.
|
static |
Shakes the main camera in certain intensity for a certain time.
Only if it is the ThirdPersonCamera with the same character motor.
void CoverShooter.ThirdPersonCamera.Shake | ( | float | intensity, |
float | time | ||
) |
Shakes the camera in certain intensity for a certain time.
|
protectedvirtual |
Reimplemented from CoverShooter.BaseCamera.
|
virtual |
Update performed after the character motor does it's thing.
Reimplemented from CoverShooter.BaseCamera.
void CoverShooter.ThirdPersonCamera.UpdatePosition | ( | ) |
Update camera position and orientation based on the latest known information.
bool CoverShooter.ThirdPersonCamera.AskForSmoothRotations = true |
Should the camera ask for smoother rotation animations when zooming in.
bool CoverShooter.ThirdPersonCamera.AvoidObstacles = true |
Is the camera adjusting itself so there are no colliders between it and the target.
float CoverShooter.ThirdPersonCamera.Horizontal |
Horizontal orientation of the camera in degrees.
float CoverShooter.ThirdPersonCamera.HorizontalRecoil |
Horizontal recoil offset in degrees.
bool CoverShooter.ThirdPersonCamera.IgnoreObstaclesWhenZooming = true |
Should the AvoidObstacles be ignored when the character is zooming in.
bool CoverShooter.ThirdPersonCamera.ShakingAffectsAim = true |
Does camera shake affect aiming.
CameraStates CoverShooter.ThirdPersonCamera.States = CameraStates.GetDefault() |
Camera settings for all gameplay situations.
float CoverShooter.ThirdPersonCamera.Vertical |
Vertical orientation of the camera in degrees.
float CoverShooter.ThirdPersonCamera.VerticalRecoil |
Vertical recoil offset in degrees.
float CoverShooter.ThirdPersonCamera.Zoom = 10 |
Reduction in field of view when zooming in without a scope.
|
get |
Alpha transparency of a crosshair that's drawn for this camera.
Camera itself doesn't draw it.
|
get |
Current maximum shake angle offset.
Used for crosshair size.
|
get |
Current state name.
|
get |
Field of view as defined by the current camera state.