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

@ -30,6 +30,8 @@
#include "gradient.h"
#include "core/config/engine.h"
Gradient::Gradient() {
//Set initial gradient transition from black to white
points.resize(2);
@ -88,6 +90,9 @@ void Gradient::_bind_methods() {
}
void Gradient::_validate_property(PropertyInfo &p_property) const {
if (!Engine::get_singleton()->is_editor_hint()) {
return;
}
if (p_property.name == "interpolation_color_space" && interpolation_mode == GRADIENT_INTERPOLATE_CONSTANT) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}