AirtestProject / Poco-SDK

https://github.com/AirtestProject/Poco
Apache License 2.0
284 stars 170 forks source link

[cocos2dx-js sdk 集成] PocoManager is not a constructor #53

Open Chou-Hua opened 5 years ago

Chou-Hua commented 5 years ago

已经将poco-sdk放入游戏目录,在main.js里 加入了

var PocoManager = window.PocoManager; var poco = new PocoManager() ; window.poco = poco;

执行后产生 PocoManager is not a constructor 此错误,想请教步骤是否有误?

project.json 也已经加入 "src/lib/Poco/sdk/AbstractDumper.js", "src/lib/Poco/sdk/AbstractNode.js", "src/lib/Poco/sdk/Attributor.js", "src/lib/Poco/sdk/DefaultMatcher.js", "src/lib/Poco/sdk/IScreen.js", "src/lib/Poco/sdk/Selector.js", "src/lib/Poco/Cocos2dxNode.js", "src/lib/Poco/Cocos2dxDumper.js", "src/lib/Poco/POCO_SDK_VERSION.js", "src/lib/Poco/Poco.js"

brighthead commented 5 years ago

检查一下 sc->addRegisterCallback(register_jsb_websocketserver); 这句话是不是在正确位置上,不确定的话 就把它放在 ScriptingCore* sc = ScriptingCore::getInstance(); 后面

Chou-Hua commented 5 years ago

@brighthead 大大好,因游戏为web并无AppDelegate.cpp 此档案可以进行上述描述的新增。还是cocos-2d js 仅支援APP无支援web游戏?!