Adventure Creator  1.68.0
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.GameCamera2DDrag Class Reference
Inheritance diagram for AC.GameCamera2DDrag:
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 Vector2 GetPerspectiveOffset ()
 Gets the actual horizontal and vertical panning offsets. More...
 
void SetPosition (Vector2 _position)
 Sets the position to a specific point. This does not account for the offset, minimum or maximum values. More...
 
Vector2 GetPosition ()
 Gets the camera's position, relative to its original position. More...
 
- Public Member Functions inherited from AC._Camera
virtual 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...
 
virtual void SwitchTarget (Transform _target)
 Switches the camera's target. More...
 
virtual void ResetTarget ()
 
virtual void MoveCameraInstant ()
 
void SetSplitScreen ()
 
void RemoveSplitScreen ()
 
bool IsActive ()
 Checks if the Camera is currently the MainCamera's active camera (attachedCamera) More...
 

Public Attributes

RotationLock xLock
 
RotationLock yLock
 
float xSpeed = 5f
 
float ySpeed = 5f
 
float xAcceleration = 5f
 
float xDeceleration = 5f
 
float yAcceleration = 5f
 
float yDeceleration = 5f
 
bool invertX
 
bool invertY
 
float minX
 
float maxX
 
float minY
 
float maxY
 
float xOffset
 
float yOffset
 
- Public Attributes inherited from AC._Camera
bool targetIsPlayer = true
 
Transform target
 
bool isDragControlled = false
 
float focalDistance = 10f
 

Protected Member Functions

override void Awake ()
 
virtual Vector2 GetInputVector ()
 
- Protected Member Functions inherited from AC._Camera
virtual void Start ()
 
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]
 

Member Function Documentation

◆ _Update()

override void AC.GameCamera2DDrag._Update ( )
virtual

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

Reimplemented from AC._Camera.

◆ GetPerspectiveOffset()

override Vector2 AC.GameCamera2DDrag.GetPerspectiveOffset ( )
virtual

Gets the actual horizontal and vertical panning offsets.

Returns
The actual horizontal and vertical panning offsets

Reimplemented from AC._Camera.

◆ GetPosition()

Vector2 AC.GameCamera2DDrag.GetPosition ( )

Gets the camera's position, relative to its original position.

Returns
The camera's position, relative to its original position

◆ Is2D()

override bool AC.GameCamera2DDrag.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.

◆ SetPosition()

void AC.GameCamera2DDrag.SetPosition ( Vector2  _position)

Sets the position to a specific point. This does not account for the offset, minimum or maximum values.

Parameters
_positionThe new position for the camera

Member Data Documentation

◆ invertX

bool AC.GameCamera2DDrag.invertX

If True, then X movement will be inverted

◆ invertY

bool AC.GameCamera2DDrag.invertY

If True, then Y movement will be inverted

◆ maxX

float AC.GameCamera2DDrag.maxX

The maximum X value, if xLock = RotationLock.Limited

◆ maxY

float AC.GameCamera2DDrag.maxY

The maximum Y value, if yLock = RotationLock.Limited

◆ minX

float AC.GameCamera2DDrag.minX

The minimum X value, if xLock = RotationLock.Limited

◆ minY

float AC.GameCamera2DDrag.minY

The minimum Y value, if yLock = RotationLock.Limited

◆ xAcceleration

float AC.GameCamera2DDrag.xAcceleration = 5f

The acceleration of X movement

◆ xDeceleration

float AC.GameCamera2DDrag.xDeceleration = 5f

The deceleration of X movement

◆ xLock

RotationLock AC.GameCamera2DDrag.xLock

How X movement is affected (Free, Limited, Locked)

◆ xOffset

float AC.GameCamera2DDrag.xOffset

The X offset

◆ xSpeed

float AC.GameCamera2DDrag.xSpeed = 5f

The speed of X movement

◆ yAcceleration

float AC.GameCamera2DDrag.yAcceleration = 5f

The acceleration of Y movement

◆ yDeceleration

float AC.GameCamera2DDrag.yDeceleration = 5f

The deceleration of Y movement

◆ yLock

RotationLock AC.GameCamera2DDrag.yLock

How Y movement is affected (Free, Limited, Locked)

◆ yOffset

float AC.GameCamera2DDrag.yOffset

The Y offset

◆ ySpeed

float AC.GameCamera2DDrag.ySpeed = 5f

The speed of Y movement