| 797 | } |
| 798 | |
| 799 | void ParticleEffect::OnEnable() |
| 800 | { |
| 801 | GetScene()->Ticking.Update.AddTick<ParticleEffect, &ParticleEffect::Update>(this); |
| 802 | GetSceneRendering()->AddActor(this, _sceneRenderingKey); |
| 803 | #if USE_EDITOR |
| 804 | GetSceneRendering()->AddViewportIcon(this); |
| 805 | GetScene()->Ticking.Update.AddTickExecuteInEditor<ParticleEffect, &ParticleEffect::UpdateExecuteInEditor>(this); |
| 806 | #endif |
| 807 | |
| 808 | if (PlayOnStart) |
| 809 | Play(); |
| 810 | |
| 811 | // Base |
| 812 | Actor::OnEnable(); |
| 813 | } |
| 814 | |
| 815 | void ParticleEffect::OnDisable() |
| 816 | { |