Corgi Engine  v8.8
MoreMountains.CorgiEngine.MMF_CorgiEngineFloatingText 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.CorgiEngine.MMF_CorgiEngineFloatingText:
MoreMountains.Feedbacks.MMF_FloatingText MoreMountains.Feedbacks.MMF_Feedback

Public Attributes

Health TargetHealth
 the Health component where damage data should be read More...
 
string Formatting = ""
 
bool DamageDirectionImpactsTextDirection = true
 whether or not the direction of the damage should impact the direction of the floating text More...
 
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 More...
 
- Public Attributes inherited from MoreMountains.Feedbacks.MMF_FloatingText
override bool HasChannel => true
 
override bool HasRandomness => true
 
float Intensity = 1f
 the Intensity to spawn this text with, will act as a lifetime/movement/scale multiplier based on the spawner's settings More...
 
string Value = "100"
 the value to display when spawning this text More...
 
bool UseIntensityAsValue = false
 if this is true, the intensity passed to this feedback will be the value displayed More...
 
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) More...
 
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 More...
 
Gradient AnimateColorGradient = new Gradient()
 the gradient to apply over the lifetime of the text More...
 
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 More...
 
float Lifetime = 0.5f
 the forced lifetime for the spawned text More...
 
PositionModes PositionMode = PositionModes.FeedbackPosition
 where to spawn the new text (at the position of the feedback, or on a specified Transform) More...
 
Transform TargetTransform
 in transform mode, the Transform on which to spawn the new floating text More...
 
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) More...
 

Protected Member Functions

override void CustomPlayFeedback (Vector3 position, float attenuation=1.0f)
 On play, we ask for a floating text to be spawned More...
 
- 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 More...
 
virtual float ApplyRounding (float value)
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Feedbacks.MMF_FloatingText
enum  PositionModes { PositionModes.TargetTransform, PositionModes.FeedbackPosition, PositionModes.PlayPosition }
 the possible places where the floating text should spawn at More...
 
enum  RoundingMethods { RoundingMethods.NoRounding, RoundingMethods.Round, RoundingMethods.Ceil, RoundingMethods.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 More...
 
- 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 More...
 

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.CorgiEngine.MMF_CorgiEngineFloatingText.CustomPlayFeedback ( Vector3  position,
float  attenuation = 1.0f 
)
protectedvirtual

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

Parameters
position
attenuation

Implements MoreMountains.Feedbacks.MMF_Feedback.

Member Data Documentation

◆ DamageDirectionImpactsTextDirection

bool MoreMountains.CorgiEngine.MMF_CorgiEngineFloatingText.DamageDirectionImpactsTextDirection = true

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

◆ DamageDirectionMultiplier

float MoreMountains.CorgiEngine.MMF_CorgiEngineFloatingText.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.CorgiEngine.MMF_CorgiEngineFloatingText.Formatting = ""

◆ TargetHealth

Health MoreMountains.CorgiEngine.MMF_CorgiEngineFloatingText.TargetHealth

the Health component where damage data should be read


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