TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText Class Reference

This feedback lets you trigger the appearance of a floating text, that will reflect the damage done to the target Health component. 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. More...

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

Public Attributes

Health TargetHealth
 the Health component where damage data should be read
string Formatting = ""
bool DamageDirectionImpactsTextDirection = false
 whether or not the direction of the damage should impact the direction of the floating text
float DamageDirectionMultiplier = 0.5f
 the multiplier to apply to the damage direction. Usually you'll want it to be less than 1. With a value of 0.5, a character being hit from the left will spawn a floating text at a 45° up/right angle
Public Attributes inherited from MoreMountains.Feedbacks.MMF_FloatingText
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

Protected Member Functions

override void CustomPlayFeedback (Vector3 position, float attenuation=1.0f)
 On play, we ask for a floating text to be spawned.
Protected Member Functions inherited from MoreMountains.Feedbacks.MMF_FloatingText
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)

Additional Inherited Members

Public Types inherited from MoreMountains.Feedbacks.MMF_FloatingText
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...
Static Public Attributes inherited from MoreMountains.Feedbacks.MMF_FloatingText
static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once
Protected Attributes inherited from MoreMountains.Feedbacks.MMF_FloatingText
Vector3 _playPosition
string _value
Properties inherited from MoreMountains.Feedbacks.MMF_FloatingText
override float FeedbackDuration [get, set]
 sets the inspector color for this feedback
override bool HasChannel [get]
override bool HasRandomness [get]

Detailed Description

This feedback lets you trigger the appearance of a floating text, that will reflect the damage done to the target Health component. 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.

Member Function Documentation

◆ CustomPlayFeedback()

override void MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText.CustomPlayFeedback ( Vector3 position,
float attenuation = 1::0f )
protected

On play, we ask for a floating text to be spawned.

Parameters
position
attenuation

Member Data Documentation

◆ DamageDirectionImpactsTextDirection

bool MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText.DamageDirectionImpactsTextDirection = false

whether or not the direction of the damage should impact the direction of the floating text

◆ DamageDirectionMultiplier

float MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText.DamageDirectionMultiplier = 0.5f

the multiplier to apply to the damage direction. Usually you'll want it to be less than 1. With a value of 0.5, a character being hit from the left will spawn a floating text at a 45° up/right angle

◆ Formatting

string MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText.Formatting = ""

◆ TargetHealth

Health MoreMountains.TopDownEngine.MMF_TopDownEngineFloatingText.TargetHealth

the Health component where damage data should be read


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