TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_FloatingText Class Reference

This feedback will request the spawn of a floating text, usually to signify damage, but not necessarily This requires that a MMFloatingTextSpawner be correctly setup in the scene, otherwise nothing will happen. To do so, create a new empty object, add a MMFloatingTextSpawner to it. Drag (at least) one MMFloatingText prefab into its PooledSimpleMMFloatingText slot. You'll find such prefabs already made in the MMTools/Tools/MMFloatingText/Prefabs folder, but feel free to create your own. Using that feedback will always spawn the same text. While this may be what you want, if you're using the Corgi Engine or TopDown Engine, you'll find dedicated versions directly hooked to the Health component, letting you display damage taken. More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_FloatingText:
MoreMountains.Feedbacks.MMF_Feedback MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText

Public Types

enum  PositionModes { TargetTransform , FeedbackPosition , PlayPosition }
 the possible places where the floating text should spawn at More...
enum  RoundingMethods { NoRounding , Round , Ceil , Floor }
 the possible methods that can be applied to the output value (when using intensity as the output value, string values won't get rounded) More...

Public Attributes

float Intensity = 1f
 the Intensity to spawn this text with, will act as a lifetime/movement/scale multiplier based on the spawner's settings
string Value = "100"
 the value to display when spawning this text
bool UseIntensityAsValue = false
 if this is true, the intensity passed to this feedback will be the value displayed
RoundingMethods RoundingMethod = RoundingMethods.NoRounding
 the rounding methods to apply to the output value (when using intensity as the output value, string values won't get rounded)
bool ForceColor = false
 whether or not to force a color on the new text, if not, the default colors of the spawner will be used
Gradient AnimateColorGradient = new Gradient()
 the gradient to apply over the lifetime of the text
bool ForceLifetime = false
 whether or not to force a lifetime on the new text, if not, the default colors of the spawner will be used
float Lifetime = 0.5f
 the forced lifetime for the spawned text
PositionModes PositionMode = PositionModes.FeedbackPosition
 where to spawn the new text (at the position of the feedback, or on a specified Transform)
Transform TargetTransform
 in transform mode, the Transform on which to spawn the new floating text
Vector3 Direction = Vector3.zero
 the direction to apply to the new floating text (leave it to 0 to let the Spawner decide based on its settings)
Transform AttachmentTransform
 a transform to attach the floating text to for the duration of its lifetime. it will then move relative to it

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once

Protected Member Functions

override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On play we ask the spawner on the specified channel to spawn a new floating text.
virtual float ApplyRounding (float value)

Protected Attributes

Vector3 _playPosition
string _value

Properties

override float FeedbackDuration [get, set]
 sets the inspector color for this feedback
override bool HasChannel [get]
override bool HasRandomness [get]

Additional Inherited Members

Detailed Description

This feedback will request the spawn of a floating text, usually to signify damage, but not necessarily This requires that a MMFloatingTextSpawner be correctly setup in the scene, otherwise nothing will happen. To do so, create a new empty object, add a MMFloatingTextSpawner to it. Drag (at least) one MMFloatingText prefab into its PooledSimpleMMFloatingText slot. You'll find such prefabs already made in the MMTools/Tools/MMFloatingText/Prefabs folder, but feel free to create your own. Using that feedback will always spawn the same text. While this may be what you want, if you're using the Corgi Engine or TopDown Engine, you'll find dedicated versions directly hooked to the Health component, letting you display damage taken.

Member Enumeration Documentation

◆ PositionModes

the possible places where the floating text should spawn at

Enumerator
TargetTransform 
FeedbackPosition 
PlayPosition 

◆ RoundingMethods

the possible methods that can be applied to the output value (when using intensity as the output value, string values won't get rounded)

Enumerator
NoRounding 
Round 
Ceil 
Floor 

Member Function Documentation

◆ ApplyRounding()

virtual float MoreMountains.Feedbacks.MMF_FloatingText.ApplyRounding ( float value)
protectedvirtual

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_FloatingText.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On play we ask the spawner on the specified channel to spawn a new floating text.

Parameters
position
feedbacksIntensity

Member Data Documentation

◆ _playPosition

Vector3 MoreMountains.Feedbacks.MMF_FloatingText._playPosition
protected

◆ _value

string MoreMountains.Feedbacks.MMF_FloatingText._value
protected

◆ AnimateColorGradient

Gradient MoreMountains.Feedbacks.MMF_FloatingText.AnimateColorGradient = new Gradient()

the gradient to apply over the lifetime of the text

◆ AttachmentTransform

Transform MoreMountains.Feedbacks.MMF_FloatingText.AttachmentTransform

a transform to attach the floating text to for the duration of its lifetime. it will then move relative to it

◆ Direction

Vector3 MoreMountains.Feedbacks.MMF_FloatingText.Direction = Vector3.zero

the direction to apply to the new floating text (leave it to 0 to let the Spawner decide based on its settings)

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_FloatingText.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ ForceColor

bool MoreMountains.Feedbacks.MMF_FloatingText.ForceColor = false

whether or not to force a color on the new text, if not, the default colors of the spawner will be used

◆ ForceLifetime

bool MoreMountains.Feedbacks.MMF_FloatingText.ForceLifetime = false

whether or not to force a lifetime on the new text, if not, the default colors of the spawner will be used

◆ Intensity

float MoreMountains.Feedbacks.MMF_FloatingText.Intensity = 1f

the Intensity to spawn this text with, will act as a lifetime/movement/scale multiplier based on the spawner's settings

◆ Lifetime

float MoreMountains.Feedbacks.MMF_FloatingText.Lifetime = 0.5f

the forced lifetime for the spawned text

◆ PositionMode

PositionModes MoreMountains.Feedbacks.MMF_FloatingText.PositionMode = PositionModes.FeedbackPosition

where to spawn the new text (at the position of the feedback, or on a specified Transform)

◆ RoundingMethod

RoundingMethods MoreMountains.Feedbacks.MMF_FloatingText.RoundingMethod = RoundingMethods.NoRounding

the rounding methods to apply to the output value (when using intensity as the output value, string values won't get rounded)

◆ TargetTransform

Transform MoreMountains.Feedbacks.MMF_FloatingText.TargetTransform

in transform mode, the Transform on which to spawn the new floating text

◆ UseIntensityAsValue

bool MoreMountains.Feedbacks.MMF_FloatingText.UseIntensityAsValue = false

if this is true, the intensity passed to this feedback will be the value displayed

◆ Value

string MoreMountains.Feedbacks.MMF_FloatingText.Value = "100"

the value to display when spawning this text

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_FloatingText.FeedbackDuration
getset

sets the inspector color for this feedback

the duration of this feedback is a fixed value or the lifetime

◆ HasChannel

override bool MoreMountains.Feedbacks.MMF_FloatingText.HasChannel
get

◆ HasRandomness

override bool MoreMountains.Feedbacks.MMF_FloatingText.HasRandomness
get

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacksForThirdParty/MMTools/Feedbacks/MMF_FloatingText.cs