Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

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

Slider.fillRect

Switch to Manual
public var fillRect: RectTransform;

Description

Optional RectTransform to use as fill for the slider.

#pragma strict
// Required when Using UI elements.
public class Example {
	public var mainSlider;
	public var newFillRect;
	//Deactivates the old FillRect and assigns a new one.
	function Start() {
		mainSlider.fillRect.gameObject.SetActive(false);
		mainSlider.fillRect = newFillRect;
	}
}