|
Highroad Engine v1.3
|
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...
Public Types | |
| enum | MMProgressBarStates { Idle , Decreasing , Increasing , InDecreasingDelay , InIncreasingDelay } |
| enum | FillModes { LocalScale , FillAmount , Width , Height , Anchor } |
| 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... | |
| enum | BarFillModes { SpeedBased , FixedDuration } |
| the possible ways to animate the bar fill More... | |
Public Member Functions | |
| virtual void | UpdateBar01 (float normalizedValue) |
| Updates the bar's values, using a normalized value More... | |
| virtual void | UpdateBar (float currentValue, float minValue, float maxValue) |
| Updates the bar's values based on the specified parameters More... | |
| virtual void | SetBar (float currentValue, float minValue, float maxValue) |
| Sets the bar value to the one specified More... | |
| virtual void | SetBar01 (float newPercent) |
| Sets the bar value to the normalized value set in parameter More... | |
| virtual void | Initialization () |
| virtual void | Plus10Percent () |
| Test method More... | |
| virtual void | Minus10Percent () |
| Test method More... | |
| virtual void | Bump () |
| Triggers a camera bump More... | |
| virtual void | ShowBar () |
| A simple method you can call to show the bar (set active true) More... | |
| virtual void | HideBar (float delay) |
| Hides (SetActive false) the progress bar object, after an optional delay More... | |
Public Attributes | |
| string | PlayerID |
| optional - the ID of the player associated to this bar More... | |
| Transform | ForegroundBar |
| the main, foreground bar More... | |
| Transform | DelayedBarDecreasing |
| the delayed bar that will show when moving from a value to a new, lower value More... | |
| Transform | DelayedBarIncreasing |
| the delayed bar that will show when moving from a value to a new, higher value More... | |
| float | MinimumBarFillValue = 0f |
| the local scale or fillamount value to reach when the value associated to the bar is at 0% More... | |
| float | MaximumBarFillValue = 1f |
| the local scale or fillamount value to reach when the bar is full More... | |
| bool | SetInitialFillValueOnStart = false |
| whether or not to initialize the value of the bar on start More... | |
| float | InitialFillValue = 0f |
| the initial value of the bar 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... | |
| BarFillModes | BarFillMode = BarFillModes.SpeedBased |
| the selected fill animation mode More... | |
| bool | LerpForegroundBar = true |
| whether or not the foreground bar should lerp More... | |
| float | LerpForegroundBarSpeedDecreasing = 15f |
| the speed at which to lerp the foreground bar More... | |
| float | LerpForegroundBarSpeedIncreasing = 15f |
| float | LerpForegroundBarDurationDecreasing = 0.2f |
| float | LerpForegroundBarDurationIncreasing = 0.2f |
| the duration each update of the foreground bar should take (only if in fixed duration bar fill mode) More... | |
| AnimationCurve | LerpForegroundBarCurveDecreasing = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
| the curve to use when animating the foreground bar fill More... | |
| AnimationCurve | LerpForegroundBarCurveIncreasing = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
| float | DecreasingDelay = 1f |
| the delay before the delayed bar moves (in seconds) More... | |
| bool | LerpDecreasingDelayedBar = true |
| whether or not the delayed bar's animation should lerp More... | |
| float | LerpDecreasingDelayedBarSpeed = 15f |
| the speed at which to lerp the delayed bar More... | |
| float | LerpDecreasingDelayedBarDuration = 0.2f |
| the duration each update of the foreground bar should take (only if in fixed duration bar fill mode) More... | |
| AnimationCurve | LerpDecreasingDelayedBarCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
| the curve to use when animating the delayed bar fill More... | |
| float | IncreasingDelay = 1f |
| the delay before the delayed bar moves (in seconds) More... | |
| bool | LerpIncreasingDelayedBar = true |
| whether or not the delayed bar's animation should lerp More... | |
| float | LerpIncreasingDelayedBarSpeed = 15f |
| the speed at which to lerp the delayed bar More... | |
| float | LerpIncreasingDelayedBarDuration = 0.2f |
| the duration each update of the foreground bar should take (only if in fixed duration bar fill mode) More... | |
| AnimationCurve | LerpIncreasingDelayedBarCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
| the curve to use when animating the delayed bar fill 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... | |
| bool | BumpOnDecrease = false |
| whether or not the bar should bump when its value decreases 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 | BumpScaleAnimationCurve = 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... | |
| UnityEvent | OnBump |
| an event to trigger every time the bar bumps More... | |
| UnityEvent | OnBarMovementDecreasingStart |
| UnityEvent | OnBarMovementDecreasingStop |
| UnityEvent | OnBarMovementIncreasingStart |
| UnityEvent | OnBarMovementIncreasingStop |
| Text | PercentageText |
| string | TextPrefix |
| string | TextSuffix |
| float | TextValueMultiplier = 1f |
| string | TextFormat = "{000}" |
| float | DebugNewTargetValue |
| the value the bar will move to if you press the DebugSet button More... | |
| bool | DebugUpdateBarButton |
| bool | DebugSetBarButton |
| bool | TestBumpButton |
| bool | Plus10PercentButton |
| bool | Minus10PercentButton |
| float | BarProgress |
| the current progress of the bar, ideally read only More... | |
| float | BarTarget |
| the current progress of the bar, ideally read only More... | |
| float | DelayedBarIncreasingProgress |
| float | DelayedBarDecreasingProgress |
Protected Member Functions | |
| virtual void | Start () |
| On start we store our image component More... | |
| virtual void | OnEnable () |
| virtual void | DebugUpdateBar () |
| This test method, called via the inspector button of the same name, lets you test what happens when you update the bar to a certain value More... | |
| virtual void | DebugSetBar () |
| Test method More... | |
| virtual void | UpdateText () |
| virtual IEnumerator | UpdateBarsCo () |
| On Update we update our bars More... | |
| virtual void | DetermineDeltaTime () |
| virtual void | DetermineDirection () |
| virtual void | UpdateBars () |
| Updates the foreground bar's scale More... | |
| virtual float | ComputeNewFill (bool lerpBar, float barSpeed, float barDuration, AnimationCurve barCurve, float delay, float lastPercent, out float t) |
| virtual void | SetBarInternal (float newAmount, Transform bar, Image image, Vector2 initialSize) |
| virtual IEnumerator | BumpCoroutine () |
| A coroutine that (usually quickly) changes the scale of the bar More... | |
| virtual IEnumerator | HideBarCo (float delay) |
| An internal coroutine used to handle the disabling of the progress bar after a delay More... | |
Protected Attributes | |
| bool | _initialized |
| Vector2 | _initialBarSize |
| Color | _initialColor |
| Vector3 | _initialScale |
| Image | _foregroundImage |
| Image | _delayedDecreasingImage |
| Image | _delayedIncreasingImage |
| Vector3 | _targetLocalScale = Vector3.one |
| float | _newPercent |
| float | _percentLastTimeBarWasUpdated |
| float | _lastUpdateTimestamp |
| float | _time |
| float | _deltaTime |
| int | _direction |
| Coroutine | _coroutine |
| bool | _coroutineShouldRun = false |
| bool | _isDelayedBarIncreasingNotNull |
| bool | _isDelayedBarDecreasingNotNull |
| bool | _actualUpdate |
| Vector2 | _anchorVector |
| float | _delayedBarDecreasingProgress |
| float | _delayedBarIncreasingProgress |
| MMProgressBarStates | CurrentState = MMProgressBarStates.Idle |
Properties | |
| bool | Bumping [getprotected set] |
| whether or not the bar is bumping right now More... | |
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
|
virtual |
Triggers a camera bump
|
protectedvirtual |
A coroutine that (usually quickly) changes the scale of the bar
|
protectedvirtual |
|
protectedvirtual |
Test method
|
protectedvirtual |
This test method, called via the inspector button of the same name, lets you test what happens when you update the bar to a certain value
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Hides (SetActive false) the progress bar object, after an optional delay
| delay |
|
protectedvirtual |
An internal coroutine used to handle the disabling of the progress bar after a delay
| delay |
|
virtual |
|
virtual |
Test method
|
protectedvirtual |
|
virtual |
Test method
|
virtual |
Sets the bar value to the one specified
| currentValue | |
| minValue | |
| maxValue |
|
virtual |
Sets the bar value to the normalized value set in parameter
| newPercent |
|
protectedvirtual |
|
virtual |
A simple method you can call to show the bar (set active true)
|
protectedvirtual |
On start we store our image component
|
virtual |
Updates the bar's values based on the specified parameters
| currentValue | Current value. |
| minValue | Minimum value. |
| maxValue | Max value. |
|
virtual |
Updates the bar's values, using a normalized value
| normalizedValue |
|
protectedvirtual |
Updates the foreground bar's scale
|
protectedvirtual |
On Update we update our bars
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| BarDirections MoreMountains.Tools.MMProgressBar.BarDirection = BarDirections.LeftToRight |
the direction this bar moves to
| BarFillModes MoreMountains.Tools.MMProgressBar.BarFillMode = BarFillModes.SpeedBased |
the selected fill animation mode
| float MoreMountains.Tools.MMProgressBar.BarProgress |
the current progress of the bar, ideally read only
| float MoreMountains.Tools.MMProgressBar.BarTarget |
the current progress of the bar, ideally read only
| Color MoreMountains.Tools.MMProgressBar.BumpColor = Color.white |
the color to apply to the bar when bumping
| AnimationCurve MoreMountains.Tools.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
| float MoreMountains.Tools.MMProgressBar.BumpDuration = 0.2f |
the duration of the bump animation
| bool MoreMountains.Tools.MMProgressBar.BumpOnDecrease = false |
whether or not the bar should bump when its value decreases
| bool MoreMountains.Tools.MMProgressBar.BumpOnIncrease = false |
whether or not the bar should bump when its value increases
| AnimationCurve MoreMountains.Tools.MMProgressBar.BumpScaleAnimationCurve = new AnimationCurve(new Keyframe(1, 1), new Keyframe(0.3f, 1.05f), new Keyframe(1, 1)) |
the curve to map the bump animation on
| bool MoreMountains.Tools.MMProgressBar.BumpScaleOnChange = true |
whether or not the bar should "bump" when changing value
| bool MoreMountains.Tools.MMProgressBar.ChangeColorWhenBumping = true |
whether or not the bar should flash when bumping
|
protected |
| float MoreMountains.Tools.MMProgressBar.DebugNewTargetValue |
the value the bar will move to if you press the DebugSet button
| bool MoreMountains.Tools.MMProgressBar.DebugSetBarButton |
| bool MoreMountains.Tools.MMProgressBar.DebugUpdateBarButton |
| float MoreMountains.Tools.MMProgressBar.DecreasingDelay = 1f |
the delay before the delayed bar moves (in seconds)
| Transform MoreMountains.Tools.MMProgressBar.DelayedBarDecreasing |
the delayed bar that will show when moving from a value to a new, lower value
| float MoreMountains.Tools.MMProgressBar.DelayedBarDecreasingProgress |
| Transform MoreMountains.Tools.MMProgressBar.DelayedBarIncreasing |
the delayed bar that will show when moving from a value to a new, higher value
| float MoreMountains.Tools.MMProgressBar.DelayedBarIncreasingProgress |
| FillModes MoreMountains.Tools.MMProgressBar.FillMode = FillModes.LocalScale |
the foreground bar's fill mode
| Transform MoreMountains.Tools.MMProgressBar.ForegroundBar |
the main, foreground bar
| float MoreMountains.Tools.MMProgressBar.IncreasingDelay = 1f |
the delay before the delayed bar moves (in seconds)
| float MoreMountains.Tools.MMProgressBar.InitialFillValue = 0f |
the initial value of the bar
| bool MoreMountains.Tools.MMProgressBar.LerpDecreasingDelayedBar = true |
whether or not the delayed bar's animation should lerp
| AnimationCurve MoreMountains.Tools.MMProgressBar.LerpDecreasingDelayedBarCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
the curve to use when animating the delayed bar fill
| float MoreMountains.Tools.MMProgressBar.LerpDecreasingDelayedBarDuration = 0.2f |
the duration each update of the foreground bar should take (only if in fixed duration bar fill mode)
| float MoreMountains.Tools.MMProgressBar.LerpDecreasingDelayedBarSpeed = 15f |
the speed at which to lerp the delayed bar
| bool MoreMountains.Tools.MMProgressBar.LerpForegroundBar = true |
whether or not the foreground bar should lerp
| AnimationCurve MoreMountains.Tools.MMProgressBar.LerpForegroundBarCurveDecreasing = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
the curve to use when animating the foreground bar fill
| AnimationCurve MoreMountains.Tools.MMProgressBar.LerpForegroundBarCurveIncreasing = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
| float MoreMountains.Tools.MMProgressBar.LerpForegroundBarDurationDecreasing = 0.2f |
| float MoreMountains.Tools.MMProgressBar.LerpForegroundBarDurationIncreasing = 0.2f |
the duration each update of the foreground bar should take (only if in fixed duration bar fill mode)
| float MoreMountains.Tools.MMProgressBar.LerpForegroundBarSpeedDecreasing = 15f |
the speed at which to lerp the foreground bar
| float MoreMountains.Tools.MMProgressBar.LerpForegroundBarSpeedIncreasing = 15f |
| bool MoreMountains.Tools.MMProgressBar.LerpIncreasingDelayedBar = true |
whether or not the delayed bar's animation should lerp
| AnimationCurve MoreMountains.Tools.MMProgressBar.LerpIncreasingDelayedBarCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) |
the curve to use when animating the delayed bar fill
| float MoreMountains.Tools.MMProgressBar.LerpIncreasingDelayedBarDuration = 0.2f |
the duration each update of the foreground bar should take (only if in fixed duration bar fill mode)
| float MoreMountains.Tools.MMProgressBar.LerpIncreasingDelayedBarSpeed = 15f |
the speed at which to lerp the delayed bar
| float MoreMountains.Tools.MMProgressBar.MaximumBarFillValue = 1f |
the local scale or fillamount value to reach when the bar is full
| float MoreMountains.Tools.MMProgressBar.MinimumBarFillValue = 0f |
the local scale or fillamount value to reach when the value associated to the bar is at 0%
| bool MoreMountains.Tools.MMProgressBar.Minus10PercentButton |
| UnityEvent MoreMountains.Tools.MMProgressBar.OnBarMovementDecreasingStart |
| UnityEvent MoreMountains.Tools.MMProgressBar.OnBarMovementDecreasingStop |
| UnityEvent MoreMountains.Tools.MMProgressBar.OnBarMovementIncreasingStart |
| UnityEvent MoreMountains.Tools.MMProgressBar.OnBarMovementIncreasingStop |
| UnityEvent MoreMountains.Tools.MMProgressBar.OnBump |
an event to trigger every time the bar bumps
| Text MoreMountains.Tools.MMProgressBar.PercentageText |
| string MoreMountains.Tools.MMProgressBar.PlayerID |
optional - the ID of the player associated to this bar
| bool MoreMountains.Tools.MMProgressBar.Plus10PercentButton |
| bool MoreMountains.Tools.MMProgressBar.SetInitialFillValueOnStart = false |
whether or not to initialize the value of the bar on start
| bool MoreMountains.Tools.MMProgressBar.TestBumpButton |
| string MoreMountains.Tools.MMProgressBar.TextFormat = "{000}" |
| string MoreMountains.Tools.MMProgressBar.TextPrefix |
| string MoreMountains.Tools.MMProgressBar.TextSuffix |
| float MoreMountains.Tools.MMProgressBar.TextValueMultiplier = 1f |
| TimeScales MoreMountains.Tools.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)
|
getprotected set |
whether or not the bar is bumping right now