C# Class UIScrollBar, Hero.Coli

Inheritance: MonoBehaviour
Show file Open project: CyberCRI/Hero.Coli Class Usage Examples

Public Properties

Property Type Description
onChange OnScrollBarChange
onDragFinished OnDragFinished

Public Methods

Method Description
CenterOnPos ( Vector2 localPos ) : void

Move the scroll bar to be centered on the specified position.

ForceUpdate ( ) : void

Update the value of the scroll bar.

OnDragBackground ( GameObject go, Vector2 delta ) : void

Position the scroll bar to be under the current touch.

OnDragForeground ( GameObject go, Vector2 delta ) : void

Drag the scroll bar in the specified direction.

OnPressBackground ( GameObject go, bool isPressed ) : void

Position the scroll bar to be under the current touch.

OnPressForeground ( GameObject go, bool isPressed ) : void

Save the position of the foreground on press.

Reposition ( Vector2 screenPos ) : void

Drag the scroll bar by the specified on-screen amount.

Start ( ) : void

Register the event listeners.

Update ( ) : void

Update the value of the scroll bar if necessary.

Method Details

CenterOnPos() public method

Move the scroll bar to be centered on the specified position.
public CenterOnPos ( Vector2 localPos ) : void
localPos Vector2
return void

ForceUpdate() public method

Update the value of the scroll bar.
public ForceUpdate ( ) : void
return void

OnDragBackground() public method

Position the scroll bar to be under the current touch.
public OnDragBackground ( GameObject go, Vector2 delta ) : void
go GameObject
delta Vector2
return void

OnDragForeground() public method

Drag the scroll bar in the specified direction.
public OnDragForeground ( GameObject go, Vector2 delta ) : void
go GameObject
delta Vector2
return void

OnPressBackground() public method

Position the scroll bar to be under the current touch.
public OnPressBackground ( GameObject go, bool isPressed ) : void
go GameObject
isPressed bool
return void

OnPressForeground() public method

Save the position of the foreground on press.
public OnPressForeground ( GameObject go, bool isPressed ) : void
go GameObject
isPressed bool
return void

Reposition() public method

Drag the scroll bar by the specified on-screen amount.
public Reposition ( Vector2 screenPos ) : void
screenPos Vector2
return void

Start() public method

Register the event listeners.
public Start ( ) : void
return void

Update() public method

Update the value of the scroll bar if necessary.
public Update ( ) : void
return void

Property Details

onChange public property

Delegate triggered when the scroll bar has changed visibly.
public OnScrollBarChange onChange
return OnScrollBarChange

onDragFinished public property

Delegate triggered when the scroll bar stops being dragged. Useful for things like centering on the closest valid object, for example.
public OnDragFinished onDragFinished
return OnDragFinished