Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
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 { LocalScale , FillAmount , Width , Height }
 the possible fill modes More...
enum  BarDirections { LeftToRight , RightToLeft , UpToDown , DownToUp }
 the possible directions for the fill (for local scale and fill amount only) More...
enum  TimeScales { UnscaledTime , 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.
virtual void Bump ()
 Triggers a camera bump.

Public Attributes

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

Protected Member Functions

virtual void Start ()
 On start we store our image component.
virtual void Update ()
 On Update we update our bars.
virtual void AutoUpdate ()
virtual void UpdateFrontBar ()
 Updates the front bar's scale.
virtual void UpdateDelayedBar ()
 Updates the delayed bar's scale.
virtual IEnumerator BumpCoroutine ()
 A coroutine that (usually quickly) changes the scale of the bar.
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

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:
  • H:/Code/MoreMountains/feel/Assets/Feel/NiceVibrations/Demo/Common/Scripts/UI/MMProgressBar.cs