modification | 相关属性的修改。 |
bool 如果该属性是默认重载,则为 true。
如果将给定修改视为默认重载,则返回 true。
将预制件实例的根游戏对象上的某些属性视为默认覆盖。这些属性在默认情况下会被覆盖,通常很少应用或还原。大多数应用和还原操作将忽略默认覆盖。
默认重载为:
Root GameObject
- name
Root Transform
- localPosition
- localRotation
- localEulerAnglesHint(内部属性)
- rootOrder(内部属性)
Root RectTransform
- 与 Transform 相同的属性
- anchoredPosition
- sizeDelta
- anchorMin
- anchorMax
- pivot
这些属性是默认重载,从而防止在应用或还原整个预制件实例时出现常见错误。通常,您不会希望预制件实例的位置和旋转从预制件资源本身的位置和旋转中获得更新。属于默认重载的大多数其他属性本质上相似,因为它们与实例的基本对齐相关。
对预制件实例使用“Apply All”或“Revert All”不会影响默认重载。应用或还原默认重载的唯一方法是使用属性本身的上下文菜单。这对应于方法 PrefabUtility.ApplyPropertyOverride 和 PrefabUtility.RevertPropertyOverride。
由于这些方法不受大多数应用和还原操作的影响,因此覆盖的默认覆盖不会像覆盖的其他属性那样在检视面板中获得蓝色边距。它们也不会在 Overrides 下拉选单中显示为覆盖。不过它们在覆盖时为粗体,以便可以判断它们是否覆盖。
只有最外层预制件实例的根游戏对象(及其 Transform/RectTransform),才存在默认重载。这包括其他预制件内的最外层预制件实例(如预制件模式中所示)。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.