Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Selectable.FindSelectableOnLeft

Switch to Manual
public function FindSelectableOnLeft(): UI.Selectable;

Returns

Selectable The Selectable object to the left of current.

Description

Find the selectable object to the left of this one.

#pragma strict
// required when using UI elements in scripts
public var btnMain;
public function Start() {
	//Finds and assigns the selectable to the left of the main button.
	var newSelectable = btnMain.FindSelectableOnLeft();
	Debug.Log(newSelectable.name);
}