Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Script & Custom Action's Function isDone() Always Return False #20395

Open
xiekang opened this issue Dec 4, 2019 · 0 comments
Open

Java Script & Custom Action's Function isDone() Always Return False #20395

xiekang opened this issue Dec 4, 2019 · 0 comments

Comments

@xiekang
Copy link

xiekang commented Dec 4, 2019

  • cocos2d-x version:v3 v4
  • devices test on:iphone7
  • developing environments
    • NDK version:
    • Xcode version:10.1
    • VS version:
    • browser type and version:

Steps to Reproduce:

code in ActionInterval.cpp like this:
void ActionInterval::step(float dt)
{
if (_firstTick)
{
_firstTick = false;
_elapsed = 0;
}
else
{
_elapsed += dt;
}

float updateDt = std::max(0.0f,                                  // needed for rewind. elapsed could be negative
                          std::min(1.0f, _elapsed / _duration)
                          );

if (sendUpdateEventToScript(updateDt, this)) return;

this->update(updateDt);

_done = _elapsed >= _duration;

}

" if (sendUpdateEventToScript(updateDt, this)) return;"
Code in this line will always return if your project has bound to JS.
And _done will always be false. So ActionManager won't stop it naturally.
I have committed a pull request. #20394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant