TopDown Engine  v3.6
MoreMountains.TopDownEngine.CharacterRotateCamera Class Reference

An ability that will let the Character rotate its associated camera, using the PlayerID_CameraRotationAxis input axis More...

Inheritance diagram for MoreMountains.TopDownEngine.CharacterRotateCamera:
MoreMountains.TopDownEngine.CharacterAbility MoreMountains.Tools.MMEventListener< TopDownEngineEvent > MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

override string HelpBoxText ()
 This method is only used to display a helpbox text at the beginning of the ability's inspector. More...
 
virtual void SetCameraAngle (float newAngle)
 If InputAuthorized is false, you can use this method to force a camera angle from another script More...
 
override void ProcessAbility ()
 Every frame we rotate the camera More...
 
virtual void OnMMEvent (TopDownEngineEvent engineEvent)
 Forces a new init of the camera on level start More...
 
- Public Member Functions inherited from MoreMountains.TopDownEngine.CharacterAbility
delegate void AbilityEvent ()
 
virtual void ForceInitialization ()
 Call this any time you want to force this ability to initialize (again) More...
 
virtual void ResetInput ()
 Resets all input for this ability. Can be overridden for ability specific directives More...
 
virtual void EarlyProcessAbility ()
 The first of the 3 passes you can have in your ability. Think of it as EarlyUpdate() if it existed More...
 
virtual void LateProcessAbility ()
 The last of the 3 passes you can have in your ability. Think of it as LateUpdate() More...
 
virtual void UpdateAnimator ()
 Override this to send parameters to the character's animator. This is called once per cycle, by the Character class, after Early, normal and Late process(). More...
 
virtual void PermitAbility (bool abilityPermitted)
 Changes the status of the ability's permission More...
 
virtual void Flip ()
 Override this to specify what should happen in this ability when the character flips More...
 
virtual void ResetAbility ()
 Override this to reset this ability's parameters. It'll be automatically called when the character gets killed, in anticipation for its respawn. More...
 
virtual void SetInputManager (InputManager newInputManager)
 Changes the reference to the input manager with the one set in parameters More...
 
virtual void PlayAbilityStartSfx ()
 Plays the ability start sound effect More...
 
virtual void PlayAbilityUsedSfx ()
 Plays the ability used sound effect More...
 
virtual void StopAbilityUsedSfx ()
 Stops the ability used sound effect More...
 
virtual void PlayAbilityStopSfx ()
 Plays the ability stop sound effect More...
 
virtual void PlayAbilityStartFeedbacks ()
 Plays the ability start sound effect More...
 
virtual void StopStartFeedbacks ()
 Stops the ability used sound effect More...
 
virtual void PlayAbilityStopFeedbacks ()
 Plays the ability stop sound effect More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< TopDownEngineEvent >
void OnMMEvent (T eventType)
 

Public Attributes

Space RotationSpace = Space.World
 the space in which to rotate the camera (usually world) More...
 
Vector3 RotationForward = Vector3.forward
 the camera's forward vector, usually 0,0,1 More...
 
Vector3 RotationAxis = Vector3.up
 the axis on which to rotate the camera (usually 0,1,0 in 3D, 0,0,1 in 2D) More...
 
float CameraRotationSpeed = 3f
 the speed at which the camera should rotate More...
 
float CameraInterpolationSpeed = 0.2f
 the speed at which the camera should interpolate towards its target position More...
 
bool InputAuthorized = true
 if this is false, this ability won't read input More...
 
bool AutoSetupInputManager = true
 whether or not this ability should make changes on the InputManager to set it in camera driven input mode More...
 
- Public Attributes inherited from MoreMountains.TopDownEngine.CharacterAbility
AudioClip AbilityStartSfx
 the sound fx to play when the ability starts More...
 
AudioClip AbilityInProgressSfx
 the sound fx to play while the ability is running More...
 
AudioClip AbilityStopSfx
 the sound fx to play when the ability stops More...
 
MMFeedbacks AbilityStartFeedbacks
 the feedbacks to play when the ability starts More...
 
MMFeedbacks AbilityStopFeedbacks
 the feedbacks to play when the ability stops More...
 
bool AbilityPermitted = true
 if true, this ability can perform as usual, if not, it'll be ignored. You can use this to unlock abilities over time for example More...
 
CharacterStates.MovementStates[] BlockingMovementStates
 an array containing all the blocking movement states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while Idle or Swimming, for example. More...
 
CharacterStates.CharacterConditions[] BlockingConditionStates
 an array containing all the blocking condition states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while dead, for example. More...
 
Weapon.WeaponStates[] BlockingWeaponStates
 an array containing all the blocking weapon states. If one of the character's weapons is in one of these states and yet the character tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while attacking, for example. More...
 
AbilityEvent OnAbilityStart
 
AbilityEvent OnAbilityStop
 

Protected Member Functions

override void Initialization ()
 On init we grab our camera and setup our input manager if needed More...
 
virtual IEnumerator DelayedInitialization ()
 Because Cinemachine only initializes in LateUpdate, and doesn't offer events to know when it'll be ready, we wait a bit for it to be done More...
 
virtual void GetCurrentCamera ()
 Stores the current camera More...
 
override void HandleInput ()
 Reads input to know the requested rotation angle for the camera More...
 
virtual void RotateCamera ()
 Changes the rotation of the camera to match input More...
 
override void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDestroy ()
 On disable we stop listening for events More...
 
- Protected Member Functions inherited from MoreMountains.TopDownEngine.CharacterAbility
virtual void Awake ()
 On awake we proceed to pre initializing our ability More...
 
virtual void Start ()
 On Start(), we call the ability's intialization More...
 
virtual void PreInitialization ()
 A method you can override to have an initialization before the actual initialization More...
 
virtual void BindAnimator ()
 Binds the animator from the character and initializes the animator parameters More...
 
virtual void InitializeAnimatorParameters ()
 Adds required animator parameters to the animator parameters list if they exist More...
 
virtual void InternalHandleInput ()
 Internal method to check if an input manager is present or not More...
 
virtual void RegisterAnimatorParameter (string parameterName, AnimatorControllerParameterType parameterType, out int parameter)
 Registers a new animator parameter to the list More...
 
virtual void OnRespawn ()
 Override this to describe what should happen to this ability when the character respawns More...
 
virtual void OnDeath ()
 Override this to describe what should happen to this ability when the character respawns More...
 
virtual void OnHit ()
 Override this to describe what should happen to this ability when the character takes a hit More...
 
virtual void OnDisable ()
 On disable, we unbind our respawn delegate More...
 

Protected Attributes

float _requestedCameraAngle = 0f
 
Camera _mainCamera
 
float _targetRotationAngle
 
Vector3 _cameraDirection
 
float _cameraDirectionAngle
 
- Protected Attributes inherited from MoreMountains.TopDownEngine.CharacterAbility
Character _character
 
TopDownController _controller
 
TopDownController2D _controller2D
 
TopDownController3D _controller3D
 
GameObject _model
 
Health _health
 
CharacterMovement _characterMovement
 
InputManager _inputManager
 
Animator _animator = null
 
CharacterStates _state
 
SpriteRenderer _spriteRenderer
 
MMStateMachine< CharacterStates.MovementStates_movement
 
MMStateMachine< CharacterStates.CharacterConditions_condition
 
AudioSource _abilityInProgressSfx
 
bool _abilityInitialized = false
 
float _verticalInput
 
float _horizontalInput
 
bool _startFeedbackIsPlaying = false
 
List< CharacterHandleWeapon_handleWeaponList
 

Additional Inherited Members

- Properties inherited from MoreMountains.TopDownEngine.CharacterAbility
virtual bool AbilityAuthorized [get]
 
virtual bool AbilityInitialized [get]
 whether or not this ability has been initialized More...
 

Detailed Description

An ability that will let the Character rotate its associated camera, using the PlayerID_CameraRotationAxis input axis

Member Function Documentation

◆ DelayedInitialization()

virtual IEnumerator MoreMountains.TopDownEngine.CharacterRotateCamera.DelayedInitialization ( )
protectedvirtual

Because Cinemachine only initializes in LateUpdate, and doesn't offer events to know when it'll be ready, we wait a bit for it to be done

Returns

◆ GetCurrentCamera()

virtual void MoreMountains.TopDownEngine.CharacterRotateCamera.GetCurrentCamera ( )
protectedvirtual

Stores the current camera

◆ HandleInput()

override void MoreMountains.TopDownEngine.CharacterRotateCamera.HandleInput ( )
protectedvirtual

Reads input to know the requested rotation angle for the camera

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

◆ HelpBoxText()

override string MoreMountains.TopDownEngine.CharacterRotateCamera.HelpBoxText ( )
virtual

This method is only used to display a helpbox text at the beginning of the ability's inspector.

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

◆ Initialization()

override void MoreMountains.TopDownEngine.CharacterRotateCamera.Initialization ( )
protectedvirtual

On init we grab our camera and setup our input manager if needed

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

◆ OnDestroy()

virtual void MoreMountains.TopDownEngine.CharacterRotateCamera.OnDestroy ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

override void MoreMountains.TopDownEngine.CharacterRotateCamera.OnEnable ( )
protectedvirtual

On enable we start listening for events

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

◆ OnMMEvent()

virtual void MoreMountains.TopDownEngine.CharacterRotateCamera.OnMMEvent ( TopDownEngineEvent  engineEvent)
virtual

Forces a new init of the camera on level start

Parameters
engineEvent

◆ ProcessAbility()

override void MoreMountains.TopDownEngine.CharacterRotateCamera.ProcessAbility ( )
virtual

Every frame we rotate the camera

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

◆ RotateCamera()

virtual void MoreMountains.TopDownEngine.CharacterRotateCamera.RotateCamera ( )
protectedvirtual

Changes the rotation of the camera to match input

◆ SetCameraAngle()

virtual void MoreMountains.TopDownEngine.CharacterRotateCamera.SetCameraAngle ( float  newAngle)
virtual

If InputAuthorized is false, you can use this method to force a camera angle from another script

Parameters
newAngle

Member Data Documentation

◆ _cameraDirection

Vector3 MoreMountains.TopDownEngine.CharacterRotateCamera._cameraDirection
protected

◆ _cameraDirectionAngle

float MoreMountains.TopDownEngine.CharacterRotateCamera._cameraDirectionAngle
protected

◆ _mainCamera

Camera MoreMountains.TopDownEngine.CharacterRotateCamera._mainCamera
protected

◆ _requestedCameraAngle

float MoreMountains.TopDownEngine.CharacterRotateCamera._requestedCameraAngle = 0f
protected

◆ _targetRotationAngle

float MoreMountains.TopDownEngine.CharacterRotateCamera._targetRotationAngle
protected

◆ AutoSetupInputManager

bool MoreMountains.TopDownEngine.CharacterRotateCamera.AutoSetupInputManager = true

whether or not this ability should make changes on the InputManager to set it in camera driven input mode

◆ CameraInterpolationSpeed

float MoreMountains.TopDownEngine.CharacterRotateCamera.CameraInterpolationSpeed = 0.2f

the speed at which the camera should interpolate towards its target position

◆ CameraRotationSpeed

float MoreMountains.TopDownEngine.CharacterRotateCamera.CameraRotationSpeed = 3f

the speed at which the camera should rotate

◆ InputAuthorized

bool MoreMountains.TopDownEngine.CharacterRotateCamera.InputAuthorized = true

if this is false, this ability won't read input

◆ RotationAxis

Vector3 MoreMountains.TopDownEngine.CharacterRotateCamera.RotationAxis = Vector3.up

the axis on which to rotate the camera (usually 0,1,0 in 3D, 0,0,1 in 2D)

◆ RotationForward

Vector3 MoreMountains.TopDownEngine.CharacterRotateCamera.RotationForward = Vector3.forward

the camera's forward vector, usually 0,0,1

◆ RotationSpace

Space MoreMountains.TopDownEngine.CharacterRotateCamera.RotationSpace = Space.World

the space in which to rotate the camera (usually world)


The documentation for this class was generated from the following file: