Highroad Engine v1.3
|
Add this component to an object and it will show a healthbar above it You can either use a prefab for it, or have the component draw one at the start More...
Public Types | |
enum | HealthBarTypes { Prefab , Drawn } |
the possible health bar types More... | |
enum | TimeScales { UnscaledTime , Time } |
the possible timescales the bar can work on More... | |
Public Member Functions | |
virtual void | Initialization () |
virtual void | UpdateBar (float currentHealth, float minHealth, float maxHealth, bool show) |
Updates the bar More... | |
Public Attributes | |
HealthBarTypes | HealthBarType = HealthBarTypes.Drawn |
whether the healthbar uses a prefab or is drawn automatically More... | |
TimeScales | TimeScale = TimeScales.UnscaledTime |
defines whether the bar will work on scaled or unscaled time (whether or not it'll keep moving if time is slowed down for example) More... | |
MMProgressBar | HealthBarPrefab |
the prefab to use as the health bar More... | |
Vector2 | Size = new Vector2(1f,0.2f) |
if the healthbar is drawn, its size in world units More... | |
Vector2 | BackgroundPadding = new Vector2(0.01f,0.01f) |
if the healthbar is drawn, the padding to apply to the foreground, in world units More... | |
Vector3 | InitialRotationAngles |
the rotation to apply to the MMHealthBarContainer when drawing it More... | |
Gradient | ForegroundColor |
if the healthbar is drawn, the color of its foreground More... | |
Gradient | DelayedColor |
if the healthbar is drawn, the color of its delayed bar More... | |
Gradient | BorderColor |
if the healthbar is drawn, the color of its border More... | |
Gradient | BackgroundColor |
if the healthbar is drawn, the color of its background More... | |
string | SortingLayerName = "UI" |
the name of the sorting layer to put this health bar on More... | |
float | Delay = 0.5f |
the delay to apply to the delayed bar if drawn More... | |
bool | LerpFrontBar = true |
whether or not the front bar should lerp More... | |
float | LerpFrontBarSpeed = 15f |
the speed at which the front bar lerps More... | |
bool | LerpDelayedBar = true |
whether or not the delayed bar should lerp More... | |
float | LerpDelayedBarSpeed = 15f |
the speed at which the delayed bar lerps More... | |
bool | BumpScaleOnChange = true |
if this is true, bumps the scale of the healthbar when its value changes More... | |
float | BumpDuration = 0.2f |
the duration of the bump animation More... | |
AnimationCurve | BumpAnimationCurve = AnimationCurve.Constant(0,1,1) |
the animation curve to map the bump animation on More... | |
MMFollowTarget.UpdateModes | FollowTargetMode = MMFollowTarget.UpdateModes.LateUpdate |
the mode the bar should follow the target in More... | |
bool | NestDrawnHealthBar = false |
GameObject | InstantiatedOnDeath |
a gameobject (usually a particle system) to instantiate when the healthbar reaches zero More... | |
Vector3 | HealthBarOffset = new Vector3(0f,1f,0f) |
the offset to apply to the healthbar compared to the object's center More... | |
bool | AlwaysVisible = true |
whether or not the bar should be permanently displayed More... | |
float | DisplayDurationOnHit = 1f |
the duration (in seconds) during which to display the bar More... | |
bool | HideBarAtZero = true |
if this is set to true the bar will hide itself when it reaches zero More... | |
float | HideBarAtZeroDelay = 1f |
the delay (in seconds) after which to hide the bar More... | |
Protected Member Functions | |
virtual void | Awake () |
On Start, creates or sets the health bar up More... | |
void | OnEnable () |
On enable, initializes the bar again More... | |
virtual void | DrawHealthBar () |
Draws the health bar. More... | |
virtual void | Update () |
On Update, we hide or show our healthbar based on our current status More... | |
virtual IEnumerator | FinalHideBar () |
Hides the bar when it reaches zero More... | |
virtual void | UpdateDrawnColors () |
Updates the colors of the different bars More... | |
Protected Attributes | |
MMProgressBar | _progressBar |
MMFollowTarget | _followTransform |
float | _lastShowTimestamp = 0f |
bool | _showBar = false |
Image | _backgroundImage = null |
Image | _borderImage = null |
Image | _foregroundImage = null |
Image | _delayedImage = null |
bool | _finalHideStarted = false |
Add this component to an object and it will show a healthbar above it You can either use a prefab for it, or have the component draw one at the start
|
protectedvirtual |
On Start, creates or sets the health bar up
|
protectedvirtual |
Draws the health bar.
|
protectedvirtual |
Hides the bar when it reaches zero
|
virtual |
|
protected |
On enable, initializes the bar again
|
protectedvirtual |
On Update, we hide or show our healthbar based on our current status
|
virtual |
Updates the bar
currentHealth | Current health. |
minHealth | Minimum health. |
maxHealth | Max health. |
show | Whether or not we should show the bar. |
|
protectedvirtual |
Updates the colors of the different bars
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.Tools.MMHealthBar.AlwaysVisible = true |
whether or not the bar should be permanently displayed
Gradient MoreMountains.Tools.MMHealthBar.BackgroundColor |
if the healthbar is drawn, the color of its background
Vector2 MoreMountains.Tools.MMHealthBar.BackgroundPadding = new Vector2(0.01f,0.01f) |
if the healthbar is drawn, the padding to apply to the foreground, in world units
Gradient MoreMountains.Tools.MMHealthBar.BorderColor |
if the healthbar is drawn, the color of its border
AnimationCurve MoreMountains.Tools.MMHealthBar.BumpAnimationCurve = AnimationCurve.Constant(0,1,1) |
the animation curve to map the bump animation on
float MoreMountains.Tools.MMHealthBar.BumpDuration = 0.2f |
the duration of the bump animation
bool MoreMountains.Tools.MMHealthBar.BumpScaleOnChange = true |
if this is true, bumps the scale of the healthbar when its value changes
float MoreMountains.Tools.MMHealthBar.Delay = 0.5f |
the delay to apply to the delayed bar if drawn
Gradient MoreMountains.Tools.MMHealthBar.DelayedColor |
if the healthbar is drawn, the color of its delayed bar
float MoreMountains.Tools.MMHealthBar.DisplayDurationOnHit = 1f |
the duration (in seconds) during which to display the bar
MMFollowTarget.UpdateModes MoreMountains.Tools.MMHealthBar.FollowTargetMode = MMFollowTarget.UpdateModes.LateUpdate |
the mode the bar should follow the target in
Gradient MoreMountains.Tools.MMHealthBar.ForegroundColor |
if the healthbar is drawn, the color of its foreground
Vector3 MoreMountains.Tools.MMHealthBar.HealthBarOffset = new Vector3(0f,1f,0f) |
the offset to apply to the healthbar compared to the object's center
MMProgressBar MoreMountains.Tools.MMHealthBar.HealthBarPrefab |
the prefab to use as the health bar
HealthBarTypes MoreMountains.Tools.MMHealthBar.HealthBarType = HealthBarTypes.Drawn |
whether the healthbar uses a prefab or is drawn automatically
bool MoreMountains.Tools.MMHealthBar.HideBarAtZero = true |
if this is set to true the bar will hide itself when it reaches zero
float MoreMountains.Tools.MMHealthBar.HideBarAtZeroDelay = 1f |
the delay (in seconds) after which to hide the bar
Vector3 MoreMountains.Tools.MMHealthBar.InitialRotationAngles |
the rotation to apply to the MMHealthBarContainer when drawing it
GameObject MoreMountains.Tools.MMHealthBar.InstantiatedOnDeath |
a gameobject (usually a particle system) to instantiate when the healthbar reaches zero
bool MoreMountains.Tools.MMHealthBar.LerpDelayedBar = true |
whether or not the delayed bar should lerp
float MoreMountains.Tools.MMHealthBar.LerpDelayedBarSpeed = 15f |
the speed at which the delayed bar lerps
bool MoreMountains.Tools.MMHealthBar.LerpFrontBar = true |
whether or not the front bar should lerp
float MoreMountains.Tools.MMHealthBar.LerpFrontBarSpeed = 15f |
the speed at which the front bar lerps
bool MoreMountains.Tools.MMHealthBar.NestDrawnHealthBar = false |
Vector2 MoreMountains.Tools.MMHealthBar.Size = new Vector2(1f,0.2f) |
if the healthbar is drawn, its size in world units
string MoreMountains.Tools.MMHealthBar.SortingLayerName = "UI" |
the name of the sorting layer to put this health bar on
TimeScales MoreMountains.Tools.MMHealthBar.TimeScale = TimeScales.UnscaledTime |
defines whether the bar will work on scaled or unscaled time (whether or not it'll keep moving if time is slowed down for example)