unity PrefabUtility 接口使用记录

bool isAny = PrefabUtility.IsAnyPrefabInstanceRoot(node);

bool isAdded = PrefabUtility.IsAddedGameObjectOverride(node);

GameObject or = PrefabUtility.GetOutermostPrefabInstanceRoot(node);

GameObject nr = PrefabUtility.GetNearestPrefabInstanceRoot(node);

返回值记录:

|-------------------|-------|---------|-------------------|-------------------|
| | isAny | isAdded | or | nr |
| prefab_oriVariant | True | False | prefab_oriVariant | prefab_oriVariant |
| ori_cube | False | False | prefab_oriVariant | prefab_oriVariant |
| var_Cube | False | True | null | null |
| prefab_ori2 | True | True | prefab_ori2 | prefab_ori2 |
| ori2_Capsule | False | False | prefab_ori2 | prefab_ori2 |
| var_Sphere | False | True | null | null |

相关推荐
timathy331 天前
Unity Addressable 实现Build时自定义剔除资源组
unity·游戏引擎
一种时光2 天前
Unity 获取当前播放的动画,判断是否是某个动画
unity·游戏引擎
速冻鱼Kiel2 天前
Lyra的相机系统
笔记·ue5·游戏引擎·虚幻
不绝1912 天前
Unity入门 :场景叠加/预制体资源包/脚本资源/生命周期函数/Inspector页面
unity·游戏引擎
在路上看风景2 天前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手2 天前
unity对象池
unity·c#
在路上看风景2 天前
3.7 SRP Batcher
unity
快乐觉主吖2 天前
Unity方便修改产品名和包名的小工具
unity·游戏引擎
孟无岐2 天前
【Laya】HttpRequest 网络请求
网络·typescript·游戏引擎·游戏程序·laya
JIes__3 天前
Unity(二)——MonoBehavior中的重要内容
unity·游戏引擎