Porting previous version which was based on Cocos 3.0 beta, to 3.0 'official'