Corgi Engine  v9.1
MoreMountains.CorgiEngine.AimMarker Class Reference

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

Inheritance diagram for MoreMountains.CorgiEngine.AimMarker:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  MovementModes { MovementModes.Instant, MovementModes.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 More...
 
virtual void Disable ()
 Hides this object More...
 

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. More...
 
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) More...
 
float MovementDuration = 0.2f
 When in Interpolate mode, the duration of the movement animation. More...
 
MMTween.MMTweenCurve MovementCurve = MMTween.MMTweenCurve.EaseInCubic
 When in Interpolate mode, the curve to animate the movement on. More...
 
float MovementDelay = 0f
 When in Interpolate mode, the delay before the marker moves when changing target. More...
 
MMFeedbacks FirstTargetFeedback
 A feedback to play when a target is found and we didn't have one already. More...
 
MMFeedbacks NewTargetAssignedFeedback
 a feedback to play when we already had a target and just found a new one More...
 
MMFeedbacks NoMoreTargetFeedback
 a feedback to play when no more targets are found, and we just lost our last target More...
 

Protected Member Functions

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

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.CorgiEngine.AimMarker.Awake ( )
protectedvirtual

On Awake we initialize our feedbacks and delay

◆ Disable()

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

Hides this object

◆ FirstTargetFound()

virtual void MoreMountains.CorgiEngine.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.CorgiEngine.AimMarker.FollowTarget ( )
protectedvirtual

Makes this object follow the target's position

◆ HandleTargetChange()

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

Checks for target changes and triggers the appropriate methods if needed

◆ NewTargetFound()

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

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

◆ NoMoreTargets()

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

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

◆ SetTarget()

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

Sets a new target for this aim marker

Parameters
newTarget

◆ Update()

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

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

Member Data Documentation

◆ _lastTargetChangeAt

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

◆ _movementDelayWFS

WaitForSeconds MoreMountains.CorgiEngine.AimMarker._movementDelayWFS
protected

◆ _target

Transform MoreMountains.CorgiEngine.AimMarker._target
protected

◆ _targetLastFrame

Transform MoreMountains.CorgiEngine.AimMarker._targetLastFrame = null
protected

◆ FirstTargetFeedback

MMFeedbacks MoreMountains.CorgiEngine.AimMarker.FirstTargetFeedback

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

◆ MovementCurve

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

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

◆ MovementDelay

float MoreMountains.CorgiEngine.AimMarker.MovementDelay = 0f

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

◆ MovementDuration

float MoreMountains.CorgiEngine.AimMarker.MovementDuration = 0.2f

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

◆ MovementMode

MovementModes MoreMountains.CorgiEngine.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.CorgiEngine.AimMarker.NewTargetAssignedFeedback

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

◆ NoMoreTargetFeedback

MMFeedbacks MoreMountains.CorgiEngine.AimMarker.NoMoreTargetFeedback

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

◆ Offset

Vector3 MoreMountains.CorgiEngine.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: