Compile out editor-only logic within validate_property in games

This commit is contained in:
LuoZhihao
2025-06-12 12:54:19 +08:00
parent d9cd011e2f
commit 8ba4656ea3
69 changed files with 274 additions and 119 deletions

View File

@ -111,8 +111,8 @@ void AnimationMixer::_get_property_list(List<PropertyInfo> *p_list) const {
}
void AnimationMixer::_validate_property(PropertyInfo &p_property) const {
#ifdef TOOLS_ENABLED
if (editing && (p_property.name == "active" || p_property.name == "deterministic" || p_property.name == "root_motion_track")) {
#ifdef TOOLS_ENABLED // `editing` is surrounded by TOOLS_ENABLED so this should also be.
if (Engine::get_singleton()->is_editor_hint() && editing && (p_property.name == "active" || p_property.name == "deterministic" || p_property.name == "root_motion_track")) {
p_property.usage |= PROPERTY_USAGE_READ_ONLY;
}
#endif // TOOLS_ENABLED