Script documentation

Slider.cs in TinyGiantStudio.Text namespace

If anything except method names starts with a capital letter, it's a property.

Utility

Variables

Variable
Type
Description

CurrentValue

float

The current value.

CurrentPercentage

float

Returns the current value in percentage.

minValue

float

The minimum value allowed by the slider.

maxValue

float

The maximum value allowed by the slider.

autoFocusOnGameStart

bool

If set to true, the slider is focused on awake. The slider is scrollable with a keyboard when focused. If it is in a list, the list controls who to focus on.

interactable

bool

As the name suggests, if it isn't interactable nothing can interact with it and it gets ignored in a list.

directionChoice

int

0 is left to right

Methods

Method
Description

Focus (bool enable)

Changes the current focus state to the parameter.

List GetParentList ()

Returns the parent list if one exists.

Interactable ()

Sets slider to interactable

Uninteractable ()

Sets slider to uninteractable.

GetCurrentValueFromHandle ()

Updates the value of the slider according to position of the handle. Used by raycast selector to update the value after dragging handle.

Events

Variables

Variable
Type
Description

usePercentage

bool

If set to true, uses percentage value to evaluate Value Range Events.

valueRangeEvents

List<ValueRange>

Methods

Method
Description

ValueChanged ()

Calls events after value is changed.

NewValueRange ()

Creates new value range event

Visual

Variables

Variable
Type
Description

handle

SliderHandle

progressBar

Transform

progressBarPrefab

GameObject

background

Transform

backgroundSize

float

unSelectedHandleMat

selectedHandleMat

clickedHandleMat

disabledHandleMat

Methods

Method
Description

UpdateGraphic ()

SelectedVisual ()

UnSelectedVisual ()

ClickedVisual ()

DisabledVisual ()

UpdateBackgroundSize ()

Input

Variable
Type
Description

keyStep

float

Controls how fast the slider moves on input.

Last updated