Compile out editor-only logic within validate_property in games
This commit is contained in:
@@ -541,6 +541,9 @@ StringName Area2D::get_audio_bus_name() const {
|
||||
}
|
||||
|
||||
void Area2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (p_property.name == "audio_bus_name") {
|
||||
String options;
|
||||
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
|
||||
|
||||
@@ -646,6 +646,9 @@ void CharacterBody2D::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void CharacterBody2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (motion_mode == MOTION_MODE_FLOATING) {
|
||||
if (p_property.name.begins_with("floor_") || p_property.name == "up_direction" || p_property.name == "slide_on_ceiling") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
|
||||
@@ -790,6 +790,9 @@ void RigidBody2D::_bind_methods() {
|
||||
}
|
||||
|
||||
void RigidBody2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (center_of_mass_mode != CENTER_OF_MASS_MODE_CUSTOM && p_property.name == "center_of_mass") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user