for kst
用于在cocos creator平台对接kst版本kbe的typescript插件,已经实际用于微信小游戏开发并有上线项目。
kbe服务器引擎:https://github.com/imgamer/kbengine.git 其中develop1.x为最新分支。
- 把插件代码置于项目的assets目录:
assets/kbengine_typescript_plugin
- 项目代码目录为
assets/scripts
- 项目的 entity 定义在
assets/scripts/kbengine
目录中 - entity需继承于
assets/kbengine_typescript_plugin/kbengine/Entity
- 重要:必须在entity定义后注册脚本。例如:
Account.RegisterScript(Account.SCRIPT_NAME, Account);
请参考assets/kbengine_typescript_plugin/entities
的范例。
- 在cocos creator场景创建空节点KBEMain,添加组件
assets/kbengine_typescript_plugin/ClientApp.ts
- 配置KBEMain节点的kbe参数,详细参数说明请查看
ClientApp.ts
KBEMain.instance.run()
初始化kbeKBEMain.instance.Login(account, password, userData)
登录kbe服务器。