Merge pull request #6693 from J08nY/issue-editor-only-light

light: respect editor_only setting in release build, fixes #6665
This commit is contained in:
Rémi Verschelde 2016-10-09 14:10:27 +02:00 committed by GitHub
commit ca732a52dc
1 changed files with 4 additions and 2 deletions

View File

@ -446,6 +446,10 @@ bool editor_ok=true;
editor_ok = (get_tree()->get_edited_scene_root() && (this==get_tree()->get_edited_scene_root() || get_owner()==get_tree()->get_edited_scene_root())); editor_ok = (get_tree()->get_edited_scene_root() && (this==get_tree()->get_edited_scene_root() || get_owner()==get_tree()->get_edited_scene_root()));
} }
} }
#else
if (editor_only) {
editor_ok=false;
}
#endif #endif
VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible() && enabled && editor_ok); VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible() && enabled && editor_ok);
@ -672,5 +676,3 @@ void SpotLight::_bind_methods() {
ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "spot_attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "spot_attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION );
} }