Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Slider.direction

Switch to Manual
public var direction: UI.Scrollbar.Direction;

Description

The direction of the slider, from minimum to maximum value.

#pragma strict
// Required when Using UI elements.
public class Example {
	public var mainSlider;
	public function Start() {
		//Changes the direction of the slider.
		if (mainSlider.direction == Slider.Direction.BottomToTop) {
			mainSlider.direction = Slider.Direction.TopToBottom;
		}
	}
}