Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMFloatingText Class Reference

A class used to handle the movement and behaviour of floating texts, usually used to display damage text. This is designed to be spawned by a MMFloatingTextSpawner, not used on its own. It also requires a specific hierarchy. You'll find examples of it in the MMTools/Tools/MMFloatingText/Prefabs folder More...

Inheritance diagram for MoreMountains.Tools.MMFloatingText:
MoreMountains.Tools.MMFloatingTextMeshPro

Public Member Functions

virtual float GetTime ()
 
virtual float GetDeltaTime ()
 
virtual void SetUseUnscaledTime (bool status, bool resetStartedAt)
 Changes whether or not this floating text should use unscaled time More...
 
virtual void SetProperties (string value, float lifetime, Vector3 direction, bool animateMovement, MMFloatingTextSpawner.AlignmentModes alignmentMode, Vector3 fixedAlignment, bool alwaysFaceCamera, Camera targetCamera, bool animateX, AnimationCurve animateXCurve, float remapXZero, float remapXOne, bool animateY, AnimationCurve animateYCurve, float remapYZero, float remapYOne, bool animateZ, AnimationCurve animateZCurve, float remapZZero, float remapZOne, bool animateOpacity, AnimationCurve animateOpacityCurve, float remapOpacityZero, float remapOpacityOne, bool animateScale, AnimationCurve animateScaleCurve, float remapScaleZero, float remapScaleOne, bool animateColor, Gradient animateColorGradient)
 Called by the spawner, sets all required variables More...
 
virtual void ResetPosition ()
 Resets this text's position More...
 
virtual void SetText (string newValue)
 Sets the target mesh's text value More...
 
virtual void SetColor (Color newColor)
 Sets the color of the target text More...
 
virtual void SetOpacity (float newOpacity)
 Sets the opacity of the target text More...
 

Public Attributes

Transform MovingPart
 the part of the prefab that we'll move More...
 
Transform Billboard
 the part of the prefab that we'll rotate to face the target camera More...
 
TextMesh TargetTextMesh
 the TextMesh used to display the value More...
 
Vector3 Direction = Vector3.up
 the direction of this floating text, used for debug only More...
 

Protected Member Functions

virtual void OnEnable ()
 On enable, we initialize our floating text More...
 
virtual void Initialization ()
 Stores start time and initial color More...
 
virtual void Update ()
 On Update we move our text More...
 
virtual void UpdateFloatingText ()
 Handles the text's life cycle, movement, scale, color, opacity, alignment and billboard More...
 
virtual void HandleMovement ()
 Moves the text along the specified curves More...
 
virtual void HandleColor ()
 Animates the text's color over the specified gradient More...
 
virtual void HandleOpacity ()
 Animates the text's opacity over the specified curve More...
 
virtual void HandleScale ()
 Animates the text's scale over the specified curve More...
 
virtual void HandleAlignment ()
 Handles text rotation to match either a fixed alignment, the initial direction or the movement's direction More...
 
virtual void HandleBillboard ()
 Forces the text to face the camera More...
 
virtual void TurnOff ()
 Turns of the text for recycling More...
 

Protected Attributes

bool _useUnscaledTime = false
 
float _startedAt
 
float _lifetime
 
Vector3 _newPosition
 
Color _initialTextColor
 
bool _animateMovement
 
bool _animateX
 
AnimationCurve _animateXCurve
 
float _remapXZero
 
float _remapXOne
 
bool _animateY
 
AnimationCurve _animateYCurve
 
float _remapYZero
 
float _remapYOne
 
bool _animateZ
 
AnimationCurve _animateZCurve
 
float _remapZZero
 
float _remapZOne
 
MMFloatingTextSpawner.AlignmentModes _alignmentMode
 
Vector3 _fixedAlignment
 
Vector3 _movementDirection
 
Vector3 _movingPartPositionLastFrame
 
bool _alwaysFaceCamera
 
Camera _targetCamera
 
Quaternion _targetCameraRotation
 
bool _animateOpacity
 
AnimationCurve _animateOpacityCurve
 
float _remapOpacityZero
 
float _remapOpacityOne
 
bool _animateScale
 
AnimationCurve _animateScaleCurve
 
float _remapScaleZero
 
float _remapScaleOne
 
bool _animateColor
 
Gradient _animateColorGradient
 
Vector3 _newScale
 
Color _newColor
 
float _elapsedTime
 
float _remappedTime
 

Detailed Description

A class used to handle the movement and behaviour of floating texts, usually used to display damage text. This is designed to be spawned by a MMFloatingTextSpawner, not used on its own. It also requires a specific hierarchy. You'll find examples of it in the MMTools/Tools/MMFloatingText/Prefabs folder

Member Function Documentation

◆ GetDeltaTime()

virtual float MoreMountains.Tools.MMFloatingText.GetDeltaTime ( )
virtual

◆ GetTime()

virtual float MoreMountains.Tools.MMFloatingText.GetTime ( )
virtual

◆ HandleAlignment()

virtual void MoreMountains.Tools.MMFloatingText.HandleAlignment ( )
protectedvirtual

Handles text rotation to match either a fixed alignment, the initial direction or the movement's direction

◆ HandleBillboard()

virtual void MoreMountains.Tools.MMFloatingText.HandleBillboard ( )
protectedvirtual

Forces the text to face the camera

◆ HandleColor()

virtual void MoreMountains.Tools.MMFloatingText.HandleColor ( )
protectedvirtual

Animates the text's color over the specified gradient

◆ HandleMovement()

virtual void MoreMountains.Tools.MMFloatingText.HandleMovement ( )
protectedvirtual

Moves the text along the specified curves

◆ HandleOpacity()

virtual void MoreMountains.Tools.MMFloatingText.HandleOpacity ( )
protectedvirtual

Animates the text's opacity over the specified curve

◆ HandleScale()

virtual void MoreMountains.Tools.MMFloatingText.HandleScale ( )
protectedvirtual

Animates the text's scale over the specified curve

◆ Initialization()

virtual void MoreMountains.Tools.MMFloatingText.Initialization ( )
protectedvirtual

Stores start time and initial color

Reimplemented in MoreMountains.Tools.MMFloatingTextMeshPro.

◆ OnEnable()

virtual void MoreMountains.Tools.MMFloatingText.OnEnable ( )
protectedvirtual

On enable, we initialize our floating text

◆ ResetPosition()

virtual void MoreMountains.Tools.MMFloatingText.ResetPosition ( )
virtual

Resets this text's position

◆ SetColor()

virtual void MoreMountains.Tools.MMFloatingText.SetColor ( Color  newColor)
virtual

Sets the color of the target text

Parameters
newColor

Reimplemented in MoreMountains.Tools.MMFloatingTextMeshPro.

◆ SetOpacity()

virtual void MoreMountains.Tools.MMFloatingText.SetOpacity ( float  newOpacity)
virtual

Sets the opacity of the target text

Parameters
newOpacity

Reimplemented in MoreMountains.Tools.MMFloatingTextMeshPro.

◆ SetProperties()

virtual void MoreMountains.Tools.MMFloatingText.SetProperties ( string  value,
float  lifetime,
Vector3  direction,
bool  animateMovement,
MMFloatingTextSpawner.AlignmentModes  alignmentMode,
Vector3  fixedAlignment,
bool  alwaysFaceCamera,
Camera  targetCamera,
bool  animateX,
AnimationCurve  animateXCurve,
float  remapXZero,
float  remapXOne,
bool  animateY,
AnimationCurve  animateYCurve,
float  remapYZero,
float  remapYOne,
bool  animateZ,
AnimationCurve  animateZCurve,
float  remapZZero,
float  remapZOne,
bool  animateOpacity,
AnimationCurve  animateOpacityCurve,
float  remapOpacityZero,
float  remapOpacityOne,
bool  animateScale,
AnimationCurve  animateScaleCurve,
float  remapScaleZero,
float  remapScaleOne,
bool  animateColor,
Gradient  animateColorGradient 
)
virtual

Called by the spawner, sets all required variables

Parameters
value
lifetime
direction
animateMovement
alignmentMode
fixedAlignment
alwaysFaceCamera
targetCamera
animateX
animateXCurve
remapXZero
remapXOne
animateY
animateYCurve
remapYZero
remapYOne
animateZ
animateZCurve
remapZZero
remapZOne
animateOpacity
animateOpacityCurve
remapOpacityZero
remapOpacityOne
animateScale
animateScaleCurve
remapScaleZero
remapScaleOne
animateColor
animateColorGradient

◆ SetText()

virtual void MoreMountains.Tools.MMFloatingText.SetText ( string  newValue)
virtual

Sets the target mesh's text value

Parameters
newValue

Reimplemented in MoreMountains.Tools.MMFloatingTextMeshPro.

◆ SetUseUnscaledTime()

virtual void MoreMountains.Tools.MMFloatingText.SetUseUnscaledTime ( bool  status,
bool  resetStartedAt 
)
virtual

Changes whether or not this floating text should use unscaled time

Parameters
status

◆ TurnOff()

virtual void MoreMountains.Tools.MMFloatingText.TurnOff ( )
protectedvirtual

Turns of the text for recycling

◆ Update()

virtual void MoreMountains.Tools.MMFloatingText.Update ( )
protectedvirtual

On Update we move our text

◆ UpdateFloatingText()

virtual void MoreMountains.Tools.MMFloatingText.UpdateFloatingText ( )
protectedvirtual

Handles the text's life cycle, movement, scale, color, opacity, alignment and billboard

Member Data Documentation

◆ _alignmentMode

MMFloatingTextSpawner.AlignmentModes MoreMountains.Tools.MMFloatingText._alignmentMode
protected

◆ _alwaysFaceCamera

bool MoreMountains.Tools.MMFloatingText._alwaysFaceCamera
protected

◆ _animateColor

bool MoreMountains.Tools.MMFloatingText._animateColor
protected

◆ _animateColorGradient

Gradient MoreMountains.Tools.MMFloatingText._animateColorGradient
protected

◆ _animateMovement

bool MoreMountains.Tools.MMFloatingText._animateMovement
protected

◆ _animateOpacity

bool MoreMountains.Tools.MMFloatingText._animateOpacity
protected

◆ _animateOpacityCurve

AnimationCurve MoreMountains.Tools.MMFloatingText._animateOpacityCurve
protected

◆ _animateScale

bool MoreMountains.Tools.MMFloatingText._animateScale
protected

◆ _animateScaleCurve

AnimationCurve MoreMountains.Tools.MMFloatingText._animateScaleCurve
protected

◆ _animateX

bool MoreMountains.Tools.MMFloatingText._animateX
protected

◆ _animateXCurve

AnimationCurve MoreMountains.Tools.MMFloatingText._animateXCurve
protected

◆ _animateY

bool MoreMountains.Tools.MMFloatingText._animateY
protected

◆ _animateYCurve

AnimationCurve MoreMountains.Tools.MMFloatingText._animateYCurve
protected

◆ _animateZ

bool MoreMountains.Tools.MMFloatingText._animateZ
protected

◆ _animateZCurve

AnimationCurve MoreMountains.Tools.MMFloatingText._animateZCurve
protected

◆ _elapsedTime

float MoreMountains.Tools.MMFloatingText._elapsedTime
protected

◆ _fixedAlignment

Vector3 MoreMountains.Tools.MMFloatingText._fixedAlignment
protected

◆ _initialTextColor

Color MoreMountains.Tools.MMFloatingText._initialTextColor
protected

◆ _lifetime

float MoreMountains.Tools.MMFloatingText._lifetime
protected

◆ _movementDirection

Vector3 MoreMountains.Tools.MMFloatingText._movementDirection
protected

◆ _movingPartPositionLastFrame

Vector3 MoreMountains.Tools.MMFloatingText._movingPartPositionLastFrame
protected

◆ _newColor

Color MoreMountains.Tools.MMFloatingText._newColor
protected

◆ _newPosition

Vector3 MoreMountains.Tools.MMFloatingText._newPosition
protected

◆ _newScale

Vector3 MoreMountains.Tools.MMFloatingText._newScale
protected

◆ _remapOpacityOne

float MoreMountains.Tools.MMFloatingText._remapOpacityOne
protected

◆ _remapOpacityZero

float MoreMountains.Tools.MMFloatingText._remapOpacityZero
protected

◆ _remappedTime

float MoreMountains.Tools.MMFloatingText._remappedTime
protected

◆ _remapScaleOne

float MoreMountains.Tools.MMFloatingText._remapScaleOne
protected

◆ _remapScaleZero

float MoreMountains.Tools.MMFloatingText._remapScaleZero
protected

◆ _remapXOne

float MoreMountains.Tools.MMFloatingText._remapXOne
protected

◆ _remapXZero

float MoreMountains.Tools.MMFloatingText._remapXZero
protected

◆ _remapYOne

float MoreMountains.Tools.MMFloatingText._remapYOne
protected

◆ _remapYZero

float MoreMountains.Tools.MMFloatingText._remapYZero
protected

◆ _remapZOne

float MoreMountains.Tools.MMFloatingText._remapZOne
protected

◆ _remapZZero

float MoreMountains.Tools.MMFloatingText._remapZZero
protected

◆ _startedAt

float MoreMountains.Tools.MMFloatingText._startedAt
protected

◆ _targetCamera

Camera MoreMountains.Tools.MMFloatingText._targetCamera
protected

◆ _targetCameraRotation

Quaternion MoreMountains.Tools.MMFloatingText._targetCameraRotation
protected

◆ _useUnscaledTime

bool MoreMountains.Tools.MMFloatingText._useUnscaledTime = false
protected

◆ Billboard

Transform MoreMountains.Tools.MMFloatingText.Billboard

the part of the prefab that we'll rotate to face the target camera

◆ Direction

Vector3 MoreMountains.Tools.MMFloatingText.Direction = Vector3.up

the direction of this floating text, used for debug only

◆ MovingPart

Transform MoreMountains.Tools.MMFloatingText.MovingPart

the part of the prefab that we'll move

◆ TargetTextMesh

TextMesh MoreMountains.Tools.MMFloatingText.TargetTextMesh

the TextMesh used to display the value


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