I want to extend from Emitter class to add some additional logic. But I have some problems because init() and update() now - are big functions where parsing/prepare emitter/particle and than apply this changes. Override all this functions for add some code not good idea. So I added some protected function before apply changes to particle/emitter (applyAdditionalProperties() and initAdditional()).
Also spawnType parsing logic moved to separate function to easy override it (to parseSpawnType()).
Github show crazy diff but in real only create 2 empty functions and move spawn parsing to separate function.
example: create new spawn type where particles spawn on rect borders and move out by normal:
Hi.
I want to extend from Emitter class to add some additional logic. But I have some problems because init() and update() now - are big functions where parsing/prepare emitter/particle and than apply this changes. Override all this functions for add some code not good idea. So I added some protected function before apply changes to particle/emitter (applyAdditionalProperties() and initAdditional()). Also spawnType parsing logic moved to separate function to easy override it (to parseSpawnType()).
Github show crazy diff but in real only create 2 empty functions and move spawn parsing to separate function.
example: create new spawn type where particles spawn on rect borders and move out by normal: