Adventure Creator  1.68.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.GameCamera2D Class Reference
Inheritance diagram for AC.GameCamera2D:
AC.CursorInfluenceCamera AC._Camera

Public Member Functions

override bool Is2D ()
 Checks if the camera is for 2D games. This is necessary for working out if the MainCamera needs to change its projection matrix. More...
 
override void _Update ()
 
override void MoveCameraInstant ()
 
void SnapToOffset ()
 
void SetCorrectRotation ()
 
bool IsCorrectRotation ()
 Checks if the GameObject's rotation matches the intended rotation, according to the chosen settings in SettingsManager. More...
 
override Vector2 GetPerspectiveOffset ()
 Gets the actual horizontal and vertical panning offsets. More...
 
void SetPerspectiveOffset (Vector2 _perspectiveOffset)
 Sets the actual horizontal and vertical panning offsets. Be aware that the camera will still be subject to the movement set by the target, so it will move back to its original position afterwards unless you also change the target. More...
 
- Public Member Functions inherited from AC.CursorInfluenceCamera
override Vector2 CreateRotationOffset ()
 Returns a vector by which to tweak the camera's rotation. The x-axis will control the spin, and the y-axis will control the pitch. More...
 
void ShowCursorInfluenceGUI ()
 
- Public Member Functions inherited from AC._Camera
virtual void SwitchTarget (Transform _target)
 Switches the camera's target. More...
 
virtual void ResetTarget ()
 
void SetSplitScreen ()
 
void RemoveSplitScreen ()
 
bool IsActive ()
 Checks if the Camera is currently the MainCamera's active camera (attachedCamera) More...
 

Public Attributes

bool lockHorizontal = true
 
bool lockVertical = true
 
bool limitHorizontal
 
bool limitVertical
 
Vector2 constrainHorizontal
 
Vector2 constrainVertical
 
Vector2 freedom = Vector2.zero
 
float dampSpeed = 0.9f
 
Vector2 directionInfluence = Vector2.zero
 
Vector2 afterOffset = Vector2.zero
 
bool doSnapping = false
 
float unitSnap = 0.1f
 
- Public Attributes inherited from AC.CursorInfluenceCamera
bool followCursor = false
 
Vector2 cursorInfluence = new Vector2 (0.3f, 0.1f)
 
bool constrainCursorInfluenceX = false
 
Vector2 limitCursorInfluenceX
 
bool constrainCursorInfluenceY = false
 
Vector2 limitCursorInfluenceY
 
float followCursorSpeed = 3f
 
- Public Attributes inherited from AC._Camera
bool targetIsPlayer = true
 
Transform target
 
bool isDragControlled = false
 
float focalDistance = 10f
 

Protected Member Functions

override void Awake ()
 
override void Start ()
 
- Protected Member Functions inherited from AC._Camera
Vector3 PositionRelativeToCamera (Vector3 _position)
 
Vector3 RightVector ()
 
Vector3 ForwardVector ()
 
float ConstrainAxis (float desired, Vector2 range)
 
void MakeActive ()
 

Additional Inherited Members

- Protected Attributes inherited from AC._Camera
Vector2 inputMovement
 
- Properties inherited from AC._Camera
bool isFor2D [get, set]
 
Vector3 TargetForward [get]
 
Transform Target [get]
 
Camera Camera [get]
 

Detailed Description

The standard 2D camera. It can be scrolled horizontally and vertically without altering perspective (causing a "Ken Burns effect" if the camera uses Perspective projection. Based on the work by Eric Haines (Eric5h5) at http://wiki.unity3d.com/index.php?title=OffsetVanishingPoint

Member Function Documentation

◆ _Update()

override void AC.GameCamera2D._Update ( )
virtual

Updates the camera. This is called every frame by StateHandler.

Reimplemented from AC._Camera.

◆ GetPerspectiveOffset()

override Vector2 AC.GameCamera2D.GetPerspectiveOffset ( )
virtual

Gets the actual horizontal and vertical panning offsets.

Returns
The actual horizontal and vertical panning offsets

Reimplemented from AC._Camera.

◆ Is2D()

override bool AC.GameCamera2D.Is2D ( )
virtual

Checks if the camera is for 2D games. This is necessary for working out if the MainCamera needs to change its projection matrix.

Returns
True if the camera is for 2D games

Reimplemented from AC._Camera.

◆ IsCorrectRotation()

bool AC.GameCamera2D.IsCorrectRotation ( )

Checks if the GameObject's rotation matches the intended rotation, according to the chosen settings in SettingsManager.

Returns
True if the GameObject's rotation matches the intended rotation<returns>

◆ MoveCameraInstant()

override void AC.GameCamera2D.MoveCameraInstant ( )
virtual

Moves the camera instantly to its destination.

Reimplemented from AC._Camera.

◆ SetCorrectRotation()

void AC.GameCamera2D.SetCorrectRotation ( )

Sets the camera's rotation and projection according to the chosen settings in SettingsManager.

◆ SetPerspectiveOffset()

void AC.GameCamera2D.SetPerspectiveOffset ( Vector2  _perspectiveOffset)

Sets the actual horizontal and vertical panning offsets. Be aware that the camera will still be subject to the movement set by the target, so it will move back to its original position afterwards unless you also change the target.

Parameters
_perspectiveOffsetThe new offsets

◆ SnapToOffset()

void AC.GameCamera2D.SnapToOffset ( )

Snaps the camera to its offset values and recalculates the camera's projection matrix.

Member Data Documentation

◆ afterOffset

Vector2 AC.GameCamera2D.afterOffset = Vector2.zero

The intended horizontal and vertical panning offsets

◆ constrainHorizontal

Vector2 AC.GameCamera2D.constrainHorizontal

The lower and upper horizontal limits, if limitHorizontal = True

◆ constrainVertical

Vector2 AC.GameCamera2D.constrainVertical

The lower and upper vertical limits, if limitVertical = True

◆ dampSpeed

float AC.GameCamera2D.dampSpeed = 0.9f

The follow speed when tracking a target

◆ directionInfluence

Vector2 AC.GameCamera2D.directionInfluence = Vector2.zero

The influence that the target's facing direction has on the tracking position

◆ doSnapping

bool AC.GameCamera2D.doSnapping = false

If True, the camera will only move in steps, as if snapping to a grid

◆ freedom

Vector2 AC.GameCamera2D.freedom = Vector2.zero

The amount of freedom when tracking a target. Higher values will result in looser tracking

◆ limitHorizontal

bool AC.GameCamera2D.limitHorizontal

If True, then horizontal panning will be limited to minimum and maximum values

◆ limitVertical

bool AC.GameCamera2D.limitVertical

If True, then vertical panning will be limited to minimum and maximum values

◆ lockHorizontal

bool AC.GameCamera2D.lockHorizontal = true

If True, then horizontal panning is prevented

◆ lockVertical

bool AC.GameCamera2D.lockVertical = true

If True, then vertical panning is prevented

◆ unitSnap

float AC.GameCamera2D.unitSnap = 0.1f

The step size when doSnapping is True