概要
using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var gameObject = Selection.activeGameObject; var isChild = !PrefabUtility.IsAnyPrefabInstanceRoot( gameObject ); Debug.Log( isChild ); } }