Search Results for

    Show / Hide Table of Contents

    Class SegmentController

    Synchronizes the progression of three different segments by changing the fill amount of their corresponding Image.
    Also manages the coroutines of the sub-segment shrink animation.

    Inheritance
    object
    SegmentController
    Namespace: TetraCreations.ProgressBarSystem
    Assembly: cs.temp.dll.dll
    Syntax
    public class SegmentController : MonoBehaviour

    Properties

    DecreaseFillAmount

    Declaration
    public float DecreaseFillAmount { get; protected set; }
    Property Value
    Type Description
    float

    DecreaseSegment

    Declaration
    public BarSegment DecreaseSegment { get; protected set; }
    Property Value
    Type Description
    BarSegment

    FillSegment

    Declaration
    public FillSegment FillSegment { get; protected set; }
    Property Value
    Type Description
    FillSegment

    IncreaseFillAmount

    Declaration
    public float IncreaseFillAmount { get; protected set; }
    Property Value
    Type Description
    float

    IncreaseSegment

    Declaration
    public BarSegment IncreaseSegment { get; protected set; }
    Property Value
    Type Description
    BarSegment

    LastIncreaseFillAmount

    Declaration
    public float LastIncreaseFillAmount { get; }
    Property Value
    Type Description
    float

    MainFillAmount

    Declaration
    public float MainFillAmount { get; protected set; }
    Property Value
    Type Description
    float

    ShrinkDelay

    Declaration
    public float ShrinkDelay { get; set; }
    Property Value
    Type Description
    float

    ShrinkSpeed

    Declaration
    public float ShrinkSpeed { get; set; }
    Property Value
    Type Description
    float

    UseAnimationWhenLimitAreChanged

    Declaration
    public bool UseAnimationWhenLimitAreChanged { get; set; }
    Property Value
    Type Description
    bool

    UseLerpToSmooth

    Declaration
    public bool UseLerpToSmooth { get; set; }
    Property Value
    Type Description
    bool

    Methods

    GetActiveSegment()

    Returns the active segment, the one that is currently visible above the fill segment.

    Declaration
    public BarSegment GetActiveSegment()
    Returns
    Type Description
    BarSegment

    GetSegmentFillAmount(SegmentType)

    Returns the FillAmount of a Segement's image

    Declaration
    public float GetSegmentFillAmount(SegmentType segmentType)
    Parameters
    Type Name Description
    SegmentType segmentType
    Returns
    Type Description
    float

    IncrementFillSegmentAmount()

    Increments the current image fill amount until it reachs the same amount of the increasing fill amount after a delay

    Declaration
    protected virtual IEnumerator IncrementFillSegmentAmount()
    Returns
    Type Description
    IEnumerator

    Initialize(float)

    Declaration
    public virtual void Initialize(float fillAmount)
    Parameters
    Type Name Description
    float fillAmount

    InstantlyUpdateDecreasingFilledAmount(float)

    Declaration
    public virtual void InstantlyUpdateDecreasingFilledAmount(float percentage)
    Parameters
    Type Name Description
    float percentage

    InstantlyUpdateFillAmount(float)

    Declaration
    public virtual void InstantlyUpdateFillAmount(float percentage)
    Parameters
    Type Name Description
    float percentage

    InstantlyUpdateIncreasingFilledAmount(float)

    Declaration
    public virtual void InstantlyUpdateIncreasingFilledAmount(float percentage)
    Parameters
    Type Name Description
    float percentage

    IsValid()

    Returns false if at least one Segement is not valid.

    Declaration
    public virtual bool IsValid()
    Returns
    Type Description
    bool

    OnActiveSegmentChanged()

    Raise the ActiveSegmentChangedEvent, we pass the new active segment in SegmentEventArgs.

    Declaration
    protected virtual void OnActiveSegmentChanged()

    SetBackground(Sprite)

    Set the background for all segements

    Declaration
    public void SetBackground(Sprite sprite)
    Parameters
    Type Name Description
    Sprite sprite

    SetSegmentFillAmount(float, SegmentType)

    Sets the FillAmount of the a Segment's image

    Declaration
    public void SetSegmentFillAmount(float amount, SegmentType segmentType)
    Parameters
    Type Name Description
    float amount
    SegmentType segmentType

    ShrinkDecreasingSegment()

    Shrinks the Decreasing image fill amount until it reachs the same amount of the current image fill amount after a delay

    Declaration
    protected virtual IEnumerator ShrinkDecreasingSegment()
    Returns
    Type Description
    IEnumerator

    UpdateDecreasingFilledAmount(float)

    If the decrease segment is enable we interupt the increase amount coroutine, to start the decrease amount coroutine to show how much the Progress Bar lost.

    Declaration
    public virtual void UpdateDecreasingFilledAmount(float percentage)
    Parameters
    Type Name Description
    float percentage

    UpdateFilledAmount(object, ValueChangedEventArgs)

    Every time the ProgressBar percentage changes we update the increasing or decreasing segment with the animation. Unless the progress bar changed because

    Declaration
    public virtual void UpdateFilledAmount(object sender, ValueChangedEventArgs eventArgs)
    Parameters
    Type Name Description
    object sender
    ValueChangedEventArgs eventArgs

    UpdateIncreasingFilledAmount(float)

    If the increase segment is enable we interupt the decrease amount coroutine, to start the increase amount coroutine to show how much the Progress Bar gained.

    Declaration
    public virtual void UpdateIncreasingFilledAmount(float percentage)
    Parameters
    Type Name Description
    float percentage

    Events

    ActiveSegmentChangedEvent

    Declaration
    public event EventHandler<SegmentEventArgs> ActiveSegmentChangedEvent
    Event Type
    Type Description
    System.EventHandler<TEventArgs><SegmentEventArgs>
    In This Article
    Back to top Tetra Creations documentation