Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Transform.SetAsLastSibling

Switch to Manual
public function SetAsLastSibling(): void;

Description

Move the transform to the end of the local transfrom list.

#pragma strict
//Required when using UI Elements.
// Required when using event data.
public var panelRectTransform;
//Invoked when the mouse pointer goes down on a UI element. 
public function OnPointerDown(data) {
	// Puts the panel to the front as it is now the last UI element to be drawn.
	panelRectTransform.SetAsLastSibling();
}