Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created January 23, 2021 07:00
Embed
What would you like to do?
親オブジェクトが持っている子要素の順番を変更するサンプルです。
using UnityEngine;
/// <Summary>
/// 子要素の順番を変更するスクリプトです。
/// </Summary>
public class SiblingTest : MonoBehaviour
{
// 並び替える対象のゲームオブジェクトです。
public GameObject targetObj;
void Start()
{
// ターゲットを先頭に配置します。
targetObj.transform.SetAsFirstSibling();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment