Closed wangyin215 closed 5 years ago
Look at this part of Effekseer ForCocos2d-x code
Temporary simple modifications to support this approach
Adding variables to the EffectEmitter class: bool played = false;
Set up in EffectEmitter::play() and EffectEmitter::play(int32_t startTime): played = true;
Modification in EffectEmitter::update(float delta): else if(removeOnStop) to: else if(removeOnStop & played)
I'm sorry for reply. I forget to see this message. Thank you for your information. I will fix this bug after few days.
I fixed bugs including it.
I released cocos2d-x 1.43c
In cocos2dx, emitter is created using sample code. But we don't want to play it when add it to scene, so we set emitter -> setPlayOnEnter (false); We add emitter to scene and call emitter -> play () when the button clicks. At this point the program crash out, because emitter has been released(i guess).
So after emitter was created, we tried to set emitter > setRemoveOnStop (false); It's all right now. You can play normally after you click the button.
But we actually want emitter -> setRemoveOnStop (true), because it's easy to do without having to manually handle the issue of remove emitter.
But if emitter -> setPlayOnEnter (false) and emitter - > setRemoveOnStop (true) are set at the same time, calling play by clicking the button will crash the app.
Thank you about the amazing tool.
Hope to answer this question.