light: respect editor_only setting in release build and dont show the light

This commit is contained in:
J08nY 2016-10-03 16:23:43 +02:00
parent 3ecd8560fd
commit af35130b50
No known key found for this signature in database
GPG Key ID: 7F4A448FE68F329D
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()));
}
}
#else
if (editor_only) {
editor_ok=false;
}
#endif
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 );
}