C# Class UISlider, Hero.Coli

Inheritance: AutoSpriteControlBase
Mostrar archivo Open project: CyberCRI/Hero.Coli Class Usage Examples

Public Properties

Property Type Description
current UISlider,
direction Direction,
eventReceiver GameObject
foreground Transform
functionName string
numberOfSteps int
onValueChange OnValueChange
thumb Transform

Public Methods

Method Description
Awake ( ) : void

Ensure that we have a background and a foreground object to work with.

ForceUpdate ( ) : void

Force-update the slider. Useful if you've changed the properties and want it to update visually.

Init ( ) : void

Initialize the cached values.

OnDrag ( Vector2 delta ) : void

When dragged, figure out where the mouse is and calculate the updated value of the slider.

OnDragThumb ( GameObject go, Vector2 delta ) : void

Callback from the thumb.

OnKey ( KeyCode, key ) : void

Watch for key events and adjust the value accordingly.

OnPress ( bool pressed ) : void

Update the slider's position on press.

OnPressThumb ( GameObject go, bool pressed ) : void

Callback from the thumb.

Set ( float input, bool force ) : void

Update the visible slider.

Start ( ) : void

We want to receive drag events from the thumb.

UpdateDrag ( ) : void

Update the slider's position based on the mouse.

Method Details

Awake() public method

Ensure that we have a background and a foreground object to work with.
public Awake ( ) : void
return void

ForceUpdate() public method

Force-update the slider. Useful if you've changed the properties and want it to update visually.
public ForceUpdate ( ) : void
return void

Init() public method

Initialize the cached values.
public Init ( ) : void
return void

OnDrag() public method

When dragged, figure out where the mouse is and calculate the updated value of the slider.
public OnDrag ( Vector2 delta ) : void
delta Vector2
return void

OnDragThumb() public method

Callback from the thumb.
public OnDragThumb ( GameObject go, Vector2 delta ) : void
go GameObject
delta Vector2
return void

OnKey() public method

Watch for key events and adjust the value accordingly.
public OnKey ( KeyCode, key ) : void
key KeyCode,
return void

OnPress() public method

Update the slider's position on press.
public OnPress ( bool pressed ) : void
pressed bool
return void

OnPressThumb() public method

Callback from the thumb.
public OnPressThumb ( GameObject go, bool pressed ) : void
go GameObject
pressed bool
return void

Set() public method

Update the visible slider.
public Set ( float input, bool force ) : void
input float
force bool
return void

Start() public method

We want to receive drag events from the thumb.
public Start ( ) : void
return void

UpdateDrag() public method

Update the slider's position based on the mouse.
public UpdateDrag ( ) : void
return void

Property Details

current static_oe public_oe property

Current slider. This value is set prior to the callback function being triggered.
static public UISlider, current
return UISlider,

direction public_oe property

Direction the slider will expand in.
public Direction, direction
return Direction,

eventReceiver public_oe property

Event receiver that will be notified of the value changes.
public GameObject eventReceiver
return GameObject

foreground public_oe property

Object used for the foreground.
public Transform foreground
return Transform

functionName public_oe property

Function on the event receiver that will receive the value changes.
public string functionName
return string

numberOfSteps public_oe property

Number of steps the slider should be divided into. For example 5 means possible values of 0, 0.25, 0.5, 0.75, and 1.0.
public int numberOfSteps
return int

onValueChange public_oe property

Allow for delegate-based subscriptions for faster events than 'eventReceiver', and allowing for multiple receivers.
public OnValueChange onValueChange
return OnValueChange

thumb public_oe property

Object that acts as a thumb.
public Transform thumb
return Transform