Feel  5.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.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.Feedbacks.MMFloatingText:
MoreMountains.Feedbacks.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.Feedbacks.MMFloatingText.GetDeltaTime ( )
virtual

◆ GetTime()

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

◆ HandleAlignment()

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

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

◆ HandleBillboard()

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

Forces the text to face the camera

◆ HandleColor()

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

Animates the text's color over the specified gradient

◆ HandleMovement()

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

Moves the text along the specified curves

◆ HandleOpacity()

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

Animates the text's opacity over the specified curve

◆ HandleScale()

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

Animates the text's scale over the specified curve

◆ Initialization()

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

Stores start time and initial color

◆ OnEnable()

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

On enable, we initialize our floating text

◆ ResetPosition()

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

Resets this text's position

◆ SetColor()

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

Sets the color of the target text

Parameters
newColor

◆ SetOpacity()

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

Sets the opacity of the target text

Parameters
newOpacity

◆ SetProperties()

virtual void MoreMountains.Feedbacks.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.Feedbacks.MMFloatingText.SetText ( string  newValue)
virtual

Sets the target mesh's text value

Parameters
newValue

◆ SetUseUnscaledTime()

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

Changes whether or not this floating text should use unscaled time

Parameters
status

◆ TurnOff()

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

Turns of the text for recycling

◆ Update()

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

On Update we move our text

◆ UpdateFloatingText()

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

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

Member Data Documentation

◆ _alignmentMode

MMFloatingTextSpawner.AlignmentModes MoreMountains.Feedbacks.MMFloatingText._alignmentMode
protected

◆ _alwaysFaceCamera

bool MoreMountains.Feedbacks.MMFloatingText._alwaysFaceCamera
protected

◆ _animateColor

bool MoreMountains.Feedbacks.MMFloatingText._animateColor
protected

◆ _animateColorGradient

Gradient MoreMountains.Feedbacks.MMFloatingText._animateColorGradient
protected

◆ _animateMovement

bool MoreMountains.Feedbacks.MMFloatingText._animateMovement
protected

◆ _animateOpacity

bool MoreMountains.Feedbacks.MMFloatingText._animateOpacity
protected

◆ _animateOpacityCurve

AnimationCurve MoreMountains.Feedbacks.MMFloatingText._animateOpacityCurve
protected

◆ _animateScale

bool MoreMountains.Feedbacks.MMFloatingText._animateScale
protected

◆ _animateScaleCurve

AnimationCurve MoreMountains.Feedbacks.MMFloatingText._animateScaleCurve
protected

◆ _animateX

bool MoreMountains.Feedbacks.MMFloatingText._animateX
protected

◆ _animateXCurve

AnimationCurve MoreMountains.Feedbacks.MMFloatingText._animateXCurve
protected

◆ _animateY

bool MoreMountains.Feedbacks.MMFloatingText._animateY
protected

◆ _animateYCurve

AnimationCurve MoreMountains.Feedbacks.MMFloatingText._animateYCurve
protected

◆ _animateZ

bool MoreMountains.Feedbacks.MMFloatingText._animateZ
protected

◆ _animateZCurve

AnimationCurve MoreMountains.Feedbacks.MMFloatingText._animateZCurve
protected

◆ _elapsedTime

float MoreMountains.Feedbacks.MMFloatingText._elapsedTime
protected

◆ _fixedAlignment

Vector3 MoreMountains.Feedbacks.MMFloatingText._fixedAlignment
protected

◆ _initialTextColor

Color MoreMountains.Feedbacks.MMFloatingText._initialTextColor
protected

◆ _lifetime

float MoreMountains.Feedbacks.MMFloatingText._lifetime
protected

◆ _movementDirection

Vector3 MoreMountains.Feedbacks.MMFloatingText._movementDirection
protected

◆ _movingPartPositionLastFrame

Vector3 MoreMountains.Feedbacks.MMFloatingText._movingPartPositionLastFrame
protected

◆ _newColor

Color MoreMountains.Feedbacks.MMFloatingText._newColor
protected

◆ _newPosition

Vector3 MoreMountains.Feedbacks.MMFloatingText._newPosition
protected

◆ _newScale

Vector3 MoreMountains.Feedbacks.MMFloatingText._newScale
protected

◆ _remapOpacityOne

float MoreMountains.Feedbacks.MMFloatingText._remapOpacityOne
protected

◆ _remapOpacityZero

float MoreMountains.Feedbacks.MMFloatingText._remapOpacityZero
protected

◆ _remappedTime

float MoreMountains.Feedbacks.MMFloatingText._remappedTime
protected

◆ _remapScaleOne

float MoreMountains.Feedbacks.MMFloatingText._remapScaleOne
protected

◆ _remapScaleZero

float MoreMountains.Feedbacks.MMFloatingText._remapScaleZero
protected

◆ _remapXOne

float MoreMountains.Feedbacks.MMFloatingText._remapXOne
protected

◆ _remapXZero

float MoreMountains.Feedbacks.MMFloatingText._remapXZero
protected

◆ _remapYOne

float MoreMountains.Feedbacks.MMFloatingText._remapYOne
protected

◆ _remapYZero

float MoreMountains.Feedbacks.MMFloatingText._remapYZero
protected

◆ _remapZOne

float MoreMountains.Feedbacks.MMFloatingText._remapZOne
protected

◆ _remapZZero

float MoreMountains.Feedbacks.MMFloatingText._remapZZero
protected

◆ _startedAt

float MoreMountains.Feedbacks.MMFloatingText._startedAt
protected

◆ _targetCamera

Camera MoreMountains.Feedbacks.MMFloatingText._targetCamera
protected

◆ _targetCameraRotation

Quaternion MoreMountains.Feedbacks.MMFloatingText._targetCameraRotation
protected

◆ _useUnscaledTime

bool MoreMountains.Feedbacks.MMFloatingText._useUnscaledTime = false
protected

◆ Billboard

Transform MoreMountains.Feedbacks.MMFloatingText.Billboard

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

◆ Direction

Vector3 MoreMountains.Feedbacks.MMFloatingText.Direction = Vector3.up

the direction of this floating text, used for debug only

◆ MovingPart

Transform MoreMountains.Feedbacks.MMFloatingText.MovingPart

the part of the prefab that we'll move

◆ TargetTextMesh

TextMesh MoreMountains.Feedbacks.MMFloatingText.TargetTextMesh

the TextMesh used to display the value


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