TopDown Engine v5.0
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.AimMarker Class Reference

A class used to handle aim markers, (usually circular) visual elements. More...

Inheritance diagram for MoreMountains.TopDownEngine.AimMarker:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  MovementModes { Instant , Interpolate }
 the possible movement modes for aim markers More...

Public Member Functions

virtual void SetTarget (Transform newTarget)
 Sets a new target for this aim marker.
virtual void Disable ()
 Hides this object.

Public Attributes

MovementModes MovementMode
 The selected movement mode for this aim marker. Instant will move the marker instantly to its target, Interpolate will animate its position over time.
Vector3 Offset
 an offset to apply to the position of the target (useful if you want, for example, the marker to appear above the target)
float MovementDuration = 0.2f
 When in Interpolate mode, the duration of the movement animation.
MMTween.MMTweenCurve MovementCurve = MMTween.MMTweenCurve.EaseInCubic
 When in Interpolate mode, the curve to animate the movement on.
float MovementDelay = 0f
 When in Interpolate mode, the delay before the marker moves when changing target.
MMFeedbacks FirstTargetFeedback
 A feedback to play when a target is found and we didn't have one already.
MMFeedbacks NewTargetAssignedFeedback
 a feedback to play when we already had a target and just found a new one
MMFeedbacks NoMoreTargetFeedback
 a feedback to play when no more targets are found, and we just lost our last target

Protected Member Functions

virtual void Awake ()
 On Awake we initialize our feedbacks and delay.
virtual void Update ()
 On Update we check if we've changed target, and follow it if needed.
virtual void FollowTarget ()
 Makes this object follow the target's position.
virtual void HandleTargetChange ()
 Checks for target changes and triggers the appropriate methods if needed.
virtual void NoMoreTargets ()
 When no more targets are found, and we just lost one, we play a dedicated feedback.
virtual void FirstTargetFound ()
 When a new target is found and we didn't have one already, we play a dedicated feedback.
virtual void NewTargetFound ()
 When a new target is found, and we previously had another, we play a dedicated feedback.

Protected Attributes

Transform _target
Transform _targetLastFrame = null
WaitForSeconds _movementDelayWFS
float _lastTargetChangeAt = 0f

Detailed Description

A class used to handle aim markers, (usually circular) visual elements.

Member Enumeration Documentation

◆ MovementModes

the possible movement modes for aim markers

Enumerator
Instant 
Interpolate 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.TopDownEngine.AimMarker.Awake ( )
protectedvirtual

On Awake we initialize our feedbacks and delay.

◆ Disable()

virtual void MoreMountains.TopDownEngine.AimMarker.Disable ( )
virtual

Hides this object.

◆ FirstTargetFound()

virtual void MoreMountains.TopDownEngine.AimMarker.FirstTargetFound ( )
protectedvirtual

When a new target is found and we didn't have one already, we play a dedicated feedback.

◆ FollowTarget()

virtual void MoreMountains.TopDownEngine.AimMarker.FollowTarget ( )
protectedvirtual

Makes this object follow the target's position.

◆ HandleTargetChange()

virtual void MoreMountains.TopDownEngine.AimMarker.HandleTargetChange ( )
protectedvirtual

Checks for target changes and triggers the appropriate methods if needed.

◆ NewTargetFound()

virtual void MoreMountains.TopDownEngine.AimMarker.NewTargetFound ( )
protectedvirtual

When a new target is found, and we previously had another, we play a dedicated feedback.

◆ NoMoreTargets()

virtual void MoreMountains.TopDownEngine.AimMarker.NoMoreTargets ( )
protectedvirtual

When no more targets are found, and we just lost one, we play a dedicated feedback.

◆ SetTarget()

virtual void MoreMountains.TopDownEngine.AimMarker.SetTarget ( Transform newTarget)
virtual

Sets a new target for this aim marker.

Parameters
newTarget

◆ Update()

virtual void MoreMountains.TopDownEngine.AimMarker.Update ( )
protectedvirtual

On Update we check if we've changed target, and follow it if needed.

Member Data Documentation

◆ _lastTargetChangeAt

float MoreMountains.TopDownEngine.AimMarker._lastTargetChangeAt = 0f
protected

◆ _movementDelayWFS

WaitForSeconds MoreMountains.TopDownEngine.AimMarker._movementDelayWFS
protected

◆ _target

Transform MoreMountains.TopDownEngine.AimMarker._target
protected

◆ _targetLastFrame

Transform MoreMountains.TopDownEngine.AimMarker._targetLastFrame = null
protected

◆ FirstTargetFeedback

MMFeedbacks MoreMountains.TopDownEngine.AimMarker.FirstTargetFeedback

A feedback to play when a target is found and we didn't have one already.

◆ MovementCurve

MMTween.MMTweenCurve MoreMountains.TopDownEngine.AimMarker.MovementCurve = MMTween.MMTweenCurve.EaseInCubic

When in Interpolate mode, the curve to animate the movement on.

◆ MovementDelay

float MoreMountains.TopDownEngine.AimMarker.MovementDelay = 0f

When in Interpolate mode, the delay before the marker moves when changing target.

◆ MovementDuration

float MoreMountains.TopDownEngine.AimMarker.MovementDuration = 0.2f

When in Interpolate mode, the duration of the movement animation.

◆ MovementMode

MovementModes MoreMountains.TopDownEngine.AimMarker.MovementMode

The selected movement mode for this aim marker. Instant will move the marker instantly to its target, Interpolate will animate its position over time.

◆ NewTargetAssignedFeedback

MMFeedbacks MoreMountains.TopDownEngine.AimMarker.NewTargetAssignedFeedback

a feedback to play when we already had a target and just found a new one

◆ NoMoreTargetFeedback

MMFeedbacks MoreMountains.TopDownEngine.AimMarker.NoMoreTargetFeedback

a feedback to play when no more targets are found, and we just lost our last target

◆ Offset

Vector3 MoreMountains.TopDownEngine.AimMarker.Offset

an offset to apply to the position of the target (useful if you want, for example, the marker to appear above the target)


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/Weapons/AimMarker.cs