Fixed #5563: Wrap override onEnter function by script call detection code to solve bugs in JSB