Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

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

Transform.SetAsFirstSibling

Switch to Manual
public function SetAsFirstSibling(): void;

Description

Move the transform to the start of the local transform 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 back as it is now the first UI element to be drawn.
    panelRectTransform.SetAsFirstSibling();
}

Did you find this page useful? Please give it a rating: