|
override void | Awake () |
|
override void | OnEnable () |
|
override void | OnDisable () |
|
override void | Start () |
|
void | OnTeleport (GameObject _gameObject) |
|
void | OnUpdatePlayableScreenArea () |
|
void | UpdateBackgroundConstraint () |
|
void | SetDesired () |
|
void | MoveCamera () |
|
void | SetOriginalPosition () |
|
void | SetProjection () |
|
Vector2 | GetOffsetForPosition (Vector3 targetPosition) |
|
Vector2 | GetSnapOffset () |
|
Vector3 | PositionRelativeToCamera (Vector3 _position) |
|
Vector3 | RightVector () |
|
Vector3 | ForwardVector () |
|
float | ConstrainAxis (float desired, Vector2 range, bool isAngle=false) |
|
|
enum | CutsceneBehaviour { Freeze,
Allow,
Reset
} |
|
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
◆ _Update()
override void AC.GameCamera2D._Update |
( |
| ) |
|
|
virtual |
◆ ForceRecordOriginalPosition()
void AC.GameCamera2D.ForceRecordOriginalPosition |
( |
| ) |
|
Force-sets the current position as its original position. This should not normally need to be called externally.
◆ 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
-
_perspectiveOffset | The new offsets |
◆ SnapToOffset()
void AC.GameCamera2D.SnapToOffset |
( |
| ) |
|
Snaps the camera to its offset values and recalculates the camera's projection matrix.
◆ afterOffset
Vector2 AC.GameCamera2D.afterOffset = Vector2.zero |
The intended horizontal and vertical panning offsets
◆ autoScaleToFitBackgroundConstraint
bool AC.GameCamera2D.autoScaleToFitBackgroundConstraint = false |
If True, and backgroundConstraint is set, then the camera will zoom in to fit the background if it is too zoomed out to fit
◆ backgroundConstraint
SpriteRenderer AC.GameCamera2D.backgroundConstraint = null |
If set, then the sprite's bounds will be used to set the horizontal and vertical limits, overriding constrainHorizontal and constrainVertical
◆ 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