ドキュメント

Unity Engine

Unity Engine

root

Returns the topmost transform in the hierarchy.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public TransformHandle root { get; }

Remarks

(This never returns TransformHandle.None, if this TransformHandle doesn't have a parent it returns itself.)

Examples

using UnityEngine;public class Example : MonoBehaviour{ public GameObject Other; // Dos this have the same root as other transform? void Start() { if (Other.transformHandle.root != transformHandle.root) { print("The objects are not in the same hierarchy"); } }}