diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-02-26 20:50:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 20:50:41 +0100 |
commit | c68f0c7961aa2bcc2387e52be895b0bd3c6b4473 (patch) | |
tree | 9ea7726ea3455fa2327385637927a7afc96b3f44 /scene/2d | |
parent | 4d6a3cf7fcd2a7f777ede47120c987f0c545ee80 (diff) | |
parent | 0d6485d919e0d4685bcbcf8ec117ea698538f785 (diff) |
Merge pull request #7887 from bojidar-bg/particles-emission-ended
Add emission_finished signal to Particles2D
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/particles_2d.cpp | 13 | ||||
-rw-r--r-- | scene/2d/particles_2d.h | 1 |
2 files changed, 4 insertions, 10 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index da49f1b420..055bec2ca9 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "particles_2d.h" +#include "scene/scene_string_names.h" @@ -451,6 +452,7 @@ void Particles2D::_process_particles(float p_delta) { time=Math::fmod( time+frame_time, lifetime ); if (!emitting && active_count==0) { + emit_signal(SceneStringNames::get_singleton()->emission_finished); set_process(false); } @@ -918,15 +920,6 @@ Vector2 Particles2D::get_emission_half_extents() const { return extents; } -void Particles2D::testee(int a, int b, int c, int d, int e) { - - print_line(itos(a)); - print_line(itos(b)); - print_line(itos(c)); - print_line(itos(d)); - print_line(itos(e)); -} - void Particles2D::set_initial_velocity(const Vector2& p_velocity) { @@ -1092,6 +1085,8 @@ void Particles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_emission_points","points"),&Particles2D::set_emission_points); ClassDB::bind_method(D_METHOD("get_emission_points"),&Particles2D::get_emission_points); + ADD_SIGNAL(MethodInfo("emission_finished")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"config/amount",PROPERTY_HINT_EXP_RANGE,"1,1024"),"set_amount","get_amount") ; ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/lifetime",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),"set_lifetime","get_lifetime") ; ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/time_scale",PROPERTY_HINT_EXP_RANGE,"0.01,128,0.01"),"set_time_scale","get_time_scale") ; diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 91f42c5222..4a2d57d6b9 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -162,7 +162,6 @@ private: Color default_color; Ref<ColorRamp> color_ramp; - void testee(int a, int b, int c, int d, int e); void _process_particles(float p_delta); friend class ParticleAttractor2D; |