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

Public Types

enum  CutsceneBehaviour { Freeze, Allow, Reset }
 

Public Member Functions

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 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...
 
virtual void _Update ()
 
virtual void ResetTarget ()
 
virtual void MoveCameraInstant ()
 
void SetSplitScreen ()
 
void RemoveSplitScreen ()
 
virtual Vector2 GetPerspectiveOffset ()
 Gets the actual horizontal and vertical panning offsets. More...
 
bool IsActive ()
 Checks if the Camera is currently the MainCamera's active camera (attachedCamera) More...
 
void MakeActive ()
 

Public Attributes

bool followCursor = false
 
Vector2 cursorInfluence = new Vector2 (0.3f, 0.1f)
 
bool constrainCursorInfluenceX = false
 
Vector2 limitCursorInfluenceX
 
bool constrainCursorInfluenceY = false
 
Vector2 limitCursorInfluenceY
 
float followCursorSpeed = 3f
 
CutsceneBehaviour cutsceneBehaviour = CutsceneBehaviour.Freeze
 
- Public Attributes inherited from AC._Camera
bool targetIsPlayer = true
 
Transform target
 
bool isDragControlled = false
 
float focalDistance = 10f
 

Protected Attributes

Vector2 actualCursorOffset
 
- Protected Attributes inherited from AC._Camera
Char targetChar
 
Camera _camera
 
Vector2 inputMovement
 
bool is2D = false
 

Additional Inherited Members

- Protected Member Functions inherited from AC._Camera
virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void Start ()
 
virtual void OnDisable ()
 
Vector3 PositionRelativeToCamera (Vector3 _position)
 
Vector3 RightVector ()
 
Vector3 ForwardVector ()
 
float ConstrainAxis (float desired, Vector2 range, bool isAngle=false)
 
- Properties inherited from AC._Camera
Transform Target [get]
 
Transform CameraTransform [get]
 
Transform Transform [get]
 
Camera Camera [get]
 
bool isFor2D [get, set]
 
virtual TransparencySortMode TransparencySortMode [get]
 
Vector3 TargetForward [get]
 
virtual bool CursorOffsetForcesTranslation [get]
 

Detailed Description

A subclass of _Camera that allows for the cursor position to tweak the camera's rotation

Member Function Documentation

◆ CreateRotationOffset()

override Vector2 AC.CursorInfluenceCamera.CreateRotationOffset ( )
virtual

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.

<return>A vector by which to tweak the camera's rotation.

Reimplemented from AC._Camera.

Reimplemented in AC.GameCamera2D.

Member Data Documentation

◆ constrainCursorInfluenceX

bool AC.CursorInfluenceCamera.constrainCursorInfluenceX = false

If True, and followCursor = True, then camera rotation according to the cursor's X position will be limited

◆ constrainCursorInfluenceY

bool AC.CursorInfluenceCamera.constrainCursorInfluenceY = false

If True, and followCursor = True, then camera rotation according to the cursor's Y position will be limited

◆ cursorInfluence

Vector2 AC.CursorInfluenceCamera.cursorInfluence = new Vector2 (0.3f, 0.1f)

The influence that the cursor's position has on rotation, if followCursor = True

◆ cutsceneBehaviour

CutsceneBehaviour AC.CursorInfluenceCamera.cutsceneBehaviour = CutsceneBehaviour.Freeze

The influence of the cursor position on the camera's rotation during cutscenes (Freeze, Allow, Reset)

◆ followCursor

bool AC.CursorInfluenceCamera.followCursor = false

If True, then the camera will rotate towards the cursor's position on-screen

◆ followCursorSpeed

float AC.CursorInfluenceCamera.followCursorSpeed = 3f

The speed at which the camera follows the cursor

◆ limitCursorInfluenceX

Vector2 AC.CursorInfluenceCamera.limitCursorInfluenceX

The lower and upper limits, if constrainCursorInfluenceX = True

◆ limitCursorInfluenceY

Vector2 AC.CursorInfluenceCamera.limitCursorInfluenceY

The lower and upper limits, if constrainCursorInfluenceY = True