Feel  5.1
The best way to improve your game's feel and make it extra juicy
Lofelt.NiceVibrations.MMProgressBar Class Reference

Add this bar to an object and link it to a bar (possibly the same object the script is on), and you'll be able to resize the bar object based on a current value, located between a min and max value. See the HealthBar.cs script for a use case More...

Inheritance diagram for Lofelt.NiceVibrations.MMProgressBar:

Public Types

enum  FillModes { FillModes.LocalScale, FillModes.FillAmount, FillModes.Width, FillModes.Height }
 the possible fill modes More...
 
enum  BarDirections { BarDirections.LeftToRight, BarDirections.RightToLeft, BarDirections.UpToDown, BarDirections.DownToUp }
 the possible directions for the fill (for local scale and fill amount only) More...
 
enum  TimeScales { TimeScales.UnscaledTime, TimeScales.Time }
 the possible timescales the bar can work on More...
 

Public Member Functions

virtual void UpdateBar (float currentValue, float minValue, float maxValue)
 Updates the bar's values based on the specified parameters More...
 
virtual void Bump ()
 Triggers a camera bump More...
 

Public Attributes

float StartValue = 0f
 the local scale or fillamount value to reach when the bar is empty More...
 
float EndValue = 1f
 the local scale or fillamount value to reach when the bar is full More...
 
BarDirections BarDirection = BarDirections.LeftToRight
 the direction this bar moves to More...
 
FillModes FillMode = FillModes.LocalScale
 the foreground bar's fill mode 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...
 
bool LerpForegroundBar = true
 whether or not the foreground bar should lerp More...
 
float LerpForegroundBarSpeed = 15f
 the speed at which to lerp the foreground bar More...
 
float Delay = 1f
 the delay before the delayed bar moves (in seconds) More...
 
bool LerpDelayedBar = true
 whether or not the delayed bar's animation should lerp More...
 
float LerpDelayedBarSpeed = 15f
 the speed at which to lerp the delayed bar More...
 
string PlayerID
 optional - the ID of the player associated to this bar More...
 
Transform DelayedBar
 the delayed bar More...
 
Transform ForegroundBar
 the main, foreground bar More...
 
bool BumpScaleOnChange = true
 whether or not the bar should "bump" when changing value More...
 
bool BumpOnIncrease = false
 whether or not the bar should bump when its value increases More...
 
float BumpDuration = 0.2f
 the duration of the bump animation More...
 
bool ChangeColorWhenBumping = true
 whether or not the bar should flash when bumping More...
 
Color BumpColor = Color.white
 the color to apply to the bar when bumping More...
 
AnimationCurve BumpAnimationCurve = new AnimationCurve(new Keyframe(1, 1), new Keyframe(0.3f, 1.05f), new Keyframe(1, 1))
 the curve to map the bump animation on More...
 
AnimationCurve BumpColorAnimationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))
 the curve to map the bump animation color animation on More...
 
bool AutoUpdating = false
 whether or not this progress bar should update itself every update (if not, you'll have to update it using the UpdateBar method More...
 
float BarProgress
 the current progress of the bar More...
 

Protected Member Functions

virtual void Start ()
 On start we store our image component More...
 
virtual void Update ()
 On Update we update our bars More...
 
virtual void AutoUpdate ()
 
virtual void UpdateFrontBar ()
 Updates the front bar's scale More...
 
virtual void UpdateDelayedBar ()
 Updates the delayed bar's scale More...
 
virtual IEnumerator BumpCoroutine ()
 A coroutine that (usually quickly) changes the scale of the bar More...
 
virtual float Remap (float x, float A, float B, float C, float D)
 

Protected Attributes

float _targetFill
 
Vector3 _targetLocalScale = Vector3.one
 
float _newPercent
 
float _lastPercent
 
float _lastUpdateTimestamp
 
bool _bump = false
 
Color _initialColor
 
Vector3 _initialScale
 
Vector3 _newScale
 
Image _foregroundImage
 
Image _delayedImage
 
bool _initialized
 
Vector2 _initialFrontBarSize
 

Properties

bool Bumping [get, protected set]
 whether or not the bar is bumping right now More...
 

Detailed Description

Add this bar to an object and link it to a bar (possibly the same object the script is on), and you'll be able to resize the bar object based on a current value, located between a min and max value. See the HealthBar.cs script for a use case

Member Enumeration Documentation

◆ BarDirections

the possible directions for the fill (for local scale and fill amount only)

Enumerator
LeftToRight 
RightToLeft 
UpToDown 
DownToUp 

◆ FillModes

the possible fill modes

Enumerator
LocalScale 
FillAmount 
Width 
Height 

◆ TimeScales

the possible timescales the bar can work on

Enumerator
UnscaledTime 
Time 

Member Function Documentation

◆ AutoUpdate()

virtual void Lofelt.NiceVibrations.MMProgressBar.AutoUpdate ( )
protectedvirtual

◆ Bump()

virtual void Lofelt.NiceVibrations.MMProgressBar.Bump ( )
virtual

Triggers a camera bump

◆ BumpCoroutine()

virtual IEnumerator Lofelt.NiceVibrations.MMProgressBar.BumpCoroutine ( )
protectedvirtual

A coroutine that (usually quickly) changes the scale of the bar

Returns
The coroutine.

◆ Remap()

virtual float Lofelt.NiceVibrations.MMProgressBar.Remap ( float  x,
float  A,
float  B,
float  C,
float  D 
)
protectedvirtual

◆ Start()

virtual void Lofelt.NiceVibrations.MMProgressBar.Start ( )
protectedvirtual

On start we store our image component

◆ Update()

virtual void Lofelt.NiceVibrations.MMProgressBar.Update ( )
protectedvirtual

On Update we update our bars

◆ UpdateBar()

virtual void Lofelt.NiceVibrations.MMProgressBar.UpdateBar ( float  currentValue,
float  minValue,
float  maxValue 
)
virtual

Updates the bar's values based on the specified parameters

Parameters
currentValueCurrent value.
minValueMinimum value.
maxValueMax value.

◆ UpdateDelayedBar()

virtual void Lofelt.NiceVibrations.MMProgressBar.UpdateDelayedBar ( )
protectedvirtual

Updates the delayed bar's scale

◆ UpdateFrontBar()

virtual void Lofelt.NiceVibrations.MMProgressBar.UpdateFrontBar ( )
protectedvirtual

Updates the front bar's scale

Member Data Documentation

◆ _bump

bool Lofelt.NiceVibrations.MMProgressBar._bump = false
protected

◆ _delayedImage

Image Lofelt.NiceVibrations.MMProgressBar._delayedImage
protected

◆ _foregroundImage

Image Lofelt.NiceVibrations.MMProgressBar._foregroundImage
protected

◆ _initialColor

Color Lofelt.NiceVibrations.MMProgressBar._initialColor
protected

◆ _initialFrontBarSize

Vector2 Lofelt.NiceVibrations.MMProgressBar._initialFrontBarSize
protected

◆ _initialized

bool Lofelt.NiceVibrations.MMProgressBar._initialized
protected

◆ _initialScale

Vector3 Lofelt.NiceVibrations.MMProgressBar._initialScale
protected

◆ _lastPercent

float Lofelt.NiceVibrations.MMProgressBar._lastPercent
protected

◆ _lastUpdateTimestamp

float Lofelt.NiceVibrations.MMProgressBar._lastUpdateTimestamp
protected

◆ _newPercent

float Lofelt.NiceVibrations.MMProgressBar._newPercent
protected

◆ _newScale

Vector3 Lofelt.NiceVibrations.MMProgressBar._newScale
protected

◆ _targetFill

float Lofelt.NiceVibrations.MMProgressBar._targetFill
protected

◆ _targetLocalScale

Vector3 Lofelt.NiceVibrations.MMProgressBar._targetLocalScale = Vector3.one
protected

◆ AutoUpdating

bool Lofelt.NiceVibrations.MMProgressBar.AutoUpdating = false

whether or not this progress bar should update itself every update (if not, you'll have to update it using the UpdateBar method

◆ BarDirection

BarDirections Lofelt.NiceVibrations.MMProgressBar.BarDirection = BarDirections.LeftToRight

the direction this bar moves to

◆ BarProgress

float Lofelt.NiceVibrations.MMProgressBar.BarProgress

the current progress of the bar

◆ BumpAnimationCurve

AnimationCurve Lofelt.NiceVibrations.MMProgressBar.BumpAnimationCurve = new AnimationCurve(new Keyframe(1, 1), new Keyframe(0.3f, 1.05f), new Keyframe(1, 1))

the curve to map the bump animation on

◆ BumpColor

Color Lofelt.NiceVibrations.MMProgressBar.BumpColor = Color.white

the color to apply to the bar when bumping

◆ BumpColorAnimationCurve

AnimationCurve Lofelt.NiceVibrations.MMProgressBar.BumpColorAnimationCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.3f, 1f), new Keyframe(1, 0))

the curve to map the bump animation color animation on

◆ BumpDuration

float Lofelt.NiceVibrations.MMProgressBar.BumpDuration = 0.2f

the duration of the bump animation

◆ BumpOnIncrease

bool Lofelt.NiceVibrations.MMProgressBar.BumpOnIncrease = false

whether or not the bar should bump when its value increases

◆ BumpScaleOnChange

bool Lofelt.NiceVibrations.MMProgressBar.BumpScaleOnChange = true

whether or not the bar should "bump" when changing value

◆ ChangeColorWhenBumping

bool Lofelt.NiceVibrations.MMProgressBar.ChangeColorWhenBumping = true

whether or not the bar should flash when bumping

◆ Delay

float Lofelt.NiceVibrations.MMProgressBar.Delay = 1f

the delay before the delayed bar moves (in seconds)

◆ DelayedBar

Transform Lofelt.NiceVibrations.MMProgressBar.DelayedBar

the delayed bar

◆ EndValue

float Lofelt.NiceVibrations.MMProgressBar.EndValue = 1f

the local scale or fillamount value to reach when the bar is full

◆ FillMode

FillModes Lofelt.NiceVibrations.MMProgressBar.FillMode = FillModes.LocalScale

the foreground bar's fill mode

◆ ForegroundBar

Transform Lofelt.NiceVibrations.MMProgressBar.ForegroundBar

the main, foreground bar

◆ LerpDelayedBar

bool Lofelt.NiceVibrations.MMProgressBar.LerpDelayedBar = true

whether or not the delayed bar's animation should lerp

◆ LerpDelayedBarSpeed

float Lofelt.NiceVibrations.MMProgressBar.LerpDelayedBarSpeed = 15f

the speed at which to lerp the delayed bar

◆ LerpForegroundBar

bool Lofelt.NiceVibrations.MMProgressBar.LerpForegroundBar = true

whether or not the foreground bar should lerp

◆ LerpForegroundBarSpeed

float Lofelt.NiceVibrations.MMProgressBar.LerpForegroundBarSpeed = 15f

the speed at which to lerp the foreground bar

◆ PlayerID

string Lofelt.NiceVibrations.MMProgressBar.PlayerID

optional - the ID of the player associated to this bar

◆ StartValue

float Lofelt.NiceVibrations.MMProgressBar.StartValue = 0f

the local scale or fillamount value to reach when the bar is empty

◆ TimeScale

TimeScales Lofelt.NiceVibrations.MMProgressBar.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)

Property Documentation

◆ Bumping

bool Lofelt.NiceVibrations.MMProgressBar.Bumping
getprotected set

whether or not the bar is bumping right now


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